gitSync when changing playgrounds file
This commit is contained in:
@@ -39,7 +39,8 @@
|
||||
|
||||
(method changePlaygrounds [:Dynamic->Void change]
|
||||
(change playgrounds)
|
||||
(File.saveContent (joinPath archiveDir "playgrounds.json") (haxe.Json.stringify playgrounds "\t")))
|
||||
(File.saveContent (joinPath archiveDir "playgrounds.json") (haxe.Json.stringify playgrounds "\t"))
|
||||
(gitSync))
|
||||
|
||||
(method :String currentPlayground []
|
||||
(dictGet playgrounds "default"))
|
||||
@@ -87,11 +88,7 @@
|
||||
(doFor system systems
|
||||
(system.checkEntryInOrOut this e)))
|
||||
|
||||
(method _saveEntry [:Entry e]
|
||||
(File.saveContent
|
||||
(joinPath archiveDir "entries" (e.id.withExtension "json"))
|
||||
(tink.Json.stringify e))
|
||||
|
||||
(method gitSync []
|
||||
// Sync with git if the archive is a repository:
|
||||
(whenLet [(Some gitDir) gitDir
|
||||
gitDo ->gitArgs (assertProcess "git" gitArgs [] true archiveDir)]
|
||||
@@ -101,6 +98,12 @@
|
||||
(gitDo ["commit" "--no-verify" "-m" "$(Date.now)"])
|
||||
(gitDo ["push"])))
|
||||
|
||||
(method _saveEntry [:Entry e]
|
||||
(File.saveContent
|
||||
(joinPath archiveDir "entries" (e.id.withExtension "json"))
|
||||
(tink.Json.stringify e))
|
||||
(gitSync))
|
||||
|
||||
(method fullString [:Entry e]
|
||||
(haxe.Json.stringify e null "\t"))
|
||||
|
||||
|
@@ -5,7 +5,7 @@
|
||||
(defNew [&prop :ArchiveController controller]
|
||||
[&mut :Bool setup false]
|
||||
(super
|
||||
"KeyShortcutSystem"aaa
|
||||
"KeyShortcutSystem"
|
||||
->[archive e]
|
||||
(hasComponent e KeyShortcut)
|
||||
->[archive e &opt ui]
|
||||
|
Reference in New Issue
Block a user