@staff0rd/assist 0.67.0 → 0.68.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/index.js +13 -2
- package/package.json +1 -1
package/dist/index.js
CHANGED
|
@@ -6,7 +6,7 @@ import { Command } from "commander";
|
|
|
6
6
|
// package.json
|
|
7
7
|
var package_default = {
|
|
8
8
|
name: "@staff0rd/assist",
|
|
9
|
-
version: "0.
|
|
9
|
+
version: "0.68.0",
|
|
10
10
|
type: "module",
|
|
11
11
|
main: "dist/index.js",
|
|
12
12
|
bin: {
|
|
@@ -5419,6 +5419,13 @@ function spawnCommand2(fullCommand) {
|
|
|
5419
5419
|
child.on("close", (code) => process.exit(code ?? 0));
|
|
5420
5420
|
child.on("error", onSpawnError);
|
|
5421
5421
|
}
|
|
5422
|
+
function listRunConfigs() {
|
|
5423
|
+
const configs = requireRunConfigs();
|
|
5424
|
+
for (const config of configs) {
|
|
5425
|
+
const args = config.args?.length ? ` ${config.args.join(" ")}` : "";
|
|
5426
|
+
console.log(`${config.name}: ${config.command}${args}`);
|
|
5427
|
+
}
|
|
5428
|
+
}
|
|
5422
5429
|
function run2(name, args) {
|
|
5423
5430
|
const runConfig = findRunConfig(name);
|
|
5424
5431
|
spawnCommand2(buildCommand(runConfig.command, runConfig.args ?? [], args));
|
|
@@ -5593,7 +5600,11 @@ var configCommand = program.command("config").description("View and modify assis
|
|
|
5593
5600
|
configCommand.command("set <key> <value>").description("Set a config value (e.g. commit.push true)").action(configSet);
|
|
5594
5601
|
configCommand.command("get <key>").description("Get a config value").action(configGet);
|
|
5595
5602
|
configCommand.command("list").description("List all config values").action(configList);
|
|
5596
|
-
var runCommand = program.command("run").description("Run a configured command from assist.yml").argument("
|
|
5603
|
+
var runCommand = program.command("run").description("Run a configured command from assist.yml").argument("[name]", "Name of the configured command").argument("[args...]", "Arguments to pass to the command").allowUnknownOption().action((name, args) => {
|
|
5604
|
+
if (!name) {
|
|
5605
|
+
listRunConfigs();
|
|
5606
|
+
return;
|
|
5607
|
+
}
|
|
5597
5608
|
run2(name, args);
|
|
5598
5609
|
});
|
|
5599
5610
|
runCommand.command("add").description("Add a new run configuration to assist.yml").allowUnknownOption().allowExcessArguments().action(() => add2());
|