Skip to content

Commit

Permalink
Merge pull request #191 from warrensbox/develop
Browse files Browse the repository at this point in the history
testing SNAP_REAL_HOME
  • Loading branch information
warrensbox authored Aug 12, 2021
2 parents 76ee4c0 + c7b1a83 commit b9e4693
Showing 1 changed file with 7 additions and 5 deletions.
12 changes: 7 additions & 5 deletions lib/install.go
Original file line number Diff line number Diff line change
Expand Up @@ -288,12 +288,14 @@ func InstallableBinLocation(userBin string) string {
}

/* Setup for SNAPCRAFT Users */
SNAP := os.Getenv("SNAP_USER_COMMON")
SNAP := os.Getenv("SNAP_REAL_HOME")
if SNAP != "" { //if SNAP_USER_COMMON env is set, install
CreateDirIfNotExist(filepath.Join(usr.HomeDir, "bin"))
fmt.Printf("Installing terraform at %s\n", filepath.Join(usr.HomeDir, "bin"))
fmt.Printf("RUN `export PATH=$PATH:%s` to append bin to $PATH\n", filepath.Join(usr.HomeDir, "bin"))
return filepath.Join(usr.HomeDir, "bin", "terraform")
snapHomePath := filepath.Join(SNAP, "bin")
fmt.Println(snapHomePath)
CreateDirIfNotExist(snapHomePath)
fmt.Printf("Installing terraform at %s\n", snapHomePath)
fmt.Printf("RUN `export PATH=$PATH:%s` to append bin to $PATH\n", snapHomePath)
return filepath.Join(snapHomePath, "terraform")
}

existDefaultBin := CheckDirExist(userBin) //the default is /usr/local/bin but users can provide custom bin locations
Expand Down

0 comments on commit b9e4693

Please sign in to comment.