mirror of
https://github.com/filebrowser/filebrowser.git
synced 2024-06-07 23:00:43 +00:00
update install script
This commit is contained in:
parent
1da6363db7
commit
e9b13f961b
@ -154,17 +154,24 @@ func Install() string {
|
|||||||
tempfiles = append(tempfiles, bin+"/README.md", bin+"/LICENSE.md")
|
tempfiles = append(tempfiles, bin+"/README.md", bin+"/LICENSE.md")
|
||||||
clean()
|
clean()
|
||||||
|
|
||||||
ftorename := bin + "/" + strings.Replace(filename, ".tar.gz", "", 1)
|
ftorename := bin + "/"
|
||||||
|
|
||||||
if runtime.GOOS == "darwin" {
|
switch runtime.GOOS {
|
||||||
ftorename = bin + "/" + strings.Replace(filename, ".zip", "", 1)
|
case "darwin":
|
||||||
|
ftorename += strings.Replace(filename, ".zip", "", 1)
|
||||||
|
case "windows":
|
||||||
|
ftorename += strings.Replace(filename, ".zip", ".exe", 1)
|
||||||
|
default:
|
||||||
|
ftorename += strings.Replace(filename, ".tar.gz", "", 1)
|
||||||
}
|
}
|
||||||
|
|
||||||
if runtime.GOOS == "windows" {
|
err = os.Rename(ftorename, hugo)
|
||||||
ftorename = bin + "/" + strings.Replace(filename, ".zip", ".exe", 1)
|
|
||||||
|
if err != nil {
|
||||||
|
fmt.Println(err)
|
||||||
|
os.Exit(-1)
|
||||||
}
|
}
|
||||||
|
|
||||||
os.Rename(ftorename, hugo)
|
|
||||||
fmt.Println("Hugo installed at " + hugo)
|
fmt.Println("Hugo installed at " + hugo)
|
||||||
return hugo
|
return hugo
|
||||||
}
|
}
|
||||||
|
Loading…
Reference in New Issue
Block a user