mirror of
https://github.com/rwinkhart/libmutton.git
synced 2026-08-31 06:16:35 -04:00
Refactor for better modularity (share more code among edit functions, rename "offline" package to "backend"
This commit is contained in:
@@ -0,0 +1,17 @@
|
||||
package backend
|
||||
|
||||
import (
|
||||
"fmt"
|
||||
"os"
|
||||
)
|
||||
|
||||
func Shear(targetLocation string) {
|
||||
// TODO If in online mode, remove from server and add to shear list
|
||||
TargetIsFile(targetLocation, true, 0) // needed because os.RemoveAll does not return an error if target does not exist
|
||||
err := os.RemoveAll(targetLocation)
|
||||
if err != nil {
|
||||
fmt.Println(AnsiError + "Failed to remove target: " + err.Error() + AnsiReset)
|
||||
os.Exit(1)
|
||||
}
|
||||
os.Exit(0)
|
||||
}
|
||||
Reference in New Issue
Block a user