diff --git a/src/github.com/mickep76/etcdtool/command/edit_command.go b/src/github.com/mickep76/etcdtool/command/edit_command.go index ea5d200..f692ea6 100644 --- a/src/github.com/mickep76/etcdtool/command/edit_command.go +++ b/src/github.com/mickep76/etcdtool/command/edit_command.go @@ -75,8 +75,16 @@ func editCommandFunc(c *cli.Context) { // Temporary file append file type to support syntax highlighting tmpfile := c.String("tmp-file") + "." + strings.ToLower(c.String("format")) - // Export to file. - exportFunc(dir, sort, tmpfile, f, c, ki) + // If file exist's resume editing? + if _, err := os.Stat(tmpfile); os.IsNotExist(err) { + // Export to file. + exportFunc(dir, sort, tmpfile, f, c, ki) + } else { + if !askYesNo(fmt.Sprintf("Temp. file already exist's resume editing")) { + // Export to file. + exportFunc(dir, sort, tmpfile, f, c, ki) + } + } // Get modified time stamp. before, err := os.Stat(tmpfile) diff --git a/src/github.com/mickep76/etcdtool/version.go b/src/github.com/mickep76/etcdtool/version.go index 0195553..bfe4fb9 100644 --- a/src/github.com/mickep76/etcdtool/version.go +++ b/src/github.com/mickep76/etcdtool/version.go @@ -1,4 +1,4 @@ package main // Version for app. -const Version = "3.0" +const Version = "3.1"