parent
c5493fd1f1
commit
e858cbe2cf
@ -0,0 +1,11 @@
|
||||
package conf
|
||||
|
||||
import "io/ioutil"
|
||||
|
||||
const BackendVersion = string("3.0.0-b")
|
||||
|
||||
// WriteVersionLock 将当前版本信息写入 version.lock
|
||||
func WriteVersionLock() error {
|
||||
err := ioutil.WriteFile("version.lock", []byte(BackendVersion), 0644)
|
||||
return err
|
||||
}
|
@ -0,0 +1,13 @@
|
||||
package util
|
||||
|
||||
import "os"
|
||||
|
||||
// Exists reports whether the named file or directory exists.
|
||||
func Exists(name string) bool {
|
||||
if _, err := os.Stat(name); err != nil {
|
||||
if os.IsNotExist(err) {
|
||||
return false
|
||||
}
|
||||
}
|
||||
return true
|
||||
}
|
Loading…
Reference in new issue