-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Remove gnu rm command as a dependency
- Loading branch information
1 parent
fee5c27
commit 9b817cc
Showing
5 changed files
with
84 additions
and
33 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,9 +1,13 @@ | ||
package cli | ||
|
||
// 2rm CLI arguments | ||
const HARD_DELETE_CLA = "--hard" | ||
const SOFT_DELETE_CLA = "--soft" | ||
const SILENT_CLA = "--silent" | ||
const DRY_RUN_CLA = "--dry-run" | ||
const BYPASS_PROTECTED_CLA = "--bypass-protected" | ||
const OVERWRITE_CLA = "--overwrite" | ||
const NOTIFICATION_CLA = "--notify" | ||
|
||
// gnu rm CLI arguments | ||
const INTERACTIVE_CLA = "-i" |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,23 @@ | ||
package util | ||
|
||
import ( | ||
"io" | ||
"os" | ||
) | ||
|
||
func CopyFile(src, dst string) error { | ||
sourceFile, err := os.Open(src) | ||
if err != nil { | ||
return err | ||
} | ||
defer sourceFile.Close() | ||
|
||
destFile, err := os.Create(dst) | ||
if err != nil { | ||
return err | ||
} | ||
defer destFile.Close() | ||
|
||
_, err = io.Copy(destFile, sourceFile) | ||
return err | ||
} |