@staff0rd/assist 0.93.0 → 0.93.1
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 +16 -23
- 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.93.
|
|
9
|
+
version: "0.93.1",
|
|
10
10
|
type: "module",
|
|
11
11
|
main: "dist/index.js",
|
|
12
12
|
bin: {
|
|
@@ -217,6 +217,14 @@ function getTranscriptConfig() {
|
|
|
217
217
|
return config.transcript;
|
|
218
218
|
}
|
|
219
219
|
|
|
220
|
+
// src/shared/shellQuote.ts
|
|
221
|
+
function shellQuote(arg) {
|
|
222
|
+
if (/[^a-zA-Z0-9_./:=@%^+,-]/.test(arg)) {
|
|
223
|
+
return `'${arg.replace(/'/g, "'\\''")}'`;
|
|
224
|
+
}
|
|
225
|
+
return arg;
|
|
226
|
+
}
|
|
227
|
+
|
|
220
228
|
// src/commands/commit/validateMessage.ts
|
|
221
229
|
var MAX_MESSAGE_LENGTH = 50;
|
|
222
230
|
var CONVENTIONAL_COMMIT_REGEX = /^(feat|fix|docs|style|refactor|perf|test|build|ci|chore|revert)(!)?(\(.+\))?!?: .+$/;
|
|
@@ -240,17 +248,14 @@ function validateMessage(message, config) {
|
|
|
240
248
|
}
|
|
241
249
|
|
|
242
250
|
// src/commands/commit.ts
|
|
243
|
-
function escapeShell(s) {
|
|
244
|
-
return `"${s.replace(/"/g, '\\"')}"`;
|
|
245
|
-
}
|
|
246
251
|
function commitStaged(message) {
|
|
247
|
-
execSync(`git commit -m ${
|
|
252
|
+
execSync(`git commit -m ${shellQuote(message)}`, { stdio: "inherit" });
|
|
248
253
|
return execSync("git rev-parse --short=7 HEAD", {
|
|
249
254
|
encoding: "utf-8"
|
|
250
255
|
}).trim();
|
|
251
256
|
}
|
|
252
257
|
function stageAndCommit(files, message) {
|
|
253
|
-
const escaped = files.map(
|
|
258
|
+
const escaped = files.map(shellQuote).join(" ");
|
|
254
259
|
execSync(`git add ${escaped}`, { stdio: "inherit" });
|
|
255
260
|
return commitStaged(message);
|
|
256
261
|
}
|
|
@@ -1428,14 +1433,8 @@ Total: ${lines.length} hardcoded color(s)`);
|
|
|
1428
1433
|
|
|
1429
1434
|
// src/commands/verify/run/resolveEntries.ts
|
|
1430
1435
|
import * as path13 from "path";
|
|
1431
|
-
function quoteIfNeeded(arg) {
|
|
1432
|
-
if (/[^a-zA-Z0-9_./:=@%^+,-]/.test(arg)) {
|
|
1433
|
-
return `'${arg.replace(/'/g, "'\\''")}'`;
|
|
1434
|
-
}
|
|
1435
|
-
return arg;
|
|
1436
|
-
}
|
|
1437
1436
|
function buildFullCommand(command, args) {
|
|
1438
|
-
return [
|
|
1437
|
+
return [shellQuote(command), ...(args ?? []).map(shellQuote)].join(" ");
|
|
1439
1438
|
}
|
|
1440
1439
|
function getRunEntries() {
|
|
1441
1440
|
const { run: run3 } = loadConfig();
|
|
@@ -5950,15 +5949,9 @@ function add2() {
|
|
|
5950
5949
|
}
|
|
5951
5950
|
|
|
5952
5951
|
// src/commands/run/index.ts
|
|
5953
|
-
function quoteIfNeeded2(arg) {
|
|
5954
|
-
if (/[^a-zA-Z0-9_./:=@%^+,-]/.test(arg)) {
|
|
5955
|
-
return `'${arg.replace(/'/g, "'\\''")}'`;
|
|
5956
|
-
}
|
|
5957
|
-
return arg;
|
|
5958
|
-
}
|
|
5959
5952
|
function buildCommand(command, configArgs, extraArgs) {
|
|
5960
5953
|
const allArgs = [...configArgs, ...extraArgs];
|
|
5961
|
-
return [
|
|
5954
|
+
return [shellQuote(command), ...allArgs.map(shellQuote)].join(" ");
|
|
5962
5955
|
}
|
|
5963
5956
|
function printAvailableConfigs(configs) {
|
|
5964
5957
|
console.error("Available configurations:");
|
|
@@ -6142,11 +6135,11 @@ function getInstallDir() {
|
|
|
6142
6135
|
}
|
|
6143
6136
|
function isGitRepo(dir) {
|
|
6144
6137
|
try {
|
|
6145
|
-
execSync27("git rev-parse --
|
|
6138
|
+
const result = execSync27("git rev-parse --show-toplevel", {
|
|
6146
6139
|
cwd: dir,
|
|
6147
6140
|
stdio: "pipe"
|
|
6148
|
-
});
|
|
6149
|
-
return
|
|
6141
|
+
}).toString().trim();
|
|
6142
|
+
return path30.resolve(result) === path30.resolve(dir);
|
|
6150
6143
|
} catch {
|
|
6151
6144
|
return false;
|
|
6152
6145
|
}
|