command to update Kiss-VSCode
This commit is contained in:
@@ -239,6 +239,7 @@
|
||||
(registerCommand description (lambda :Void [&opt _] (executeCommand command))))
|
||||
|
||||
(loadFrom "kiss-vscode" "src/commands/KissTools.kiss")
|
||||
(loadFrom "kiss-vscode" "src/commands/ExtensionTools.kiss")
|
||||
|
||||
(function :Void registerBuiltins []
|
||||
(set Prelude.printStr ->:Void s (infoMessage s))
|
||||
@@ -248,7 +249,10 @@
|
||||
(registerCommand "[K]iss: Run a keyboard [s]hortcut command" runKeyboardShortcut)
|
||||
// KissTools.kiss:
|
||||
(registerCommand "[K]iss: [e]valuate and print an expression" evalAndPrint)
|
||||
(registerCommand "[K]iss: create [n]ew kiss class" newKissClass))
|
||||
(registerCommand "[K]iss: create [n]ew kiss class" newKissClass)
|
||||
// ExtensionTools.kiss:
|
||||
(registerCommand "[K]iss: [u]pdate Kiss-VSCode" updateKissVscode)
|
||||
(registerCommand "[K]iss: [t]est and [u]pdate Kiss-VSCode" updateKissVscode))
|
||||
|
||||
// TODO standardize this with KissInterp
|
||||
(function :Void prepareInterp []
|
||||
|
25
projects/kiss-vscode/src/commands/ExtensionTools.kiss
Normal file
25
projects/kiss-vscode/src/commands/ExtensionTools.kiss
Normal file
@@ -0,0 +1,25 @@
|
||||
(loadFrom "kiss-vscode" "src/Util.kiss")
|
||||
|
||||
(function kvLibpath [] (.trim (assertProcess "haxelib" ["libpath" "kiss-vscode"])))
|
||||
(function :ChildProcessSpawnSyncOptions options [] (object cwd (let [path (kvLibpath)] (path.substr 0 (- path.length 1)))))
|
||||
|
||||
(function handleUpdateFailure [error]
|
||||
(errorMessage "Error updating Kiss-VSCode: $error")
|
||||
(throw error))
|
||||
|
||||
(function :Void updateKissVscode [&opt _]
|
||||
(trySpawnSync "haxe" ["build.hxml"] (options) handleUpdateFailure)
|
||||
(if (= "Windows" (Sys.systemName))
|
||||
(trySpawnSync "cmd.exe" ["/c" "vsce" "package"] (options) handleUpdateFailure)
|
||||
(trySpawnSync "vsce" ["package"] (options) handleUpdateFailure))
|
||||
(awaitLet [_ (executeCommand
|
||||
"workbench.extensions.command.installFromVSIX"
|
||||
(Uri.file (joinPath (kvLibpath) (last (filter (FileSystem.readDirectory (kvLibpath)) ->file (file.endsWith ".vsix"))))))]
|
||||
(catch [error]
|
||||
(handleUpdateFailure error)))
|
||||
|
||||
{})
|
||||
|
||||
(function testAndUpdateKissVscode [&opt _]
|
||||
(trySpawnSync "test.sh" [] (options) handleUpdateFailure)
|
||||
(updateKissVscode))
|
Reference in New Issue
Block a user