mirror of
https://github.com/sbrow/envr.git
synced 2025-12-29 15:47:38 -05:00
fix(sync): Fixed an issue where deleted folders would be restored.
This commit is contained in:
@@ -99,8 +99,8 @@ func getGitRemotes(dir string) []string {
|
|||||||
func (file EnvFile) Restore() error {
|
func (file EnvFile) Restore() error {
|
||||||
// TODO: Handle restores more cleanly
|
// TODO: Handle restores more cleanly
|
||||||
// Ensure the directory exists
|
// Ensure the directory exists
|
||||||
if err := os.MkdirAll(filepath.Dir(file.Path), 0755); err != nil {
|
if _, err := os.Stat(file.Dir); err != nil {
|
||||||
return fmt.Errorf("failed to create directory: %w", err)
|
return fmt.Errorf("directory missing")
|
||||||
}
|
}
|
||||||
|
|
||||||
// Check if file already exists
|
// Check if file already exists
|
||||||
|
|||||||
Reference in New Issue
Block a user