pttodo-cli works even if file does not initially exist
This commit is contained in:
@@ -40,6 +40,7 @@ func edit(filepath string) error {
|
||||
if err != nil {
|
||||
return err
|
||||
}
|
||||
if _, err := os.Stat(filepath); err == nil {
|
||||
g, err := os.Open(filepath)
|
||||
if err != nil {
|
||||
return err
|
||||
@@ -48,6 +49,7 @@ func edit(filepath string) error {
|
||||
return err
|
||||
}
|
||||
g.Close()
|
||||
}
|
||||
f.Close()
|
||||
tempFile = f.Name()
|
||||
return nil
|
||||
|
||||
Reference in New Issue
Block a user