fix: ensure we create the app-json data directory for the app on app creation
This commit is contained in:
1 parent
b83e5fff64
commit
e78fb84953
1 file changed
+10
@@ -160,6 +160,16 @@ func TriggerPostCreate(appName string) error {
|
|||||||
return common.CreateAppDataDirectory("app-json", appName)
|
return common.CreateAppDataDirectory("app-json", appName)
|
||||||
}
|
}
|
||||||
|
|
||||||
|
// TriggerPostCreate ensures the app-json directory for the app is created
|
||||||
|
func TriggerPostCreate(appName string) error {
|
||||||
|
directory := filepath.Join(common.MustGetEnv("DOKKU_LIB_ROOT"), "data", "app-json", appName)
|
||||||
|
if err := os.MkdirAll(directory, 0755); err != nil {
|
||||||
|
return err
|
||||||
|
}
|
||||||
|
|
||||||
|
return common.SetPermissions(directory, 0755)
|
||||||
|
}
|
||||||
|
|
||||||
// TriggerPostDelete destroys the app-json data for a given app container
|
// TriggerPostDelete destroys the app-json data for a given app container
|
||||||
func TriggerPostDelete(appName string) error {
|
func TriggerPostDelete(appName string) error {
|
||||||
dataErr := os.RemoveAll(common.GetAppDataDirectory("app-json", appName))
|
dataErr := os.RemoveAll(common.GetAppDataDirectory("app-json", appName))
|
||||||
|
|||||||
Reference in new issue
Block a user