diff --git a/projects/kiss-vscode/config/example/package.json b/projects/kiss-vscode/config/example/package.json new file mode 100644 index 00000000..e46e96e8 --- /dev/null +++ b/projects/kiss-vscode/config/example/package.json @@ -0,0 +1,14 @@ +{ + "name": "example-kiss-vscode-config", + "version": "0.0.0", + "description": "", + "main": "index.js", + "scripts": { + "test": "echo \"Error: no test specified\" && exit 1" + }, + "author": "", + "license": "LGPL-2.1-or-later", + "dependencies": { + "phaser": "3.55.2" + } +} diff --git a/projects/kiss-vscode/src/Main.kiss b/projects/kiss-vscode/src/Main.kiss index 29bab76f..deca5045 100644 --- a/projects/kiss-vscode/src/Main.kiss +++ b/projects/kiss-vscode/src/Main.kiss @@ -45,8 +45,13 @@ ->folder (FileSystem.createDirectory (joinPath activeConfigDir folder))) - // When running from unit tests, install all dependencies in the example config: - (#when test (ChildProcess.spawnSync "haxelib" ["install" "all"] (object cwd activeConfigDir))) + // install all Haxe dependencies: + (assert (= 0 .status (ChildProcess.spawnSync "haxelib" ["install" "all"] (object cwd activeConfigDir)))) + // install all Node dependencies: + (when (FileSystem.exists (joinPath activeConfigDir "package.json")) + (assert (= 0 .status (if (= "Windows" (Sys.systemName)) + (ChildProcess.spawnSync "cmd.exe" ["/c" "npm" "install"] (object cwd activeConfigDir)) + (ChildProcess.spawnSync "npm" ["install"] (object cwd activeConfigDir)))))) // Run the haxe compiler: (let [buildResult (ChildProcess.spawnSync "haxe" ["build.hxml"] (object cwd activeConfigDir))]