arashi 1.26.2 → 1.28.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/bin/arashi +1 -5
- package/bin/prepare-spawn-command.js +18 -3
- package/package.json +2 -1
package/bin/arashi
CHANGED
|
@@ -53,13 +53,9 @@ fi
|
|
|
53
53
|
|
|
54
54
|
# Close stdin only when piping list output (fzf compatibility)
|
|
55
55
|
command=""
|
|
56
|
-
force_remove="false"
|
|
57
56
|
for arg in "$@"; do
|
|
58
57
|
case "$arg" in
|
|
59
58
|
-*)
|
|
60
|
-
case "$arg" in
|
|
61
|
-
-f|--force) force_remove="true" ;;
|
|
62
|
-
esac
|
|
63
59
|
continue
|
|
64
60
|
;;
|
|
65
61
|
*)
|
|
@@ -71,7 +67,7 @@ for arg in "$@"; do
|
|
|
71
67
|
done
|
|
72
68
|
|
|
73
69
|
if [ ! -t 1 ]; then
|
|
74
|
-
if [ "$command" = "list" ]
|
|
70
|
+
if [ "$command" = "list" ]; then
|
|
75
71
|
exec "$BINARY" "$@" 0<&-
|
|
76
72
|
fi
|
|
77
73
|
fi
|
|
@@ -1,5 +1,6 @@
|
|
|
1
1
|
const WINDOWS_BATCH_FILE = /\.(?:cmd|bat)$/i;
|
|
2
2
|
const CMD_ARGUMENT_VARIABLE_PREFIX = "ARASHI_CMD_ARGUMENT_";
|
|
3
|
+
const CMD_LITERAL_PERCENT_VARIABLE = "ARASHI_CMD_LITERAL_PERCENT";
|
|
3
4
|
|
|
4
5
|
// Quote according to CommandLineToArgvW's rules. The result is stored in an
|
|
5
6
|
// environment variable and introduced with ordinary expansion. Cmd expands each
|
|
@@ -13,6 +14,7 @@ export function prepareSpawnCommand(
|
|
|
13
14
|
platform = process.platform,
|
|
14
15
|
env = process.env,
|
|
15
16
|
forceWindowsShell = false,
|
|
17
|
+
callBatchFile = false,
|
|
16
18
|
) {
|
|
17
19
|
const executable = command[0];
|
|
18
20
|
if (
|
|
@@ -22,21 +24,34 @@ export function prepareSpawnCommand(
|
|
|
22
24
|
return { args: command.slice(1), command: executable, windowsVerbatimArguments: false };
|
|
23
25
|
}
|
|
24
26
|
|
|
25
|
-
const values = command.map((argument) =>
|
|
27
|
+
const values = command.map((argument) => {
|
|
28
|
+
const quoted = quoteWindowsArgument(argument);
|
|
29
|
+
return callBatchFile
|
|
30
|
+
? quoted.replaceAll("%", `%${CMD_LITERAL_PERCENT_VARIABLE}%`)
|
|
31
|
+
: quoted;
|
|
32
|
+
});
|
|
26
33
|
const variableNames = values.map((_value, index) => `${CMD_ARGUMENT_VARIABLE_PREFIX}${index}`);
|
|
27
34
|
|
|
28
35
|
const commandInterpreter =
|
|
29
36
|
Object.entries(env).find(([key]) => key.toLowerCase() === "comspec")?.[1] ?? "cmd.exe";
|
|
30
37
|
|
|
38
|
+
const invocation = variableNames.map((name) => `%${name}%`).join(" ");
|
|
39
|
+
const args = ["/d"];
|
|
40
|
+
if (callBatchFile) args.push("/e:on");
|
|
41
|
+
args.push("/v:off", "/s", "/c", `"${callBatchFile ? "call " : ""}${invocation}"`);
|
|
42
|
+
|
|
31
43
|
return {
|
|
32
|
-
args
|
|
44
|
+
args,
|
|
33
45
|
command: commandInterpreter,
|
|
34
46
|
env: {
|
|
35
47
|
...Object.fromEntries(
|
|
36
48
|
Object.entries(env).filter(
|
|
37
|
-
([name]) =>
|
|
49
|
+
([name]) =>
|
|
50
|
+
!name.toUpperCase().startsWith(CMD_ARGUMENT_VARIABLE_PREFIX) &&
|
|
51
|
+
name.toUpperCase() !== CMD_LITERAL_PERCENT_VARIABLE,
|
|
38
52
|
),
|
|
39
53
|
),
|
|
54
|
+
...(callBatchFile ? { [CMD_LITERAL_PERCENT_VARIABLE]: "%" } : {}),
|
|
40
55
|
...Object.fromEntries(variableNames.map((name, index) => [name, values[index]])),
|
|
41
56
|
},
|
|
42
57
|
windowsVerbatimArguments: true,
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "arashi",
|
|
3
|
-
"version": "1.
|
|
3
|
+
"version": "1.28.0",
|
|
4
4
|
"description": "Git worktree manager for meta-repositories - The eye of the storm for your development workflow",
|
|
5
5
|
"keywords": [
|
|
6
6
|
"cli",
|
|
@@ -88,6 +88,7 @@
|
|
|
88
88
|
"husky": "9.1.7",
|
|
89
89
|
"js-yaml": "4.3.0",
|
|
90
90
|
"lint-staged": "16.2.7",
|
|
91
|
+
"node-pty": "1.1.0",
|
|
91
92
|
"ora": "8.2.0",
|
|
92
93
|
"oxfmt": "0.28.0",
|
|
93
94
|
"oxlint": "1.43.0",
|