package common import ( "fmt" "os" "os/user" "path" "path/filepath" "runtime" "strings" "github.com/kardianos/osext" ) // MakeName creates a node name that follows the ethereum convention // for such names. It adds the operation system name and Go runtime version // the name. func MakeName(name, version string) string { return fmt.Sprintf("%s/v%s/%s/%s", name, version, runtime.GOOS, runtime.Version()) } func ExpandHomePath(p string) (path string) { path = p // Check in case of paths like "/something/~/something/" if len(path) > 1 && path[:2] == "~/" { usr, _ := user.Current() dir := usr.HomeDir path = strings.Replace(p, "~", dir, 1) } return } func FileExist(filePath string) bool { _, err := os.Stat(filePath) if err != nil && os.IsNotExist(err) { return false } return true } func AbsolutePath(Datadir string, filename string) string { if path.IsAbs(filename) { return filename } return path.Join(Datadir, filename) } func DefaultAssetPath() string { var assetPath string pwd, _ := os.Getwd() srcdir := path.Join(os.Getenv("GOPATH"), "src", "github.com", "ethereum", "go-ethereum", "cmd", "mist") // If the current working directory is the go-ethereum dir // assume a debug build and use the source directory as // asset directory. if pwd == srcdir { assetPath = path.Join(pwd, "assets") } else { switch runtime.GOOS { case "darwin": // Get Binary Directory exedir, _ := osext.ExecutableFolder() assetPath = filepath.Join(exedir, "../Resources") case "linux": assetPath = "/usr/share/mist" case "windows": assetPath = "./assets" default: assetPath = "." } } // Check if the assetPath exists. If not, try the source directory // This happens when binary is run from outside cmd/mist directory if _, err := os.Stat(assetPath); os.IsNotExist(err) { assetPath = path.Join(srcdir, "assets") } return assetPath } func DefaultDataDir() string { usr, _ := user.Current() if runtime.GOOS == "darwin" { return path.Join(usr.HomeDir, "Library/Ethereum") } else if runtime.GOOS == "windows" { return path.Join(usr.HomeDir, "AppData/Roaming/Ethereum") } else { return path.Join(usr.HomeDir, ".ethereum") } } func IsWindows() bool { return runtime.GOOS == "windows" } func WindonizePath(path string) string { if string(path[0]) == "/" && IsWindows() { path = path[1:] } return path } arn/devel/electron4/files/minimist-1.2.2'>dependabot/npm_and_yarn/devel/electron4/files/minimist-1.2.2 FreeBSD GNOME current development ports (https://github.com/freebsd/freebsd-ports-gnome)
aboutsummaryrefslogtreecommitdiffstats
path: root/games/naev-data
Commit message (Expand)AuthorAgeFilesLines
* - Update to 0.7.0acm2017-08-042-4/+5
* - Switch to newly supported CC licensesamdmi32016-09-131-9/+1
* Add Public Domain support to ports license framework. You can now useamdmi32016-01-121-4/+0
* - Update to 0.6.1amdmi32015-11-153-15/+12
* - Update to 0.6.0amdmi32015-04-243-16/+27
* Revert r375084bapt2014-12-231-0/+1
* Cleanup plistbapt2014-12-211-1/+0
* Stagify.vanilla2014-06-161-3/+2
* Add NO_STAGE all over the place in preparation for the staging support (cat: ...bapt2013-09-211-5/+2
* - Update to 0.5.3acm2012-08-102-3/+3
* - Update to 0.5.2acm2012-03-312-3/+3
* - Update to 0.5.1acm2012-03-262-3/+3
* - Update to 0.5.0acm2011-06-252-5/+5
* - Update to 0.4.2acm2010-08-112-4/+4
* - Update to 0.4.1acm2010-01-272-4/+4