From 0b45aea1d0dd4969c9e923ada268a1471ad6ad02 Mon Sep 17 00:00:00 2001 From: Jose Diaz-Gonzalez Date: Tue, 10 Jan 2023 02:10:06 -0500 Subject: [PATCH] fix: just create the data directory if the old data directory doesn't exist --- plugins/common/data.go | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/plugins/common/data.go b/plugins/common/data.go index fa7f5f512..409018c78 100644 --- a/plugins/common/data.go +++ b/plugins/common/data.go @@ -54,6 +54,10 @@ func RemoveAppDataDirectory(pluginName, appName string) error { // CloneAppData copies the data from one app to another func CloneAppData(pluginName string, oldAppName string, newAppName string) error { oldDataDir := GetAppDataDirectory(pluginName, oldAppName) + if !DirectoryExists(oldDataDir) { + return CreateAppDataDirectory(pluginName, newAppName) + } + newDataDir := GetAppDataDirectory(pluginName, newAppName) if err := copy.Copy(oldDataDir, newDataDir); err != nil { return fmt.Errorf("Unable to clone app data to new location: %v", err.Error())