finished init command - it now initialises the stuff
This commit is contained in:
@@ -1,8 +1,39 @@
|
||||
package globals
|
||||
|
||||
import (
|
||||
"fmt"
|
||||
"strconv"
|
||||
"os"
|
||||
)
|
||||
|
||||
|
||||
const (
|
||||
ConfigurationFolderName = ".chub"
|
||||
ConfigurationFilePermissions = 600
|
||||
ConfigurationFileName = "config"
|
||||
UrlOfTheService = "confighub.meteor.com"
|
||||
UrlOfTheService = "http://localhost:3000/api/"
|
||||
MimeTypeOfService = "application/json"
|
||||
)
|
||||
|
||||
|
||||
func PanicWithStyle(message string, err error) {
|
||||
if err != nil {
|
||||
panic(fmt.Sprintf("%v:\n%v", message, err))
|
||||
}
|
||||
}
|
||||
|
||||
func RuneToAscii(r rune) string {
|
||||
if r < 128 {
|
||||
return string(r)
|
||||
} else {
|
||||
return "\\u" + strconv.FormatInt(int64(r), 16)
|
||||
}
|
||||
}
|
||||
|
||||
func FileExists(path string) (bool) {
|
||||
_, err := os.Stat(path)
|
||||
if err == nil { return true }
|
||||
if os.IsNotExist(err) { return false }
|
||||
PanicWithStyle("This should not be happening. Call 911 !" , err)
|
||||
return false
|
||||
}
|
||||
Reference in New Issue
Block a user