Fixing silly flag test error
This commit is contained in:
parent
3538840d72
commit
20746f6640
@ -48,9 +48,8 @@ func usage() {
|
|||||||
}
|
}
|
||||||
|
|
||||||
func main() {
|
func main() {
|
||||||
homeDir := os.Getenv("HOME")
|
|
||||||
taskName := flag.String("task", "default", "name of task to execute")
|
taskName := flag.String("task", "default", "name of task to execute")
|
||||||
dstDir := flag.String("dest", homeDir, "target directory for tasks")
|
dstDir := flag.String("dest", os.Getenv("HOME"), "target directory for tasks")
|
||||||
force := flag.Bool("force", true, "create parent directories to target")
|
force := flag.Bool("force", true, "create parent directories to target")
|
||||||
clobber := flag.Bool("clobber", false, "delete files and directories at target")
|
clobber := flag.Bool("clobber", false, "delete files and directories at target")
|
||||||
verbose := flag.Bool("verbose", false, "verbose output")
|
verbose := flag.Bool("verbose", false, "verbose output")
|
||||||
|
2
link.go
2
link.go
@ -115,7 +115,7 @@ func processLink(params []string, conf *config) error {
|
|||||||
dstPathAbs = path.Join(conf.dstDir, dstPath)
|
dstPathAbs = path.Join(conf.dstDir, dstPath)
|
||||||
}
|
}
|
||||||
|
|
||||||
if conf.flags&flagUnlink == 0 {
|
if conf.flags&flagUnlink != flagUnlink {
|
||||||
if _, err := os.Stat(srcPathAbs); os.IsNotExist(err) {
|
if _, err := os.Stat(srcPathAbs); os.IsNotExist(err) {
|
||||||
return fmt.Errorf("source path %s does not exist in filesystem", srcPathAbs)
|
return fmt.Errorf("source path %s does not exist in filesystem", srcPathAbs)
|
||||||
}
|
}
|
||||||
|
Loading…
Reference in New Issue
Block a user