@staff0rd/assist 0.174.1 → 0.174.2
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 +7 -5
- 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.174.
|
|
9
|
+
version: "0.174.2",
|
|
10
10
|
type: "module",
|
|
11
11
|
main: "dist/index.js",
|
|
12
12
|
bin: {
|
|
@@ -4391,6 +4391,8 @@ var denyCache;
|
|
|
4391
4391
|
var TOOL_RE = /^(Bash|PowerShell)\((.+?)(:.*)?\)$/;
|
|
4392
4392
|
var SHELL_TOOLS = ["Bash", "PowerShell"];
|
|
4393
4393
|
var DOTSLASH_RE = /^\.[\\/]/;
|
|
4394
|
+
var FD_REDIRECT_RE = /\d+>&\d+/g;
|
|
4395
|
+
var FD_DEVNULL_RE = /\d*>\/dev\/null/g;
|
|
4394
4396
|
function loadPerms(key) {
|
|
4395
4397
|
return parsePerms(readSettingsPerms(key));
|
|
4396
4398
|
}
|
|
@@ -4401,7 +4403,7 @@ function shellEntries(map, toolName) {
|
|
|
4401
4403
|
return map.get(toolName) ?? [];
|
|
4402
4404
|
}
|
|
4403
4405
|
function normCmd(cmd) {
|
|
4404
|
-
return cmd.replace(DOTSLASH_RE, "");
|
|
4406
|
+
return cmd.replace(FD_DEVNULL_RE, "").replace(FD_REDIRECT_RE, "").trim().replace(DOTSLASH_RE, "");
|
|
4405
4407
|
}
|
|
4406
4408
|
function findMatch2(entries, command) {
|
|
4407
4409
|
const norm = normCmd(command);
|
|
@@ -4482,8 +4484,8 @@ function hasUnquotedBackticks(command) {
|
|
|
4482
4484
|
// src/shared/splitCompound.ts
|
|
4483
4485
|
var SEPARATOR_OPS = /* @__PURE__ */ new Set(["|", "&&", "||", ";"]);
|
|
4484
4486
|
var UNSAFE_OPS = /* @__PURE__ */ new Set(["(", ")", ">", ">>", "<", "<&", "|&", ">&"]);
|
|
4485
|
-
var
|
|
4486
|
-
var
|
|
4487
|
+
var FD_REDIRECT_RE2 = /\d+>&\d+/g;
|
|
4488
|
+
var FD_DEVNULL_RE2 = /\d*>\/dev\/null/g;
|
|
4487
4489
|
function splitCompound(command) {
|
|
4488
4490
|
const tokens = tokenizeCommand(command);
|
|
4489
4491
|
if (!tokens) return void 0;
|
|
@@ -4493,7 +4495,7 @@ function splitCompound(command) {
|
|
|
4493
4495
|
return result.length > 0 ? result : void 0;
|
|
4494
4496
|
}
|
|
4495
4497
|
function tokenizeCommand(command) {
|
|
4496
|
-
const trimmed = command.trim().replace(
|
|
4498
|
+
const trimmed = command.trim().replace(FD_DEVNULL_RE2, "").replace(FD_REDIRECT_RE2, "");
|
|
4497
4499
|
if (!trimmed) return void 0;
|
|
4498
4500
|
if (hasUnquotedBackticks(trimmed)) return void 0;
|
|
4499
4501
|
try {
|