Skip to content
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
9 changes: 5 additions & 4 deletions lib/install.go
Original file line number Diff line number Diff line change
Expand Up @@ -19,15 +19,16 @@ const (
)

var (
homeDir = os.Getenv("HOME")
installFile = "%s"
installVersion = "%s_"
binLocation = "/usr/local/bin/%s"
binLocation = "%s/.local/bin/%s"
installPath = "/.%s/"
installLocation = "/tmp"
installedBinPath = "/tmp"
)

//Install : Install the provided version in the argument
// Install : Install the provided version in the argument
func Install(url string, appversion string, assests []modal.Repo) string {

/* get current user */
Expand All @@ -40,7 +41,7 @@ func Install(url string, appversion string, assests []modal.Repo) string {
app := slice[1]

installPath = fmt.Sprintf(installPath, app)
bin := fmt.Sprintf(binLocation, app)
bin := fmt.Sprintf(binLocation, homeDir, app)

installVersion = fmt.Sprintf(installVersion, app)
installFile = fmt.Sprintf(installFile, app)
Expand Down Expand Up @@ -260,7 +261,7 @@ func GetRecentVersions() ([]string, error) {
return nil, nil
}

//CreateRecentFile : create a recent file
// CreateRecentFile : create a recent file
func CreateRecentFile(requestedVersion string) {
WriteLines([]string{requestedVersion}, installLocation+recentFile)
}