Full application rewrite

This commit is contained in:
2025-01-04 01:49:48 +03:00
parent 70f32b799c
commit 754aecd69a
32 changed files with 1244 additions and 489 deletions

View File

@@ -0,0 +1,21 @@
package modes
import (
"fmt"
"os"
)
type Move struct {
}
func (m Move) PlaceIt(sourcePath, targetPath string, mode os.FileMode) error {
if err := os.Rename(sourcePath, targetPath); err != nil {
return fmt.Errorf("rename %s to %s: %w", sourcePath, targetPath, err)
}
if err := os.Chmod(targetPath, mode); err != nil {
return fmt.Errorf("chmod hard link: %w", err)
}
return nil
}