Skip to content

Commit

Permalink
don't launch editor when source dir doesn't support edits dir
Browse files Browse the repository at this point in the history
  • Loading branch information
Dieterbe committed Dec 27, 2013
1 parent 5bf1f9f commit 34b9721
Showing 1 changed file with 4 additions and 0 deletions.
4 changes: 4 additions & 0 deletions pixie.go
Expand Up @@ -249,6 +249,10 @@ func api_edit_handler(w http.ResponseWriter, r *http.Request, conn_sqlite *sql.D
backend.ErrorJson(w, backend.Resp{fmt.Sprintf("Edits directory '%s' seems to exist but unable to read: %s", edits_dir, err)}, 503)
return
}
if edits_dir == "" {
backend.ErrorJson(w, backend.Resp{fmt.Sprintf("dir is not in a format that supports an edits dir")}, 409)
return
}
orig := path.Join(dir, name)
ext := path.Ext(name)
tmp := path.Join(edits_dir, name[:len(name)-len(ext)]+"-save-your-edit-to-a-new-file"+ext)
Expand Down

0 comments on commit 34b9721

Please sign in to comment.