generated from brevdev/seed
-
Notifications
You must be signed in to change notification settings - Fork 17
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
* deadcode: pass 1 * deadcode: pass 2 * deadcode: pass 3 * deadcode: pass 4 * deadcode: pass 5 * deadcode: pass 6 * deadcode: pass 7 --------- Co-authored-by: Travis Cline <[email protected]>
- Loading branch information
Showing
35 changed files
with
54 additions
and
3,086 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,48 +1,11 @@ | ||
package autostartconf | ||
|
||
import ( | ||
"path/filepath" | ||
|
||
breverrors "github.com/brevdev/brev-cli/pkg/errors" | ||
) | ||
|
||
type StaticBinaryConfigurer struct { | ||
LinuxSystemdConfigurer | ||
URL string | ||
Name string | ||
} | ||
|
||
func (sbc StaticBinaryConfigurer) Install() error { | ||
_ = sbc.UnInstall() // best effort | ||
|
||
// download binary | ||
err := sbc.Store.DownloadBinary( | ||
sbc.URL, | ||
filepath.Join("/usr/local/bin", sbc.Name), | ||
) | ||
if err != nil { | ||
return breverrors.WrapAndTrace(err) | ||
} | ||
// best effort | ||
|
||
err = sbc.Store.WriteString(sbc.getDestConfigFile(), sbc.ValueConfigFile) | ||
if err != nil { | ||
return breverrors.WrapAndTrace(err) | ||
} | ||
|
||
if ShouldSymlink() { | ||
errother := sbc.CreateForcedSymlink() | ||
if errother != nil { | ||
return breverrors.WrapAndTrace(errother) | ||
} | ||
} else { | ||
errother := ExecCommands([][]string{ | ||
{"systemctl", "enable", sbc.ServiceName}, | ||
{"systemctl", "start", sbc.ServiceName}, | ||
{"systemctl", "daemon-reload"}, | ||
}) | ||
if errother != nil { | ||
return breverrors.WrapAndTrace(errother) | ||
} | ||
} | ||
return nil | ||
} | ||
// download binary |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.