refactor: migrate the app deploy lock to the data directory
This removes it from the app path, hopefully making backups a bit easier to perform.
This commit is contained in:
@@ -17,8 +17,8 @@ func appExists(appName string) error {
|
||||
|
||||
// checks if an app is locked
|
||||
func appIsLocked(appName string) bool {
|
||||
lockfilePath := fmt.Sprintf("%v/.deploy.lock", common.AppRoot(appName))
|
||||
_, err := os.Stat(lockfilePath)
|
||||
lockPath := getLockPath(appName)
|
||||
_, err := os.Stat(lockPath)
|
||||
return !os.IsNotExist(err)
|
||||
}
|
||||
|
||||
@@ -94,6 +94,11 @@ func destroyApp(appName string) error {
|
||||
return nil
|
||||
}
|
||||
|
||||
// returns the lock path
|
||||
func getLockPath(appName string) string {
|
||||
return fmt.Sprintf("%v/.deploy.lock", common.GetDataDirectory(appName))
|
||||
}
|
||||
|
||||
// creates an app if allowed
|
||||
func maybeCreateApp(appName string) error {
|
||||
if err := appExists(appName); err == nil {
|
||||
|
||||
Reference in New Issue
Block a user