1
0
mirror of https://github.com/kataras/iris.git synced 2026-01-10 13:35:59 +00:00

Replace utils/file with go-fs and go-installer, fix previous tests

This commit is contained in:
Gerasimos Maropoulos
2016-09-01 06:34:55 +03:00
parent 1d49188da9
commit 6163726bc5
7 changed files with 65 additions and 362 deletions

28
utils/installer.go Normal file
View File

@@ -0,0 +1,28 @@
package utils
import (
"os"
"runtime"
)
const (
// ContentBINARY is the string of "application/octet-stream response headers
ContentBINARY = "application/octet-stream"
)
var (
// AssetsDirectory the path which iris saves some assets came from the internet ( used in iris control plugin (to download the html,css,js) and for iris command line tool to download the packages)
AssetsDirectory = ""
)
// init just sets the iris path for assets, used in iris control plugin and for iris command line tool(create command)
// the AssetsDirectory path should be like: C:/users/kataras/.iris (for windows) and for linux you can imagine
func init() {
homepath := ""
if runtime.GOOS == "windows" {
homepath = os.Getenv("HOMEDRIVE") + os.Getenv("HOMEPATH")
} else {
homepath = os.Getenv("HOME")
}
AssetsDirectory = homepath + PathSeparator + ".iris"
}