Skip to content
This repository has been archived by the owner on Oct 3, 2023. It is now read-only.

Commit

Permalink
Fixed postinstall
Browse files Browse the repository at this point in the history
  • Loading branch information
nicholasdille committed Jun 19, 2023
1 parent 0c46f48 commit 5ab2505
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 7 deletions.
1 change: 1 addition & 0 deletions cmd/docker-setup/init.go
Original file line number Diff line number Diff line change
Expand Up @@ -30,6 +30,7 @@ var registryImagePrefix = registry + "/" + repository + toolSeparator
var tools tool.Tools

var emojiTool = "\U0001F528"
var emojiRun = "\U0001FE0F"

func directoryExists(directory string) bool {
log.Tracef("Checking if directory %s exists", directory)
Expand Down
13 changes: 6 additions & 7 deletions cmd/docker-setup/postinstall.go
Original file line number Diff line number Diff line change
Expand Up @@ -16,12 +16,10 @@ func initPostinstallCmd() {
}

var postinstallCmd = &cobra.Command{
Use: "install [tool...]",
Aliases: []string{"i"},
Short: "Install tools",
Long: header + "\nInstall and update tools",
Args: cobra.OnlyValidArgs,
ValidArgs: tools.GetNames(),
Use: "postinstall",
Short: "Run postinstall for tools",
Long: header + "\nRun postinstall for tools",
Args: cobra.NoArgs,
RunE: func(cmd *cobra.Command, args []string) error {
return postinstall()
},
Expand Down Expand Up @@ -50,13 +48,14 @@ func postinstall() error {
if !file.IsDir() && strings.HasSuffix(file.Name(), ".sh") {
fmt.Printf("Running post_install script %s\n", file.Name())

log.Tracef("Running post_install script %s", "/"+libDirectory+"/post_install/"+file.Name())
log.Tracef("%s Running post_install script %s", emojiRun, "/"+libDirectory+"/post_install/"+file.Name())
cmd := exec.Command("/bin/bash", "/"+libDirectory+"/post_install/"+file.Name())
cmd.Env = append(os.Environ(),
"prefix=",
"target=/"+target,
"arch="+arch,
"alt_arch="+altArch,
"docker_setup_contrib=/"+libDirectory+"/contrib",
)
output, err := cmd.CombinedOutput()
if err != nil {
Expand Down

0 comments on commit 5ab2505

Please sign in to comment.