When a folder is created on the client, also create it on the server

This commit is contained in:
2024-05-16 21:15:16 -04:00
parent 1ca55b8ac6
commit 8571faee94
4 changed files with 28 additions and 25 deletions
-23
View File
@@ -1,23 +0,0 @@
package backend
import (
"fmt"
"os"
)
// AddFolder creates a new directory at targetLocation
func AddFolder(targetLocation string) {
// create the directory specified by targetLocation
err := os.Mkdir(targetLocation, 0700)
if err != nil {
if os.IsExist(err) {
fmt.Println(AnsiError + "Directory already exists" + AnsiReset)
os.Exit(1)
} else {
fmt.Println(AnsiError + "Failed to create directory: " + err.Error() + AnsiReset)
os.Exit(1)
}
}
// TODO If in online mode, create the directory on the server
os.Exit(0)
}