quickjs cli tool:
changed: allow command line params for editor added: diff before push changed: bypass confimation message for encryption
This commit is contained in:
parent
73be3d91ee
commit
f716fb83f1
|
@ -12,11 +12,14 @@ function editnote()
|
||||||
file.puts(currentnote.content);
|
file.puts(currentnote.content);
|
||||||
file.close();
|
file.close();
|
||||||
|
|
||||||
os.exec([settings.editor, "data/note.md"]);
|
os.exec(["cp", "data/note.md", "data/backup.md"]);
|
||||||
|
|
||||||
|
os.exec(settings.editor.concat("data/note.md"));
|
||||||
|
|
||||||
var newcontent = std.loadFile("data/note.md");
|
var newcontent = std.loadFile("data/note.md");
|
||||||
if (currentnote.content != newcontent)
|
if (currentnote.content != newcontent)
|
||||||
{
|
{
|
||||||
|
os.exec(["diff", "--color", "data/backup.md", "data/note.md"]);
|
||||||
currentnote.content = newcontent;
|
currentnote.content = newcontent;
|
||||||
|
|
||||||
notes.splice(notes.indexOf(currentnote), 1);
|
notes.splice(notes.indexOf(currentnote), 1);
|
||||||
|
@ -26,7 +29,7 @@ function editnote()
|
||||||
file.puts(JSON.stringify(notes));
|
file.puts(JSON.stringify(notes));
|
||||||
file.close();
|
file.close();
|
||||||
|
|
||||||
os.exec([settings.gpg, "--encrypt", "--yes", "--output", "data/data2.acs", "--armor", "-r", settings.gpguser, "data/data2.json"]);
|
os.exec([settings.gpg, "--encrypt", "--yes", "--trust-model", "always", "--output", "data/data2.acs", "--armor", "-r", settings.gpguser, "data/data2.json"]);
|
||||||
var newdata = std.loadFile("data/data2.acs");
|
var newdata = std.loadFile("data/data2.acs");
|
||||||
console.log("sending data file to server...");
|
console.log("sending data file to server...");
|
||||||
|
|
||||||
|
|
|
@ -1,7 +1,7 @@
|
||||||
{
|
{
|
||||||
"password": "",
|
"password": "",
|
||||||
"url": "http://localhost:8000",
|
"url": "http://localhost:8000",
|
||||||
"editor": "vim",
|
"editor": ["vim"],
|
||||||
"gpg": "gpg",
|
"gpg": "gpg",
|
||||||
"gpguser": ""
|
"gpguser": ""
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in New Issue