-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathgit-push-timer.qml
More file actions
24 lines (22 loc) · 815 Bytes
/
git-push-timer.qml
File metadata and controls
24 lines (22 loc) · 815 Bytes
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
import QtQml 2.0
import QOwnNotesTypes 1.0
QtObject {
/**
* This starts a timer that triggers every 30 seconds
*/
property QtObject timer: Timer {
interval: 30000
repeat: true
running: true
onTriggered: {
var notesFolderPath = script.toNativeDirSeparators(script.currentNoteFolderPath());
var notesDrivePath = notesFolderPath.substr(0, 2);
var changeDirCmd = "cd /d " + notesDrivePath + " && " + "cd " + notesFolderPath;
var gitPushCmd = "git push";
var cmd = changeDirCmd + " && " + gitPushCmd;
script.log("[git-push-timer] pushing...");
script.startDetachedProcess("cmd.exe", ["/C", cmd]);
script.log("[git-push-timer] pushed");
}
}
}