diff --git a/backend/app/service/commands/compress.go b/backend/app/service/commands/compress.go index b98838f..bdf62da 100644 --- a/backend/app/service/commands/compress.go +++ b/backend/app/service/commands/compress.go @@ -78,9 +78,9 @@ func Serve(cmd *cobra.Command, args []string) error { func commandCompress(dir string) error { dstPath := filepath.Join(dir, "compressed") // check if the directory exists - if _, err := os.Stat(dir); os.IsNotExist(err) { - if err := os.MkdirAll(dir, 0o755); err != nil { - return errors.Wrapf(err, "failed to create directory: %s", dir) + if _, err := os.Stat(dstPath); os.IsNotExist(err) { + if err := os.MkdirAll(dstPath, 0o755); err != nil { + return errors.Wrapf(err, "failed to create directory: %s", dstPath) } } if err := readDB(dir); err != nil {