|
|
@ -17,19 +17,10 @@ |
|
|
|
package common |
|
|
|
package common |
|
|
|
|
|
|
|
|
|
|
|
import ( |
|
|
|
import ( |
|
|
|
"fmt" |
|
|
|
|
|
|
|
"os" |
|
|
|
"os" |
|
|
|
"path/filepath" |
|
|
|
"path/filepath" |
|
|
|
"runtime" |
|
|
|
|
|
|
|
) |
|
|
|
) |
|
|
|
|
|
|
|
|
|
|
|
// 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()) |
|
|
|
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
// FileExist checks if a file exists at filePath.
|
|
|
|
// FileExist checks if a file exists at filePath.
|
|
|
|
func FileExist(filePath string) bool { |
|
|
|
func FileExist(filePath string) bool { |
|
|
|
_, err := os.Stat(filePath) |
|
|
|
_, err := os.Stat(filePath) |
|
|
|