Skip to content

Commit

Permalink
Use -- to pass custom command to run.js
Browse files Browse the repository at this point in the history
  • Loading branch information
sonnyp committed Oct 18, 2024
1 parent 2057f39 commit 1b75996
Show file tree
Hide file tree
Showing 3 changed files with 11 additions and 9 deletions.
12 changes: 6 additions & 6 deletions .vscode/settings.json
Original file line number Diff line number Diff line change
Expand Up @@ -14,6 +14,12 @@
"_build/**": true
},
"editor.defaultFormatter": "esbenp.prettier-vscode",
"[yaml]": {
"editor.defaultFormatter": "esbenp.prettier-vscode"
},
"[json]": {
"editor.defaultFormatter": "esbenp.prettier-vscode"
},
"rust-analyzer.server.path": "${workspaceFolder}/.flatpak/rust-analyzer.sh",
"rust-analyzer.runnables.command": "${workspaceFolder}/.flatpak/cargo.sh",
"rust-analyzer.files.excludeDirs": [
Expand All @@ -23,11 +29,5 @@
"build",
"builddir"
],
"[yaml]": {
"editor.defaultFormatter": "esbenp.prettier-vscode"
},
"[json]": {
"editor.defaultFormatter": "esbenp.prettier-vscode"
},
"vala.languageServerPath": "${workspaceFolder}/.flatpak/vala-language-server.sh"
}
2 changes: 2 additions & 0 deletions Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -48,6 +48,7 @@ lint:

unit:
./build-aux/fun gjs -m ./troll/tst/bin.js test/*.test.js
#./build-aux/wip/run.js build-aux/re.sonny.Workbench.Devel.json -- gjs -m ./troll/tst/bin.js test/*.test.js

# https://github.com/ximion/appstream/issues/398#issuecomment-1129454985
# flatpak run org.freedesktop.appstream.cli validate --override=release-time-missing=info --no-net data/app.metainfo.xml
Expand All @@ -61,6 +62,7 @@ unit:

test: unit lint
./build-aux/fun workbench-cli ci demos/src/Welcome
# ./build-aux/wip/run.js build-aux/re.sonny.Workbench.Devel.json -- workbench-cli ci demos/src/Welcome/

ci: setup build test
./build-aux/fun workbench-cli ci demos/src/*
Expand Down
6 changes: 3 additions & 3 deletions build-aux/wip/run.js
Original file line number Diff line number Diff line change
Expand Up @@ -21,10 +21,10 @@ Gio._promisify(

const path = GLib.get_current_dir();
console.debug(programInvocationName, programArgs);
const argv = minimist(programArgs, { boolean: true });
const argv = minimist(programArgs, { boolean: true, "--": true });
console.debug(argv);

const [manifest_path, ...arg] = argv._;
const [manifest_path] = argv._;
if (!manifest_path) {
// eslint-disable-next-line no-restricted-globals
print(`${programInvocationName} [--verbose] [--debug] MANIFEST`);
Expand Down Expand Up @@ -123,7 +123,7 @@ await buildCommand(["meson", "install", "-C", "_build"]);
// ]);

// starts workbench
const command = arg.length ? arg : [manifest.command];
const command = argv["--"].length ? argv["--"] : [manifest.command];
await runCommand(command);

function buildCommand(argv) {
Expand Down

0 comments on commit 1b75996

Please sign in to comment.