fix: dst dir bug
This commit is contained in:
@@ -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 {
|
||||
|
||||
Reference in New Issue
Block a user