@staff0rd/assist 0.456.0 → 0.456.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/README.md +1 -1
- package/dist/commands/sessions/web/bundle.js +1 -1
- package/dist/index.js +201 -181
- 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.456.
|
|
9
|
+
version: "0.456.1",
|
|
10
10
|
type: "module",
|
|
11
11
|
main: "dist/index.js",
|
|
12
12
|
bin: {
|
|
@@ -121,7 +121,7 @@ var package_default = {
|
|
|
121
121
|
};
|
|
122
122
|
|
|
123
123
|
// src/commands/commit.ts
|
|
124
|
-
import { execSync as
|
|
124
|
+
import { execSync as execSync8 } from "child_process";
|
|
125
125
|
|
|
126
126
|
// src/shared/resolveSessionItemId.ts
|
|
127
127
|
var ITEM_ID_ENV = "ASSIST_BACKLOG_ITEM_ID";
|
|
@@ -1547,8 +1547,25 @@ function ignore() {
|
|
|
1547
1547
|
}
|
|
1548
1548
|
|
|
1549
1549
|
// src/shared/warnIfUnexpectedBranch.ts
|
|
1550
|
-
import { execSync } from "child_process";
|
|
1550
|
+
import { execSync as execSync2 } from "child_process";
|
|
1551
1551
|
import chalk3 from "chalk";
|
|
1552
|
+
|
|
1553
|
+
// src/shared/upstreamBranch.ts
|
|
1554
|
+
import { execSync } from "child_process";
|
|
1555
|
+
function upstreamBranch() {
|
|
1556
|
+
try {
|
|
1557
|
+
const upstream = execSync(
|
|
1558
|
+
"git rev-parse --abbrev-ref --symbolic-full-name @{upstream}",
|
|
1559
|
+
{ encoding: "utf8", stdio: ["pipe", "pipe", "pipe"] }
|
|
1560
|
+
).trim();
|
|
1561
|
+
const slash = upstream.indexOf("/");
|
|
1562
|
+
return slash === -1 ? upstream || null : upstream.slice(slash + 1) || null;
|
|
1563
|
+
} catch {
|
|
1564
|
+
return null;
|
|
1565
|
+
}
|
|
1566
|
+
}
|
|
1567
|
+
|
|
1568
|
+
// src/shared/warnIfUnexpectedBranch.ts
|
|
1552
1569
|
function warnIfUnexpectedBranch(config) {
|
|
1553
1570
|
const expected = config.commit?.expectedBranch;
|
|
1554
1571
|
if (!expected) return;
|
|
@@ -1571,28 +1588,16 @@ function warnIfUnexpectedBranch(config) {
|
|
|
1571
1588
|
}
|
|
1572
1589
|
function currentBranch() {
|
|
1573
1590
|
try {
|
|
1574
|
-
return
|
|
1591
|
+
return execSync2("git rev-parse --abbrev-ref HEAD", {
|
|
1575
1592
|
encoding: "utf8"
|
|
1576
1593
|
}).trim();
|
|
1577
1594
|
} catch {
|
|
1578
1595
|
return null;
|
|
1579
1596
|
}
|
|
1580
1597
|
}
|
|
1581
|
-
function upstreamBranch() {
|
|
1582
|
-
try {
|
|
1583
|
-
const upstream = execSync(
|
|
1584
|
-
"git rev-parse --abbrev-ref --symbolic-full-name @{upstream}",
|
|
1585
|
-
{ encoding: "utf8", stdio: ["pipe", "pipe", "pipe"] }
|
|
1586
|
-
).trim();
|
|
1587
|
-
const slash = upstream.indexOf("/");
|
|
1588
|
-
return slash === -1 ? upstream || null : upstream.slice(slash + 1) || null;
|
|
1589
|
-
} catch {
|
|
1590
|
-
return null;
|
|
1591
|
-
}
|
|
1592
|
-
}
|
|
1593
1598
|
|
|
1594
1599
|
// src/commands/commit/findConflictMarkers.ts
|
|
1595
|
-
import { execSync as
|
|
1600
|
+
import { execSync as execSync3 } from "child_process";
|
|
1596
1601
|
|
|
1597
1602
|
// src/shared/shellQuote.ts
|
|
1598
1603
|
function shellQuote(arg) {
|
|
@@ -1608,7 +1613,7 @@ function shellQuote(arg) {
|
|
|
1608
1613
|
// src/commands/commit/findConflictMarkers.ts
|
|
1609
1614
|
function gitCheckOutput(cmd) {
|
|
1610
1615
|
try {
|
|
1611
|
-
return
|
|
1616
|
+
return execSync3(cmd, { encoding: "utf8", stdio: ["pipe", "pipe", "pipe"] });
|
|
1612
1617
|
} catch (error) {
|
|
1613
1618
|
const stdout = error.stdout;
|
|
1614
1619
|
if (typeof stdout === "string") return stdout;
|
|
@@ -1637,7 +1642,7 @@ function findConflictMarkers(files) {
|
|
|
1637
1642
|
function findUnmergedPaths() {
|
|
1638
1643
|
let output;
|
|
1639
1644
|
try {
|
|
1640
|
-
output =
|
|
1645
|
+
output = execSync3("git ls-files -u", {
|
|
1641
1646
|
encoding: "utf8",
|
|
1642
1647
|
stdio: ["pipe", "pipe", "pipe"]
|
|
1643
1648
|
});
|
|
@@ -1679,10 +1684,10 @@ function abortOnConflicts(files, pulled) {
|
|
|
1679
1684
|
}
|
|
1680
1685
|
|
|
1681
1686
|
// src/commands/commit/collectCommitRefs.ts
|
|
1682
|
-
import { execSync as
|
|
1687
|
+
import { execSync as execSync5 } from "child_process";
|
|
1683
1688
|
|
|
1684
1689
|
// src/commands/prs/getPreferredRemoteRepo.ts
|
|
1685
|
-
import { execSync as
|
|
1690
|
+
import { execSync as execSync4 } from "child_process";
|
|
1686
1691
|
var GITHUB_URL_PATTERN = /(?:git@github\.com:|https:\/\/github\.com\/)([^/]+)\/([^/]+?)(?:\.git)?\/?$/;
|
|
1687
1692
|
function parseGitHubUrl(url) {
|
|
1688
1693
|
const match = url.match(GITHUB_URL_PATTERN);
|
|
@@ -1691,7 +1696,7 @@ function parseGitHubUrl(url) {
|
|
|
1691
1696
|
}
|
|
1692
1697
|
function tryGetRemoteUrl(remote, cwd) {
|
|
1693
1698
|
try {
|
|
1694
|
-
return
|
|
1699
|
+
return execSync4(`git remote get-url ${remote}`, {
|
|
1695
1700
|
encoding: "utf8",
|
|
1696
1701
|
stdio: ["pipe", "pipe", "pipe"],
|
|
1697
1702
|
cwd
|
|
@@ -1702,7 +1707,7 @@ function tryGetRemoteUrl(remote, cwd) {
|
|
|
1702
1707
|
}
|
|
1703
1708
|
function getCurrentBranchRemote(cwd) {
|
|
1704
1709
|
try {
|
|
1705
|
-
const ref =
|
|
1710
|
+
const ref = execSync4(
|
|
1706
1711
|
"git rev-parse --abbrev-ref --symbolic-full-name @{u}",
|
|
1707
1712
|
{ encoding: "utf8", stdio: ["pipe", "pipe", "pipe"], cwd }
|
|
1708
1713
|
).trim();
|
|
@@ -1714,7 +1719,7 @@ function getCurrentBranchRemote(cwd) {
|
|
|
1714
1719
|
}
|
|
1715
1720
|
function listRemotes(cwd) {
|
|
1716
1721
|
try {
|
|
1717
|
-
return
|
|
1722
|
+
return execSync4("git remote", {
|
|
1718
1723
|
encoding: "utf8",
|
|
1719
1724
|
stdio: ["pipe", "pipe", "pipe"],
|
|
1720
1725
|
cwd
|
|
@@ -1778,7 +1783,7 @@ function collectCommitRefs(message2) {
|
|
|
1778
1783
|
}
|
|
1779
1784
|
function git(args) {
|
|
1780
1785
|
try {
|
|
1781
|
-
return
|
|
1786
|
+
return execSync5(`git ${args}`, {
|
|
1782
1787
|
encoding: "utf8",
|
|
1783
1788
|
stdio: ["pipe", "pipe", "pipe"]
|
|
1784
1789
|
}).trim();
|
|
@@ -1788,14 +1793,14 @@ function git(args) {
|
|
|
1788
1793
|
}
|
|
1789
1794
|
|
|
1790
1795
|
// src/commands/commit/pushCommit.ts
|
|
1791
|
-
import { execSync as
|
|
1796
|
+
import { execSync as execSync6 } from "child_process";
|
|
1792
1797
|
var HEADS_PREFIX = "refs/heads/";
|
|
1793
|
-
function pushCommit() {
|
|
1794
|
-
const target =
|
|
1795
|
-
const command = target ? `git push ${shellQuote(target.remote)} HEAD:${shellQuote(target.branch)}` : "git push";
|
|
1796
|
-
|
|
1798
|
+
function pushCommit(trunkMode) {
|
|
1799
|
+
const target = pushTargetForRenamedUpstream(trunkMode);
|
|
1800
|
+
const command = target ? `git push ${target.setUpstream ? "--set-upstream " : ""}${shellQuote(target.remote)} HEAD:${shellQuote(target.branch)}` : "git push";
|
|
1801
|
+
execSync6(command, { stdio: "inherit" });
|
|
1797
1802
|
}
|
|
1798
|
-
function
|
|
1803
|
+
function pushTargetForRenamedUpstream(trunkMode) {
|
|
1799
1804
|
const branch2 = gitOrNull("git symbolic-ref --short HEAD");
|
|
1800
1805
|
if (!branch2) return null;
|
|
1801
1806
|
const remote = gitOrNull(
|
|
@@ -1806,11 +1811,18 @@ function renamedUpstream() {
|
|
|
1806
1811
|
);
|
|
1807
1812
|
if (!remote || !merge) return null;
|
|
1808
1813
|
const upstream = merge.startsWith(HEADS_PREFIX) ? merge.slice(HEADS_PREFIX.length) : merge;
|
|
1809
|
-
|
|
1814
|
+
if (upstream === branch2) return null;
|
|
1815
|
+
return trunkMode ? landOnTrackedMainline(remote, upstream) : raiseOwnRemoteBranch(remote, branch2);
|
|
1816
|
+
}
|
|
1817
|
+
function landOnTrackedMainline(remote, upstream) {
|
|
1818
|
+
return { remote, branch: upstream, setUpstream: false };
|
|
1819
|
+
}
|
|
1820
|
+
function raiseOwnRemoteBranch(remote, branch2) {
|
|
1821
|
+
return { remote, branch: branch2, setUpstream: true };
|
|
1810
1822
|
}
|
|
1811
1823
|
function gitOrNull(command) {
|
|
1812
1824
|
try {
|
|
1813
|
-
return
|
|
1825
|
+
return execSync6(command, {
|
|
1814
1826
|
encoding: "utf8",
|
|
1815
1827
|
stdio: ["pipe", "pipe", "pipe"]
|
|
1816
1828
|
}).trim() || null;
|
|
@@ -1819,17 +1831,25 @@ function gitOrNull(command) {
|
|
|
1819
1831
|
}
|
|
1820
1832
|
}
|
|
1821
1833
|
|
|
1834
|
+
// src/commands/commit/shouldPull.ts
|
|
1835
|
+
function shouldPull(config) {
|
|
1836
|
+
if (!config.commit?.pull) return false;
|
|
1837
|
+
if (upstreamBranch() !== null) return true;
|
|
1838
|
+
console.log("Skipping pull: this branch has no upstream to pull from");
|
|
1839
|
+
return false;
|
|
1840
|
+
}
|
|
1841
|
+
|
|
1822
1842
|
// src/commands/commit/stageAndCommit.ts
|
|
1823
|
-
import { execSync as
|
|
1843
|
+
import { execSync as execSync7 } from "child_process";
|
|
1824
1844
|
function commitStaged(message2) {
|
|
1825
|
-
|
|
1826
|
-
return
|
|
1845
|
+
execSync7(`git commit -m ${shellQuote(message2)}`, { stdio: "inherit" });
|
|
1846
|
+
return execSync7("git rev-parse --short=7 HEAD", {
|
|
1827
1847
|
encoding: "utf8"
|
|
1828
1848
|
}).trim();
|
|
1829
1849
|
}
|
|
1830
1850
|
function stageAndCommit(files, message2) {
|
|
1831
1851
|
const escaped = files.map(shellQuote).join(" ");
|
|
1832
|
-
|
|
1852
|
+
execSync7(`git add ${escaped}`, { stdio: "inherit" });
|
|
1833
1853
|
return commitStaged(message2);
|
|
1834
1854
|
}
|
|
1835
1855
|
|
|
@@ -1955,15 +1975,15 @@ function validateMessage(message2, config) {
|
|
|
1955
1975
|
async function execCommit(files, message2, config) {
|
|
1956
1976
|
try {
|
|
1957
1977
|
warnIfUnexpectedBranch(config);
|
|
1958
|
-
const pulled =
|
|
1978
|
+
const pulled = shouldPull(config);
|
|
1959
1979
|
if (pulled) {
|
|
1960
|
-
|
|
1980
|
+
execSync8("git pull --autostash", { stdio: "inherit" });
|
|
1961
1981
|
}
|
|
1962
1982
|
abortOnConflicts(files, pulled);
|
|
1963
1983
|
const sha = files.length > 0 ? stageAndCommit(files, message2) : commitStaged(message2);
|
|
1964
1984
|
console.log(`Committed: ${sha}`);
|
|
1965
1985
|
if (config.commit?.push) {
|
|
1966
|
-
pushCommit();
|
|
1986
|
+
pushCommit(config.worktree?.trunk === true);
|
|
1967
1987
|
console.log("Pushed to remote");
|
|
1968
1988
|
}
|
|
1969
1989
|
await recordCommitActivity(message2);
|
|
@@ -1978,7 +1998,7 @@ async function recordCommitActivity(message2) {
|
|
|
1978
1998
|
}
|
|
1979
1999
|
async function commit(args) {
|
|
1980
2000
|
if (args[0] === "status") {
|
|
1981
|
-
|
|
2001
|
+
execSync8("git status && echo '---DIFF---' && git diff", {
|
|
1982
2002
|
stdio: "inherit"
|
|
1983
2003
|
});
|
|
1984
2004
|
return;
|
|
@@ -1995,9 +2015,9 @@ async function commit(args) {
|
|
|
1995
2015
|
}
|
|
1996
2016
|
|
|
1997
2017
|
// src/commands/coverage.ts
|
|
1998
|
-
import { execSync as
|
|
2018
|
+
import { execSync as execSync9 } from "child_process";
|
|
1999
2019
|
function coverage() {
|
|
2000
|
-
const output =
|
|
2020
|
+
const output = execSync9(
|
|
2001
2021
|
"npx vitest run --coverage --coverage.include='src/**/*.ts' --coverage.all --coverage.reporter=text 2>&1",
|
|
2002
2022
|
{ encoding: "utf8", timeout: 12e4 }
|
|
2003
2023
|
);
|
|
@@ -2097,7 +2117,7 @@ function findPackageJsonWithVerifyScripts(startDir) {
|
|
|
2097
2117
|
}
|
|
2098
2118
|
|
|
2099
2119
|
// src/commands/verify/installPackage.ts
|
|
2100
|
-
import { execSync as
|
|
2120
|
+
import { execSync as execSync10 } from "child_process";
|
|
2101
2121
|
import { writeFileSync as writeFileSync2 } from "fs";
|
|
2102
2122
|
import chalk6 from "chalk";
|
|
2103
2123
|
function writePackageJson(filePath, pkg) {
|
|
@@ -2116,7 +2136,7 @@ function addScript(pkg, name, command) {
|
|
|
2116
2136
|
function installPackage(name, cwd) {
|
|
2117
2137
|
console.log(chalk6.dim(`Installing ${name}...`));
|
|
2118
2138
|
try {
|
|
2119
|
-
|
|
2139
|
+
execSync10(`npm install -D ${name}`, { stdio: "inherit", cwd });
|
|
2120
2140
|
return true;
|
|
2121
2141
|
} catch {
|
|
2122
2142
|
console.error(chalk6.red(`Failed to install ${name}`));
|
|
@@ -2360,7 +2380,7 @@ import { existsSync as existsSync8, readFileSync as readFileSync6, writeFileSync
|
|
|
2360
2380
|
import chalk14 from "chalk";
|
|
2361
2381
|
|
|
2362
2382
|
// src/shared/removeEslint/index.ts
|
|
2363
|
-
import { execSync as
|
|
2383
|
+
import { execSync as execSync11 } from "child_process";
|
|
2364
2384
|
import { existsSync as existsSync7, readFileSync as readFileSync5, writeFileSync as writeFileSync5 } from "fs";
|
|
2365
2385
|
|
|
2366
2386
|
// src/shared/removeEslint/removeEslintConfigFiles.ts
|
|
@@ -2395,7 +2415,7 @@ function removeEslint(options2 = {}) {
|
|
|
2395
2415
|
const removedConfigFiles = removeEslintConfigFiles();
|
|
2396
2416
|
if (removedFromPackageJson || removedConfigFiles) {
|
|
2397
2417
|
console.log("Running npm install...");
|
|
2398
|
-
|
|
2418
|
+
execSync11("npm install", { stdio: "inherit" });
|
|
2399
2419
|
return true;
|
|
2400
2420
|
}
|
|
2401
2421
|
return false;
|
|
@@ -3243,11 +3263,11 @@ function lint(options2 = {}) {
|
|
|
3243
3263
|
}
|
|
3244
3264
|
|
|
3245
3265
|
// src/commands/new/registerNew/newCli/index.ts
|
|
3246
|
-
import { execSync as
|
|
3266
|
+
import { execSync as execSync20 } from "child_process";
|
|
3247
3267
|
import { basename as basename2, resolve as resolve5 } from "path";
|
|
3248
3268
|
|
|
3249
3269
|
// src/commands/verify/blockCodeComments/findComments.ts
|
|
3250
|
-
import { execSync as
|
|
3270
|
+
import { execSync as execSync12 } from "child_process";
|
|
3251
3271
|
import fs15 from "fs";
|
|
3252
3272
|
import { minimatch } from "minimatch";
|
|
3253
3273
|
import { Project as Project2 } from "ts-morph";
|
|
@@ -3507,7 +3527,7 @@ function shouldScan(file, ignoreGlobs) {
|
|
|
3507
3527
|
return fs15.existsSync(file);
|
|
3508
3528
|
}
|
|
3509
3529
|
function findComments(options2) {
|
|
3510
|
-
const diff3 =
|
|
3530
|
+
const diff3 = execSync12("git diff HEAD", {
|
|
3511
3531
|
encoding: "utf8",
|
|
3512
3532
|
maxBuffer: 64 * 1024 * 1024
|
|
3513
3533
|
});
|
|
@@ -3787,13 +3807,13 @@ Total: ${violations.length} forbidden string(s).`);
|
|
|
3787
3807
|
}
|
|
3788
3808
|
|
|
3789
3809
|
// src/commands/verify/hardcodedColors.ts
|
|
3790
|
-
import { execSync as
|
|
3810
|
+
import { execSync as execSync13 } from "child_process";
|
|
3791
3811
|
import { minimatch as minimatch3 } from "minimatch";
|
|
3792
3812
|
var pattern = "0x[0-9a-fA-F]{6}|#[0-9a-fA-F]{3,6}";
|
|
3793
3813
|
function hardcodedColors() {
|
|
3794
3814
|
const ignoreGlobs = loadConfig().hardcodedColors?.ignore ?? [];
|
|
3795
3815
|
try {
|
|
3796
|
-
const output =
|
|
3816
|
+
const output = execSync13(`grep -rEnH '${pattern}' src/`, {
|
|
3797
3817
|
encoding: "utf8"
|
|
3798
3818
|
});
|
|
3799
3819
|
const lines = output.trim().split("\n").filter((line) => {
|
|
@@ -4054,14 +4074,14 @@ function listMigrationFiles(dir) {
|
|
|
4054
4074
|
}
|
|
4055
4075
|
|
|
4056
4076
|
// src/commands/verify/migrations/readBaselineMigrations.ts
|
|
4057
|
-
import { execSync as
|
|
4077
|
+
import { execSync as execSync14 } from "child_process";
|
|
4058
4078
|
import { basename } from "path";
|
|
4059
4079
|
var MIGRATION_FILE3 = /^migration\d+[A-Za-z0-9]*\.ts$/;
|
|
4060
4080
|
function readBaselineMigrations(repoRelativeDir, ref) {
|
|
4061
4081
|
const baseline = /* @__PURE__ */ new Map();
|
|
4062
4082
|
let listing;
|
|
4063
4083
|
try {
|
|
4064
|
-
listing =
|
|
4084
|
+
listing = execSync14(
|
|
4065
4085
|
`git ls-tree -r --name-only "${ref}" -- "${repoRelativeDir}"`,
|
|
4066
4086
|
{ encoding: "utf8", stdio: ["pipe", "pipe", "pipe"] }
|
|
4067
4087
|
);
|
|
@@ -4071,7 +4091,7 @@ function readBaselineMigrations(repoRelativeDir, ref) {
|
|
|
4071
4091
|
const paths = listing.split("\n").map((line) => line.trim()).filter(Boolean).filter((path71) => MIGRATION_FILE3.test(basename(path71)));
|
|
4072
4092
|
for (const path71 of paths) {
|
|
4073
4093
|
try {
|
|
4074
|
-
const content =
|
|
4094
|
+
const content = execSync14(`git show "${ref}:${path71}"`, {
|
|
4075
4095
|
encoding: "utf8",
|
|
4076
4096
|
maxBuffer: 16 * 1024 * 1024,
|
|
4077
4097
|
stdio: ["pipe", "pipe", "pipe"]
|
|
@@ -4084,10 +4104,10 @@ function readBaselineMigrations(repoRelativeDir, ref) {
|
|
|
4084
4104
|
}
|
|
4085
4105
|
|
|
4086
4106
|
// src/commands/verify/migrations/resolveBaselineRef.ts
|
|
4087
|
-
import { execSync as
|
|
4107
|
+
import { execSync as execSync15 } from "child_process";
|
|
4088
4108
|
function refExists(ref) {
|
|
4089
4109
|
try {
|
|
4090
|
-
|
|
4110
|
+
execSync15(`git rev-parse --verify --quiet "${ref}"`, {
|
|
4091
4111
|
stdio: ["pipe", "pipe", "pipe"]
|
|
4092
4112
|
});
|
|
4093
4113
|
return true;
|
|
@@ -4159,10 +4179,10 @@ Total: ${problems.length} violation(s).`);
|
|
|
4159
4179
|
}
|
|
4160
4180
|
|
|
4161
4181
|
// src/commands/verify/noVenv.ts
|
|
4162
|
-
import { execSync as
|
|
4182
|
+
import { execSync as execSync16 } from "child_process";
|
|
4163
4183
|
function noVenv() {
|
|
4164
4184
|
try {
|
|
4165
|
-
const output =
|
|
4185
|
+
const output = execSync16(
|
|
4166
4186
|
"find . -type d -name venv -not -path '*/node_modules/*'",
|
|
4167
4187
|
{
|
|
4168
4188
|
encoding: "utf8"
|
|
@@ -4194,9 +4214,9 @@ Total: ${folders.length} venv folder(s)`);
|
|
|
4194
4214
|
import { minimatch as minimatch4 } from "minimatch";
|
|
4195
4215
|
|
|
4196
4216
|
// src/commands/verify/run/getChangedFiles.ts
|
|
4197
|
-
import { execSync as
|
|
4217
|
+
import { execSync as execSync17 } from "child_process";
|
|
4198
4218
|
function getChangedFiles() {
|
|
4199
|
-
const output =
|
|
4219
|
+
const output = execSync17("git diff --name-only HEAD", {
|
|
4200
4220
|
encoding: "utf8"
|
|
4201
4221
|
}).trim();
|
|
4202
4222
|
if (output === "") return [];
|
|
@@ -4368,25 +4388,25 @@ async function run(options2 = {}) {
|
|
|
4368
4388
|
}
|
|
4369
4389
|
|
|
4370
4390
|
// src/commands/new/registerNew/initGit.ts
|
|
4371
|
-
import { execSync as
|
|
4391
|
+
import { execSync as execSync18 } from "child_process";
|
|
4372
4392
|
import { writeFileSync as writeFileSync10 } from "fs";
|
|
4373
4393
|
function initGit() {
|
|
4374
4394
|
console.log("Initializing git repository...");
|
|
4375
|
-
|
|
4395
|
+
execSync18("git init", { stdio: "inherit" });
|
|
4376
4396
|
writeFileSync10(".gitignore", "dist\nnode_modules\n");
|
|
4377
4397
|
}
|
|
4378
4398
|
|
|
4379
4399
|
// src/commands/new/registerNew/newCli/initPackageJson.ts
|
|
4380
|
-
import { execSync as
|
|
4400
|
+
import { execSync as execSync19 } from "child_process";
|
|
4381
4401
|
function initPackageJson(name) {
|
|
4382
4402
|
console.log("Initializing package.json...");
|
|
4383
|
-
|
|
4403
|
+
execSync19("npm init -y", { stdio: "inherit" });
|
|
4384
4404
|
console.log("Configuring package.json...");
|
|
4385
|
-
|
|
4386
|
-
|
|
4387
|
-
|
|
4388
|
-
|
|
4389
|
-
|
|
4405
|
+
execSync19("npm pkg delete main", { stdio: "inherit" });
|
|
4406
|
+
execSync19("npm pkg set type=module", { stdio: "inherit" });
|
|
4407
|
+
execSync19(`npm pkg set bin.${name}=./dist/index.js`, { stdio: "inherit" });
|
|
4408
|
+
execSync19("npm pkg set scripts.build=tsup", { stdio: "inherit" });
|
|
4409
|
+
execSync19('npm pkg set scripts.start="node dist/index.js"', {
|
|
4390
4410
|
stdio: "inherit"
|
|
4391
4411
|
});
|
|
4392
4412
|
}
|
|
@@ -4451,8 +4471,8 @@ async function newCli() {
|
|
|
4451
4471
|
initGit();
|
|
4452
4472
|
initPackageJson(name);
|
|
4453
4473
|
console.log("Installing dependencies...");
|
|
4454
|
-
|
|
4455
|
-
|
|
4474
|
+
execSync20("npm install commander", { stdio: "inherit" });
|
|
4475
|
+
execSync20("npm install -D tsup typescript @types/node", {
|
|
4456
4476
|
stdio: "inherit"
|
|
4457
4477
|
});
|
|
4458
4478
|
writeCliTemplate(name);
|
|
@@ -4461,11 +4481,11 @@ async function newCli() {
|
|
|
4461
4481
|
}
|
|
4462
4482
|
|
|
4463
4483
|
// src/commands/new/registerNew/newProject.ts
|
|
4464
|
-
import { execSync as
|
|
4484
|
+
import { execSync as execSync22 } from "child_process";
|
|
4465
4485
|
import { existsSync as existsSync15, readFileSync as readFileSync12, writeFileSync as writeFileSync13 } from "fs";
|
|
4466
4486
|
|
|
4467
4487
|
// src/commands/deploy/init/index.ts
|
|
4468
|
-
import { execSync as
|
|
4488
|
+
import { execSync as execSync21 } from "child_process";
|
|
4469
4489
|
import chalk28 from "chalk";
|
|
4470
4490
|
import enquirer3 from "enquirer";
|
|
4471
4491
|
|
|
@@ -4518,7 +4538,7 @@ Created ${WORKFLOW_PATH}`));
|
|
|
4518
4538
|
// src/commands/deploy/init/index.ts
|
|
4519
4539
|
async function ensureNetlifyCli() {
|
|
4520
4540
|
try {
|
|
4521
|
-
|
|
4541
|
+
execSync21("netlify sites:create --disable-linking", { stdio: "inherit" });
|
|
4522
4542
|
} catch (error) {
|
|
4523
4543
|
if (!(error instanceof Error) || !error.message.includes("command not found"))
|
|
4524
4544
|
throw error;
|
|
@@ -4533,9 +4553,9 @@ async function ensureNetlifyCli() {
|
|
|
4533
4553
|
process.exit(1);
|
|
4534
4554
|
}
|
|
4535
4555
|
console.log(chalk28.dim("\nInstalling netlify-cli...\n"));
|
|
4536
|
-
|
|
4556
|
+
execSync21("npm install -g netlify-cli", { stdio: "inherit" });
|
|
4537
4557
|
console.log();
|
|
4538
|
-
|
|
4558
|
+
execSync21("netlify sites:create --disable-linking", { stdio: "inherit" });
|
|
4539
4559
|
}
|
|
4540
4560
|
}
|
|
4541
4561
|
function printSetupInstructions() {
|
|
@@ -4578,7 +4598,7 @@ async function init6() {
|
|
|
4578
4598
|
// src/commands/new/registerNew/newProject.ts
|
|
4579
4599
|
async function newProject() {
|
|
4580
4600
|
console.log("Initializing Vite with react-ts template...");
|
|
4581
|
-
|
|
4601
|
+
execSync22("npm create vite@latest . -- --template react-ts", {
|
|
4582
4602
|
stdio: "inherit"
|
|
4583
4603
|
});
|
|
4584
4604
|
initGit();
|
|
@@ -4769,11 +4789,11 @@ function activityChart(data, range) {
|
|
|
4769
4789
|
}
|
|
4770
4790
|
|
|
4771
4791
|
// src/commands/activity/fetchCommitsPerDay.ts
|
|
4772
|
-
import { execSync as
|
|
4792
|
+
import { execSync as execSync23 } from "child_process";
|
|
4773
4793
|
function fetchContributions(from, to) {
|
|
4774
4794
|
const query = `{ viewer { contributionsCollection(from: "${from}T00:00:00Z", to: "${to}T23:59:59Z") { contributionCalendar { weeks { contributionDays { date contributionCount } } } } } }`;
|
|
4775
4795
|
const jq = ".data.viewer.contributionsCollection.contributionCalendar.weeks[].contributionDays[]";
|
|
4776
|
-
const raw =
|
|
4796
|
+
const raw = execSync23(`gh api graphql -f query='${query}' --jq '${jq}'`, {
|
|
4777
4797
|
encoding: "utf8"
|
|
4778
4798
|
}).trim();
|
|
4779
4799
|
if (!raw) return [];
|
|
@@ -4860,10 +4880,10 @@ import { join as join10 } from "path";
|
|
|
4860
4880
|
import chalk29 from "chalk";
|
|
4861
4881
|
|
|
4862
4882
|
// src/commands/backup/readCrontab.ts
|
|
4863
|
-
import { execSync as
|
|
4883
|
+
import { execSync as execSync24 } from "child_process";
|
|
4864
4884
|
function readCrontab() {
|
|
4865
4885
|
try {
|
|
4866
|
-
return
|
|
4886
|
+
return execSync24("crontab -l", {
|
|
4867
4887
|
encoding: "utf8",
|
|
4868
4888
|
stdio: ["ignore", "pipe", "ignore"]
|
|
4869
4889
|
});
|
|
@@ -4873,7 +4893,7 @@ function readCrontab() {
|
|
|
4873
4893
|
}
|
|
4874
4894
|
function writeCrontab(content) {
|
|
4875
4895
|
try {
|
|
4876
|
-
|
|
4896
|
+
execSync24("crontab -", {
|
|
4877
4897
|
input: content,
|
|
4878
4898
|
stdio: ["pipe", "ignore", "pipe"]
|
|
4879
4899
|
});
|
|
@@ -5214,7 +5234,7 @@ import chalk46 from "chalk";
|
|
|
5214
5234
|
import enquirer5 from "enquirer";
|
|
5215
5235
|
|
|
5216
5236
|
// src/shared/pullIfConfigured.ts
|
|
5217
|
-
import { execSync as
|
|
5237
|
+
import { execSync as execSync25 } from "child_process";
|
|
5218
5238
|
import chalk32 from "chalk";
|
|
5219
5239
|
function pullIfConfigured() {
|
|
5220
5240
|
const config = loadConfig();
|
|
@@ -5236,7 +5256,7 @@ function pullIfConfigured() {
|
|
|
5236
5256
|
return;
|
|
5237
5257
|
}
|
|
5238
5258
|
try {
|
|
5239
|
-
|
|
5259
|
+
execSync25("git pull --ff-only", { stdio: "inherit" });
|
|
5240
5260
|
} catch {
|
|
5241
5261
|
console.error(chalk32.red("git pull --ff-only failed; aborting."));
|
|
5242
5262
|
process.exit(1);
|
|
@@ -5244,7 +5264,7 @@ function pullIfConfigured() {
|
|
|
5244
5264
|
}
|
|
5245
5265
|
function hasUpstream() {
|
|
5246
5266
|
try {
|
|
5247
|
-
|
|
5267
|
+
execSync25("git rev-parse --abbrev-ref --symbolic-full-name @{upstream}", {
|
|
5248
5268
|
encoding: "utf8",
|
|
5249
5269
|
stdio: ["ignore", "pipe", "ignore"]
|
|
5250
5270
|
});
|
|
@@ -5255,7 +5275,7 @@ function hasUpstream() {
|
|
|
5255
5275
|
}
|
|
5256
5276
|
function hasLocalChanges() {
|
|
5257
5277
|
try {
|
|
5258
|
-
const status3 =
|
|
5278
|
+
const status3 = execSync25("git status --porcelain", {
|
|
5259
5279
|
encoding: "utf8"
|
|
5260
5280
|
});
|
|
5261
5281
|
return status3.trim().length > 0;
|
|
@@ -5522,7 +5542,7 @@ function buildArgs(prompt, options2) {
|
|
|
5522
5542
|
}
|
|
5523
5543
|
|
|
5524
5544
|
// src/commands/branch/createBranch.ts
|
|
5525
|
-
import { execSync as
|
|
5545
|
+
import { execSync as execSync27 } from "child_process";
|
|
5526
5546
|
|
|
5527
5547
|
// src/commands/branch/buildBranchName.ts
|
|
5528
5548
|
function buildBranchName({
|
|
@@ -5538,12 +5558,12 @@ function buildBranchName({
|
|
|
5538
5558
|
}
|
|
5539
5559
|
|
|
5540
5560
|
// src/commands/branch/resolveDefaultBranch.ts
|
|
5541
|
-
import { execSync as
|
|
5561
|
+
import { execSync as execSync26 } from "child_process";
|
|
5542
5562
|
var REMOTE_HEAD_REGEX = /^ref:\s+refs\/heads\/(\S+)\s+HEAD$/m;
|
|
5543
5563
|
function resolveDefaultBranch(override, cwd) {
|
|
5544
5564
|
if (override) return override;
|
|
5545
5565
|
try {
|
|
5546
|
-
const output =
|
|
5566
|
+
const output = execSync26("git ls-remote --symref origin HEAD", {
|
|
5547
5567
|
encoding: "utf8",
|
|
5548
5568
|
stdio: ["pipe", "pipe", "pipe"],
|
|
5549
5569
|
cwd
|
|
@@ -5567,11 +5587,11 @@ async function createBranch({
|
|
|
5567
5587
|
jira,
|
|
5568
5588
|
slug
|
|
5569
5589
|
});
|
|
5570
|
-
|
|
5590
|
+
execSync27("git fetch", { stdio: "inherit" });
|
|
5571
5591
|
let baseRef;
|
|
5572
5592
|
if (from) {
|
|
5573
5593
|
try {
|
|
5574
|
-
|
|
5594
|
+
execSync27(`git rev-parse --verify ${shellQuote(from)}`, {
|
|
5575
5595
|
stdio: ["pipe", "pipe", "pipe"]
|
|
5576
5596
|
});
|
|
5577
5597
|
} catch {
|
|
@@ -5581,7 +5601,7 @@ async function createBranch({
|
|
|
5581
5601
|
} else {
|
|
5582
5602
|
baseRef = `origin/${resolveDefaultBranch(config.branch?.defaultBranch)}`;
|
|
5583
5603
|
}
|
|
5584
|
-
|
|
5604
|
+
execSync27(`git switch -c ${shellQuote(branchName)} ${shellQuote(baseRef)}`, {
|
|
5585
5605
|
stdio: "inherit"
|
|
5586
5606
|
});
|
|
5587
5607
|
await recordBranchActivity(branchName);
|
|
@@ -5721,11 +5741,11 @@ function backupLocalBacklogFiles(dir) {
|
|
|
5721
5741
|
}
|
|
5722
5742
|
|
|
5723
5743
|
// src/commands/backlog/gitPullBacklog.ts
|
|
5724
|
-
import { execSync as
|
|
5744
|
+
import { execSync as execSync28 } from "child_process";
|
|
5725
5745
|
import chalk35 from "chalk";
|
|
5726
5746
|
function gitPullBacklog(dir) {
|
|
5727
5747
|
try {
|
|
5728
|
-
|
|
5748
|
+
execSync28("git pull --ff-only", {
|
|
5729
5749
|
cwd: dir,
|
|
5730
5750
|
stdio: ["pipe", "pipe", "pipe"]
|
|
5731
5751
|
});
|
|
@@ -8022,7 +8042,7 @@ import chalk61 from "chalk";
|
|
|
8022
8042
|
import { WebSocketServer } from "ws";
|
|
8023
8043
|
|
|
8024
8044
|
// src/shared/getInstallDir.ts
|
|
8025
|
-
import { execSync as
|
|
8045
|
+
import { execSync as execSync29 } from "child_process";
|
|
8026
8046
|
import { dirname as dirname18, resolve as resolve7 } from "path";
|
|
8027
8047
|
import { fileURLToPath as fileURLToPath3 } from "url";
|
|
8028
8048
|
var __filename2 = fileURLToPath3(import.meta.url);
|
|
@@ -8032,7 +8052,7 @@ function getInstallDir() {
|
|
|
8032
8052
|
}
|
|
8033
8053
|
function isGitRepo(dir) {
|
|
8034
8054
|
try {
|
|
8035
|
-
const result =
|
|
8055
|
+
const result = execSync29("git rev-parse --show-toplevel", {
|
|
8036
8056
|
cwd: dir,
|
|
8037
8057
|
stdio: "pipe"
|
|
8038
8058
|
}).toString().trim();
|
|
@@ -8049,11 +8069,11 @@ import {
|
|
|
8049
8069
|
import chalk57 from "chalk";
|
|
8050
8070
|
|
|
8051
8071
|
// src/lib/openBrowser.ts
|
|
8052
|
-
import { execSync as
|
|
8072
|
+
import { execSync as execSync30 } from "child_process";
|
|
8053
8073
|
function tryExec(commands) {
|
|
8054
8074
|
for (const cmd of commands) {
|
|
8055
8075
|
try {
|
|
8056
|
-
|
|
8076
|
+
execSync30(cmd, { stdio: "ignore" });
|
|
8057
8077
|
return true;
|
|
8058
8078
|
} catch {
|
|
8059
8079
|
}
|
|
@@ -9443,7 +9463,7 @@ import * as os3 from "os";
|
|
|
9443
9463
|
import * as path25 from "path";
|
|
9444
9464
|
|
|
9445
9465
|
// src/shared/checkCliAvailable.ts
|
|
9446
|
-
import { execSync as
|
|
9466
|
+
import { execSync as execSync31 } from "child_process";
|
|
9447
9467
|
function checkCliAvailable(cli) {
|
|
9448
9468
|
const binary = cli.split(/\s+/)[0];
|
|
9449
9469
|
const opts = {
|
|
@@ -9451,11 +9471,11 @@ function checkCliAvailable(cli) {
|
|
|
9451
9471
|
stdio: ["ignore", "pipe", "pipe"]
|
|
9452
9472
|
};
|
|
9453
9473
|
try {
|
|
9454
|
-
|
|
9474
|
+
execSync31(`command -v ${binary}`, opts);
|
|
9455
9475
|
return true;
|
|
9456
9476
|
} catch {
|
|
9457
9477
|
try {
|
|
9458
|
-
|
|
9478
|
+
execSync31(`where ${binary}`, opts);
|
|
9459
9479
|
return true;
|
|
9460
9480
|
} catch {
|
|
9461
9481
|
return false;
|
|
@@ -10890,13 +10910,13 @@ async function beginAssociation(id, options2, clearPatch, label2) {
|
|
|
10890
10910
|
}
|
|
10891
10911
|
|
|
10892
10912
|
// src/commands/backlog/associate-github/fetchGithubIssueTitle.ts
|
|
10893
|
-
import { execSync as
|
|
10913
|
+
import { execSync as execSync32 } from "child_process";
|
|
10894
10914
|
function fetchGithubIssueTitle(issue) {
|
|
10895
10915
|
const match = /^([^/]+)\/([^#]+)#(\d+)$/.exec(issue);
|
|
10896
10916
|
if (!match) return void 0;
|
|
10897
10917
|
const [, owner, repo, number] = match;
|
|
10898
10918
|
try {
|
|
10899
|
-
const result =
|
|
10919
|
+
const result = execSync32(
|
|
10900
10920
|
`gh issue view ${number} -R ${owner}/${repo} --json title`,
|
|
10901
10921
|
{ encoding: "utf8", stdio: ["ignore", "pipe", "pipe"] }
|
|
10902
10922
|
);
|
|
@@ -10963,12 +10983,12 @@ import chalk66 from "chalk";
|
|
|
10963
10983
|
import { eq as eq21 } from "drizzle-orm";
|
|
10964
10984
|
|
|
10965
10985
|
// src/commands/jira/fetchIssue.ts
|
|
10966
|
-
import { execSync as
|
|
10986
|
+
import { execSync as execSync33 } from "child_process";
|
|
10967
10987
|
import chalk65 from "chalk";
|
|
10968
10988
|
function fetchIssue(issueKey, fields) {
|
|
10969
10989
|
let result;
|
|
10970
10990
|
try {
|
|
10971
|
-
result =
|
|
10991
|
+
result = execSync33(
|
|
10972
10992
|
`acli jira workitem view ${issueKey} -f ${fields} --json`,
|
|
10973
10993
|
{ encoding: "utf8", stdio: ["pipe", "pipe", "pipe"] }
|
|
10974
10994
|
);
|
|
@@ -15120,10 +15140,10 @@ function formatResultLine(entry, failing) {
|
|
|
15120
15140
|
}
|
|
15121
15141
|
|
|
15122
15142
|
// src/commands/complexity/maintainability/getMaintainabilityGitState.ts
|
|
15123
|
-
import { execSync as
|
|
15143
|
+
import { execSync as execSync34 } from "child_process";
|
|
15124
15144
|
import path28 from "path";
|
|
15125
15145
|
function git3(command) {
|
|
15126
|
-
return
|
|
15146
|
+
return execSync34(command, { encoding: "utf8" });
|
|
15127
15147
|
}
|
|
15128
15148
|
function toAbsolute(root, repoRelative) {
|
|
15129
15149
|
return path28.resolve(root, repoRelative);
|
|
@@ -15697,7 +15717,7 @@ function loadBlogSkipDays(repoName) {
|
|
|
15697
15717
|
}
|
|
15698
15718
|
|
|
15699
15719
|
// src/commands/devlog/shared.ts
|
|
15700
|
-
import { execSync as
|
|
15720
|
+
import { execSync as execSync35 } from "child_process";
|
|
15701
15721
|
import chalk134 from "chalk";
|
|
15702
15722
|
|
|
15703
15723
|
// src/shared/getRepoName.ts
|
|
@@ -15789,7 +15809,7 @@ function loadAllDevlogLatestDates() {
|
|
|
15789
15809
|
// src/commands/devlog/shared.ts
|
|
15790
15810
|
function getCommitFiles(hash) {
|
|
15791
15811
|
try {
|
|
15792
|
-
const output =
|
|
15812
|
+
const output = execSync35(`git show --name-only --format="" ${hash}`, {
|
|
15793
15813
|
encoding: "utf8"
|
|
15794
15814
|
});
|
|
15795
15815
|
return output.trim().split("\n").filter(Boolean);
|
|
@@ -15885,11 +15905,11 @@ function list3(options2) {
|
|
|
15885
15905
|
}
|
|
15886
15906
|
|
|
15887
15907
|
// src/commands/devlog/getLastVersionInfo.ts
|
|
15888
|
-
import { execFileSync as execFileSync4, execSync as
|
|
15908
|
+
import { execFileSync as execFileSync4, execSync as execSync36 } from "child_process";
|
|
15889
15909
|
import semver from "semver";
|
|
15890
15910
|
function getVersionAtCommit(hash) {
|
|
15891
15911
|
try {
|
|
15892
|
-
const content =
|
|
15912
|
+
const content = execSync36(`git show ${hash}:package.json`, {
|
|
15893
15913
|
encoding: "utf8"
|
|
15894
15914
|
});
|
|
15895
15915
|
const pkg = JSON.parse(content);
|
|
@@ -16062,7 +16082,7 @@ function next2(options2) {
|
|
|
16062
16082
|
}
|
|
16063
16083
|
|
|
16064
16084
|
// src/commands/devlog/repos/index.ts
|
|
16065
|
-
import { execSync as
|
|
16085
|
+
import { execSync as execSync37 } from "child_process";
|
|
16066
16086
|
|
|
16067
16087
|
// src/commands/devlog/repos/printReposTable.ts
|
|
16068
16088
|
import chalk138 from "chalk";
|
|
@@ -16097,7 +16117,7 @@ function getStatus(lastPush, lastDevlog) {
|
|
|
16097
16117
|
return lastDevlog < lastPush ? "outdated" : "ok";
|
|
16098
16118
|
}
|
|
16099
16119
|
function fetchRepos(days, all) {
|
|
16100
|
-
const json =
|
|
16120
|
+
const json = execSync37(
|
|
16101
16121
|
"gh repo list staff0rd --json name,pushedAt,isArchived --limit 200",
|
|
16102
16122
|
{ encoding: "utf8" }
|
|
16103
16123
|
);
|
|
@@ -16477,7 +16497,7 @@ async function deps(csprojPath, options2) {
|
|
|
16477
16497
|
}
|
|
16478
16498
|
|
|
16479
16499
|
// src/commands/dotnet/getChangedCsFiles.ts
|
|
16480
|
-
import { execSync as
|
|
16500
|
+
import { execSync as execSync38 } from "child_process";
|
|
16481
16501
|
var SCOPE_ALL = "all";
|
|
16482
16502
|
var SCOPE_BASE = "base:";
|
|
16483
16503
|
var SCOPE_COMMIT = "commit:";
|
|
@@ -16501,7 +16521,7 @@ function getChangedCsFiles(scope) {
|
|
|
16501
16521
|
} else {
|
|
16502
16522
|
cmd = "git diff --name-only HEAD";
|
|
16503
16523
|
}
|
|
16504
|
-
const output =
|
|
16524
|
+
const output = execSync38(cmd, { encoding: "utf8" }).trim();
|
|
16505
16525
|
if (output === "") return [];
|
|
16506
16526
|
return output.split("\n").filter((f) => f.toLowerCase().endsWith(".cs"));
|
|
16507
16527
|
}
|
|
@@ -16699,14 +16719,14 @@ function parseInspectReport(json) {
|
|
|
16699
16719
|
}
|
|
16700
16720
|
|
|
16701
16721
|
// src/commands/dotnet/runInspectCode.ts
|
|
16702
|
-
import { execSync as
|
|
16722
|
+
import { execSync as execSync39 } from "child_process";
|
|
16703
16723
|
import { existsSync as existsSync40, readFileSync as readFileSync35, unlinkSync as unlinkSync10 } from "fs";
|
|
16704
16724
|
import { tmpdir as tmpdir4 } from "os";
|
|
16705
16725
|
import path35 from "path";
|
|
16706
16726
|
import chalk148 from "chalk";
|
|
16707
16727
|
function assertJbInstalled() {
|
|
16708
16728
|
try {
|
|
16709
|
-
|
|
16729
|
+
execSync39("jb inspectcode --version", { stdio: "pipe" });
|
|
16710
16730
|
} catch {
|
|
16711
16731
|
console.error(chalk148.red("jb is not installed. Install with:"));
|
|
16712
16732
|
console.error(
|
|
@@ -16720,7 +16740,7 @@ function runInspectCode(slnPath, include, swea) {
|
|
|
16720
16740
|
const includeFlag = include ? ` --include="${include}"` : "";
|
|
16721
16741
|
const sweaFlag = swea ? " --swea" : "";
|
|
16722
16742
|
try {
|
|
16723
|
-
|
|
16743
|
+
execSync39(
|
|
16724
16744
|
`jb inspectcode "${slnPath}" -o="${reportPath}"${includeFlag}${sweaFlag} --verbosity=OFF`,
|
|
16725
16745
|
{ stdio: "pipe" }
|
|
16726
16746
|
);
|
|
@@ -16741,7 +16761,7 @@ function runInspectCode(slnPath, include, swea) {
|
|
|
16741
16761
|
}
|
|
16742
16762
|
|
|
16743
16763
|
// src/commands/dotnet/runRoslynInspect.ts
|
|
16744
|
-
import { execSync as
|
|
16764
|
+
import { execSync as execSync40 } from "child_process";
|
|
16745
16765
|
import chalk149 from "chalk";
|
|
16746
16766
|
function resolveMsbuildPath() {
|
|
16747
16767
|
const { run: run4 } = loadConfig();
|
|
@@ -16752,7 +16772,7 @@ function resolveMsbuildPath() {
|
|
|
16752
16772
|
function assertMsbuildInstalled() {
|
|
16753
16773
|
const msbuild = resolveMsbuildPath();
|
|
16754
16774
|
try {
|
|
16755
|
-
|
|
16775
|
+
execSync40(`"${msbuild}" -version`, { stdio: "pipe" });
|
|
16756
16776
|
} catch {
|
|
16757
16777
|
console.error(chalk149.red(`msbuild not found at: ${msbuild}`));
|
|
16758
16778
|
console.error(
|
|
@@ -16778,7 +16798,7 @@ function runRoslynInspect(slnPath) {
|
|
|
16778
16798
|
const msbuild = resolveMsbuildPath();
|
|
16779
16799
|
let output;
|
|
16780
16800
|
try {
|
|
16781
|
-
output =
|
|
16801
|
+
output = execSync40(
|
|
16782
16802
|
`"${msbuild}" "${slnPath}" -t:Build -v:minimal -maxcpucount -p:EnforceCodeStyleInBuild=true -p:RunAnalyzersDuringBuild=true 2>&1`,
|
|
16783
16803
|
{ encoding: "utf8", stdio: "pipe", maxBuffer: 50 * 1024 * 1024 }
|
|
16784
16804
|
);
|
|
@@ -17625,7 +17645,7 @@ function acceptanceCriteria(issueKey) {
|
|
|
17625
17645
|
}
|
|
17626
17646
|
|
|
17627
17647
|
// src/commands/jira/jiraAuth.ts
|
|
17628
|
-
import { execSync as
|
|
17648
|
+
import { execSync as execSync41 } from "child_process";
|
|
17629
17649
|
|
|
17630
17650
|
// src/shared/promptInput.ts
|
|
17631
17651
|
import Enquirer from "enquirer";
|
|
@@ -17660,7 +17680,7 @@ async function jiraAuth() {
|
|
|
17660
17680
|
console.error("All fields are required.");
|
|
17661
17681
|
process.exit(1);
|
|
17662
17682
|
}
|
|
17663
|
-
|
|
17683
|
+
execSync41(`acli jira auth login --site ${site} --email "${email}" --token`, {
|
|
17664
17684
|
encoding: "utf8",
|
|
17665
17685
|
input: token,
|
|
17666
17686
|
stdio: ["pipe", "inherit", "inherit"]
|
|
@@ -19121,7 +19141,7 @@ function registerPrompts(program2) {
|
|
|
19121
19141
|
}
|
|
19122
19142
|
|
|
19123
19143
|
// src/commands/prs/shared.ts
|
|
19124
|
-
import { execSync as
|
|
19144
|
+
import { execSync as execSync42 } from "child_process";
|
|
19125
19145
|
function isGhNotInstalled(error) {
|
|
19126
19146
|
if (error instanceof Error) {
|
|
19127
19147
|
const msg = error.message.toLowerCase();
|
|
@@ -19139,12 +19159,12 @@ function getRepoInfo() {
|
|
|
19139
19159
|
const preferred = getPreferredRemoteRepo();
|
|
19140
19160
|
if (preferred) return preferred;
|
|
19141
19161
|
const repoInfo = JSON.parse(
|
|
19142
|
-
|
|
19162
|
+
execSync42("gh repo view --json owner,name", { encoding: "utf8" })
|
|
19143
19163
|
);
|
|
19144
19164
|
return { org: repoInfo.owner.login, repo: repoInfo.name };
|
|
19145
19165
|
}
|
|
19146
19166
|
function getCurrentBranch2() {
|
|
19147
|
-
return
|
|
19167
|
+
return execSync42("git rev-parse --abbrev-ref HEAD", {
|
|
19148
19168
|
encoding: "utf8"
|
|
19149
19169
|
}).trim();
|
|
19150
19170
|
}
|
|
@@ -19152,7 +19172,7 @@ function viewCurrentPr(fields) {
|
|
|
19152
19172
|
const { org, repo } = getRepoInfo();
|
|
19153
19173
|
const branch2 = getCurrentBranch2();
|
|
19154
19174
|
return JSON.parse(
|
|
19155
|
-
|
|
19175
|
+
execSync42(`gh pr view ${branch2} --json ${fields} -R ${org}/${repo}`, {
|
|
19156
19176
|
encoding: "utf8"
|
|
19157
19177
|
})
|
|
19158
19178
|
);
|
|
@@ -19454,10 +19474,10 @@ function edit(options2) {
|
|
|
19454
19474
|
}
|
|
19455
19475
|
|
|
19456
19476
|
// src/commands/prs/fixed.ts
|
|
19457
|
-
import { execSync as
|
|
19477
|
+
import { execSync as execSync45 } from "child_process";
|
|
19458
19478
|
|
|
19459
19479
|
// src/commands/prs/resolveCommentWithReply.ts
|
|
19460
|
-
import { execSync as
|
|
19480
|
+
import { execSync as execSync44 } from "child_process";
|
|
19461
19481
|
import { unlinkSync as unlinkSync14, writeFileSync as writeFileSync33 } from "fs";
|
|
19462
19482
|
import { tmpdir as tmpdir6 } from "os";
|
|
19463
19483
|
import { join as join55 } from "path";
|
|
@@ -19486,9 +19506,9 @@ function deleteCommentsCache(prNumber) {
|
|
|
19486
19506
|
}
|
|
19487
19507
|
|
|
19488
19508
|
// src/commands/prs/replyToComment.ts
|
|
19489
|
-
import { execSync as
|
|
19509
|
+
import { execSync as execSync43 } from "child_process";
|
|
19490
19510
|
function replyToComment(org, repo, prNumber, commentId, message2) {
|
|
19491
|
-
|
|
19511
|
+
execSync43(
|
|
19492
19512
|
`gh api repos/${org}/${repo}/pulls/${prNumber}/comments -f body="${message2.replace(/"/g, String.raw`\"`)}" -F in_reply_to=${commentId}`,
|
|
19493
19513
|
{ stdio: ["inherit", "pipe", "inherit"] }
|
|
19494
19514
|
);
|
|
@@ -19500,7 +19520,7 @@ function resolveThread(threadId) {
|
|
|
19500
19520
|
const queryFile = join55(tmpdir6(), `gh-mutation-${Date.now()}.graphql`);
|
|
19501
19521
|
writeFileSync33(queryFile, mutation);
|
|
19502
19522
|
try {
|
|
19503
|
-
|
|
19523
|
+
execSync44(
|
|
19504
19524
|
`gh api graphql -F query=@${queryFile} -f threadId="${threadId}"`,
|
|
19505
19525
|
{ stdio: ["inherit", "pipe", "inherit"] }
|
|
19506
19526
|
);
|
|
@@ -19552,7 +19572,7 @@ function resolveCommentWithReply(commentId, message2) {
|
|
|
19552
19572
|
// src/commands/prs/fixed.ts
|
|
19553
19573
|
function verifySha(sha) {
|
|
19554
19574
|
try {
|
|
19555
|
-
return
|
|
19575
|
+
return execSync45(`git rev-parse --verify ${sha}`, {
|
|
19556
19576
|
encoding: "utf8"
|
|
19557
19577
|
}).trim();
|
|
19558
19578
|
} catch {
|
|
@@ -19566,7 +19586,7 @@ function fixed(commentId, sha) {
|
|
|
19566
19586
|
const { org, repo } = getRepoInfo();
|
|
19567
19587
|
const repoUrl = `https://github.com/${org}/${repo}`;
|
|
19568
19588
|
const message2 = `Fixed in [${fullSha}](${repoUrl}/commit/${fullSha})`;
|
|
19569
|
-
pushCommit();
|
|
19589
|
+
pushCommit(loadConfig().worktree?.trunk === true);
|
|
19570
19590
|
resolveCommentWithReply(commentId, message2);
|
|
19571
19591
|
} catch (error) {
|
|
19572
19592
|
if (isGhNotInstalled(error)) {
|
|
@@ -19584,7 +19604,7 @@ import { join as join57 } from "path";
|
|
|
19584
19604
|
import { stringify } from "yaml";
|
|
19585
19605
|
|
|
19586
19606
|
// src/commands/prs/fetchThreadIds.ts
|
|
19587
|
-
import { execSync as
|
|
19607
|
+
import { execSync as execSync46 } from "child_process";
|
|
19588
19608
|
import { unlinkSync as unlinkSync15, writeFileSync as writeFileSync34 } from "fs";
|
|
19589
19609
|
import { tmpdir as tmpdir7 } from "os";
|
|
19590
19610
|
import { join as join56 } from "path";
|
|
@@ -19593,7 +19613,7 @@ function fetchThreadIds(org, repo, prNumber) {
|
|
|
19593
19613
|
const queryFile = join56(tmpdir7(), `gh-query-${Date.now()}.graphql`);
|
|
19594
19614
|
writeFileSync34(queryFile, THREAD_QUERY);
|
|
19595
19615
|
try {
|
|
19596
|
-
const result =
|
|
19616
|
+
const result = execSync46(
|
|
19597
19617
|
`gh api graphql -F query=@${queryFile} -F owner="${org}" -F repo="${repo}" -F prNumber=${prNumber}`,
|
|
19598
19618
|
{ encoding: "utf8" }
|
|
19599
19619
|
);
|
|
@@ -19615,9 +19635,9 @@ function fetchThreadIds(org, repo, prNumber) {
|
|
|
19615
19635
|
}
|
|
19616
19636
|
|
|
19617
19637
|
// src/commands/prs/listComments/fetchReviewComments.ts
|
|
19618
|
-
import { execSync as
|
|
19638
|
+
import { execSync as execSync47 } from "child_process";
|
|
19619
19639
|
function fetchJson(endpoint) {
|
|
19620
|
-
const result =
|
|
19640
|
+
const result = execSync47(`gh api --paginate ${endpoint}`, {
|
|
19621
19641
|
encoding: "utf8"
|
|
19622
19642
|
});
|
|
19623
19643
|
if (!result.trim()) return [];
|
|
@@ -19756,7 +19776,7 @@ async function listComments() {
|
|
|
19756
19776
|
}
|
|
19757
19777
|
|
|
19758
19778
|
// src/commands/prs/prs/index.ts
|
|
19759
|
-
import { execSync as
|
|
19779
|
+
import { execSync as execSync48 } from "child_process";
|
|
19760
19780
|
|
|
19761
19781
|
// src/commands/prs/prs/displayPaginated/index.ts
|
|
19762
19782
|
import enquirer9 from "enquirer";
|
|
@@ -19863,7 +19883,7 @@ async function prs(options2) {
|
|
|
19863
19883
|
const state = options2.open ? "open" : options2.closed ? "closed" : "all";
|
|
19864
19884
|
try {
|
|
19865
19885
|
const { org, repo } = getRepoInfo();
|
|
19866
|
-
const result =
|
|
19886
|
+
const result = execSync48(
|
|
19867
19887
|
`gh pr list --state ${state} --json number,title,url,author,createdAt,mergedAt,closedAt,state,changedFiles --limit 100 -R ${org}/${repo}`,
|
|
19868
19888
|
{ encoding: "utf8" }
|
|
19869
19889
|
);
|
|
@@ -19934,16 +19954,16 @@ function buildCreateArgs(title, body, options2) {
|
|
|
19934
19954
|
}
|
|
19935
19955
|
|
|
19936
19956
|
// src/commands/prs/readSessionPrRef.ts
|
|
19937
|
-
import { execSync as
|
|
19957
|
+
import { execSync as execSync49 } from "child_process";
|
|
19938
19958
|
function readSessionPrRef() {
|
|
19939
19959
|
try {
|
|
19940
|
-
const branch2 =
|
|
19960
|
+
const branch2 = execSync49("git rev-parse --abbrev-ref HEAD", {
|
|
19941
19961
|
encoding: "utf8",
|
|
19942
19962
|
stdio: ["pipe", "pipe", "pipe"]
|
|
19943
19963
|
}).trim();
|
|
19944
19964
|
if (!branch2 || branch2 === "HEAD") return null;
|
|
19945
19965
|
const pr = JSON.parse(
|
|
19946
|
-
|
|
19966
|
+
execSync49(`gh pr view ${branch2} --json number,title,url,state`, {
|
|
19947
19967
|
encoding: "utf8",
|
|
19948
19968
|
stdio: ["pipe", "pipe", "pipe"]
|
|
19949
19969
|
})
|
|
@@ -20071,7 +20091,7 @@ function reply(commentId, body) {
|
|
|
20071
20091
|
}
|
|
20072
20092
|
|
|
20073
20093
|
// src/commands/prs/wontfix.ts
|
|
20074
|
-
import { execSync as
|
|
20094
|
+
import { execSync as execSync50 } from "child_process";
|
|
20075
20095
|
function validateReason(reason2) {
|
|
20076
20096
|
const lowerReason = reason2.toLowerCase();
|
|
20077
20097
|
if (lowerReason.includes("claude") || lowerReason.includes("opus")) {
|
|
@@ -20088,7 +20108,7 @@ function validateShaReferences(reason2) {
|
|
|
20088
20108
|
const invalidShas = [];
|
|
20089
20109
|
for (const sha of shas) {
|
|
20090
20110
|
try {
|
|
20091
|
-
|
|
20111
|
+
execSync50(`git cat-file -t ${sha}`, { stdio: "pipe" });
|
|
20092
20112
|
} catch {
|
|
20093
20113
|
invalidShas.push(sha);
|
|
20094
20114
|
}
|
|
@@ -20365,10 +20385,10 @@ import chalk168 from "chalk";
|
|
|
20365
20385
|
import Enquirer2 from "enquirer";
|
|
20366
20386
|
|
|
20367
20387
|
// src/commands/ravendb/searchItems.ts
|
|
20368
|
-
import { execSync as
|
|
20388
|
+
import { execSync as execSync51 } from "child_process";
|
|
20369
20389
|
import chalk167 from "chalk";
|
|
20370
20390
|
function opExec(args) {
|
|
20371
|
-
return
|
|
20391
|
+
return execSync51(`op ${args}`, {
|
|
20372
20392
|
encoding: "utf8",
|
|
20373
20393
|
stdio: ["pipe", "pipe", "pipe"]
|
|
20374
20394
|
}).trim();
|
|
@@ -20520,7 +20540,7 @@ ${errorText}`
|
|
|
20520
20540
|
}
|
|
20521
20541
|
|
|
20522
20542
|
// src/commands/ravendb/resolveOpSecret.ts
|
|
20523
|
-
import { execSync as
|
|
20543
|
+
import { execSync as execSync52 } from "child_process";
|
|
20524
20544
|
import chalk172 from "chalk";
|
|
20525
20545
|
function resolveOpSecret(reference) {
|
|
20526
20546
|
if (!reference.startsWith("op://")) {
|
|
@@ -20528,7 +20548,7 @@ function resolveOpSecret(reference) {
|
|
|
20528
20548
|
process.exit(1);
|
|
20529
20549
|
}
|
|
20530
20550
|
try {
|
|
20531
|
-
return
|
|
20551
|
+
return execSync52(`op read "${reference}"`, {
|
|
20532
20552
|
encoding: "utf8",
|
|
20533
20553
|
stdio: ["pipe", "pipe", "pipe"]
|
|
20534
20554
|
}).trim();
|
|
@@ -20792,7 +20812,7 @@ Refactor check failed:
|
|
|
20792
20812
|
}
|
|
20793
20813
|
|
|
20794
20814
|
// src/commands/refactor/check/getViolations/index.ts
|
|
20795
|
-
import { execSync as
|
|
20815
|
+
import { execSync as execSync53 } from "child_process";
|
|
20796
20816
|
import fs25 from "fs";
|
|
20797
20817
|
import { minimatch as minimatch6 } from "minimatch";
|
|
20798
20818
|
|
|
@@ -20842,7 +20862,7 @@ function getGitFiles(options2) {
|
|
|
20842
20862
|
}
|
|
20843
20863
|
const files = /* @__PURE__ */ new Set();
|
|
20844
20864
|
if (options2.staged || options2.modified) {
|
|
20845
|
-
const staged =
|
|
20865
|
+
const staged = execSync53("git diff --cached --name-only", {
|
|
20846
20866
|
encoding: "utf8"
|
|
20847
20867
|
});
|
|
20848
20868
|
for (const file of staged.trim().split("\n").filter(Boolean)) {
|
|
@@ -20850,7 +20870,7 @@ function getGitFiles(options2) {
|
|
|
20850
20870
|
}
|
|
20851
20871
|
}
|
|
20852
20872
|
if (options2.unstaged || options2.modified) {
|
|
20853
|
-
const unstaged =
|
|
20873
|
+
const unstaged = execSync53("git diff --name-only", { encoding: "utf8" });
|
|
20854
20874
|
for (const file of unstaged.trim().split("\n").filter(Boolean)) {
|
|
20855
20875
|
files.add(file);
|
|
20856
20876
|
}
|
|
@@ -22557,9 +22577,9 @@ function buildReviewPaths(repoRoot, key) {
|
|
|
22557
22577
|
}
|
|
22558
22578
|
|
|
22559
22579
|
// src/commands/review/fetchExistingComments.ts
|
|
22560
|
-
import { execSync as
|
|
22580
|
+
import { execSync as execSync54 } from "child_process";
|
|
22561
22581
|
function fetchRawComments(org, repo, prNumber) {
|
|
22562
|
-
const out =
|
|
22582
|
+
const out = execSync54(
|
|
22563
22583
|
`gh api --paginate repos/${org}/${repo}/pulls/${prNumber}/comments`,
|
|
22564
22584
|
{ encoding: "utf8", maxBuffer: 64 * 1024 * 1024 }
|
|
22565
22585
|
);
|
|
@@ -22590,14 +22610,14 @@ function fetchExistingComments() {
|
|
|
22590
22610
|
}
|
|
22591
22611
|
|
|
22592
22612
|
// src/commands/review/gatherContext.ts
|
|
22593
|
-
import { execSync as
|
|
22613
|
+
import { execSync as execSync57 } from "child_process";
|
|
22594
22614
|
|
|
22595
22615
|
// src/commands/review/fetchPrDiff.ts
|
|
22596
|
-
import { execSync as
|
|
22616
|
+
import { execSync as execSync55 } from "child_process";
|
|
22597
22617
|
function fetchPrDiff(prNumber, baseSha, headSha) {
|
|
22598
22618
|
const { org, repo } = getRepoInfo();
|
|
22599
22619
|
try {
|
|
22600
|
-
return
|
|
22620
|
+
return execSync55(`gh pr diff ${prNumber} -R ${org}/${repo}`, {
|
|
22601
22621
|
encoding: "utf8",
|
|
22602
22622
|
maxBuffer: 256 * 1024 * 1024,
|
|
22603
22623
|
stdio: ["ignore", "pipe", "pipe"]
|
|
@@ -22612,19 +22632,19 @@ function isDiffTooLarge(error) {
|
|
|
22612
22632
|
}
|
|
22613
22633
|
function fetchDiffViaGit(baseSha, headSha) {
|
|
22614
22634
|
try {
|
|
22615
|
-
|
|
22635
|
+
execSync55(`git fetch origin ${baseSha} ${headSha}`, { stdio: "ignore" });
|
|
22616
22636
|
} catch {
|
|
22617
22637
|
}
|
|
22618
|
-
return
|
|
22638
|
+
return execSync55(`git diff ${baseSha}...${headSha}`, {
|
|
22619
22639
|
encoding: "utf8",
|
|
22620
22640
|
maxBuffer: 256 * 1024 * 1024
|
|
22621
22641
|
});
|
|
22622
22642
|
}
|
|
22623
22643
|
|
|
22624
22644
|
// src/commands/review/fetchPrDiffInfo.ts
|
|
22625
|
-
import { execSync as
|
|
22645
|
+
import { execSync as execSync56 } from "child_process";
|
|
22626
22646
|
function getCurrentBranch3() {
|
|
22627
|
-
return
|
|
22647
|
+
return execSync56("git rev-parse --abbrev-ref HEAD", {
|
|
22628
22648
|
encoding: "utf8"
|
|
22629
22649
|
}).trim();
|
|
22630
22650
|
}
|
|
@@ -22632,7 +22652,7 @@ function fetchPrDiffInfo() {
|
|
|
22632
22652
|
const { org, repo } = getRepoInfo();
|
|
22633
22653
|
const branch2 = getCurrentBranch3();
|
|
22634
22654
|
const fields = "number,baseRefName,baseRefOid,headRefName,headRefOid";
|
|
22635
|
-
const raw =
|
|
22655
|
+
const raw = execSync56(
|
|
22636
22656
|
`gh pr list --state open --head ${branch2} --json ${fields} -R ${org}/${repo}`,
|
|
22637
22657
|
{
|
|
22638
22658
|
encoding: "utf8",
|
|
@@ -22657,7 +22677,7 @@ function fetchPrDiffInfo() {
|
|
|
22657
22677
|
}
|
|
22658
22678
|
function fetchPrChangedFiles(prNumber) {
|
|
22659
22679
|
const { org, repo } = getRepoInfo();
|
|
22660
|
-
const out =
|
|
22680
|
+
const out = execSync56(
|
|
22661
22681
|
`gh api repos/${org}/${repo}/pulls/${prNumber}/files --paginate --jq ".[].filename"`,
|
|
22662
22682
|
{
|
|
22663
22683
|
encoding: "utf8",
|
|
@@ -22669,11 +22689,11 @@ function fetchPrChangedFiles(prNumber) {
|
|
|
22669
22689
|
|
|
22670
22690
|
// src/commands/review/gatherContext.ts
|
|
22671
22691
|
function gatherContext() {
|
|
22672
|
-
const branch2 =
|
|
22692
|
+
const branch2 = execSync57("git rev-parse --abbrev-ref HEAD", {
|
|
22673
22693
|
encoding: "utf8"
|
|
22674
22694
|
}).trim();
|
|
22675
|
-
const sha =
|
|
22676
|
-
const shortSha =
|
|
22695
|
+
const sha = execSync57("git rev-parse HEAD", { encoding: "utf8" }).trim();
|
|
22696
|
+
const shortSha = execSync57("git rev-parse --short=7 HEAD", {
|
|
22677
22697
|
encoding: "utf8"
|
|
22678
22698
|
}).trim();
|
|
22679
22699
|
const prInfo = fetchPrDiffInfo();
|
|
@@ -25316,7 +25336,7 @@ import { mkdirSync as mkdirSync22 } from "fs";
|
|
|
25316
25336
|
import { join as join64 } from "path";
|
|
25317
25337
|
|
|
25318
25338
|
// src/commands/voice/checkLockFile.ts
|
|
25319
|
-
import { execSync as
|
|
25339
|
+
import { execSync as execSync58 } from "child_process";
|
|
25320
25340
|
import { existsSync as existsSync55, mkdirSync as mkdirSync21, readFileSync as readFileSync44, writeFileSync as writeFileSync39 } from "fs";
|
|
25321
25341
|
import { join as join63 } from "path";
|
|
25322
25342
|
function isProcessAlive2(pid) {
|
|
@@ -25345,7 +25365,7 @@ function bootstrapVenv() {
|
|
|
25345
25365
|
if (existsSync55(getVenvPython())) return;
|
|
25346
25366
|
console.log("Setting up Python environment...");
|
|
25347
25367
|
const pythonDir = getPythonDir();
|
|
25348
|
-
|
|
25368
|
+
execSync58(
|
|
25349
25369
|
`uv sync --project "${pythonDir}" --extra runtime --no-install-project`,
|
|
25350
25370
|
{
|
|
25351
25371
|
stdio: "inherit",
|
|
@@ -26190,11 +26210,11 @@ function resolveParams(params, cliArgs) {
|
|
|
26190
26210
|
}
|
|
26191
26211
|
|
|
26192
26212
|
// src/commands/run/runPreCommands.ts
|
|
26193
|
-
import { execSync as
|
|
26213
|
+
import { execSync as execSync59 } from "child_process";
|
|
26194
26214
|
function runPreCommands(pre, cwd) {
|
|
26195
26215
|
for (const cmd of pre) {
|
|
26196
26216
|
try {
|
|
26197
|
-
|
|
26217
|
+
execSync59(cmd, { stdio: "inherit", cwd });
|
|
26198
26218
|
} catch (error) {
|
|
26199
26219
|
const code = error && typeof error === "object" && "status" in error ? error.status : 1;
|
|
26200
26220
|
process.exit(code);
|
|
@@ -26495,7 +26515,7 @@ function registerRun(program2) {
|
|
|
26495
26515
|
}
|
|
26496
26516
|
|
|
26497
26517
|
// src/commands/screenshot/index.ts
|
|
26498
|
-
import { execSync as
|
|
26518
|
+
import { execSync as execSync60 } from "child_process";
|
|
26499
26519
|
import { existsSync as existsSync60, mkdirSync as mkdirSync25, unlinkSync as unlinkSync21, writeFileSync as writeFileSync42 } from "fs";
|
|
26500
26520
|
import { tmpdir as tmpdir8 } from "os";
|
|
26501
26521
|
import { join as join70, resolve as resolve17 } from "path";
|
|
@@ -26638,7 +26658,7 @@ function runPowerShellScript(processName, outputPath) {
|
|
|
26638
26658
|
const scriptPath = join70(tmpdir8(), `assist-screenshot-${Date.now()}.ps1`);
|
|
26639
26659
|
writeFileSync42(scriptPath, captureWindowPs1, "utf8");
|
|
26640
26660
|
try {
|
|
26641
|
-
|
|
26661
|
+
execSync60(
|
|
26642
26662
|
`powershell -NoProfile -ExecutionPolicy Bypass -File "${scriptPath}" -ProcessName "${processName}" -OutputPath "${outputPath}"`,
|
|
26643
26663
|
{ stdio: ["ignore", "pipe", "pipe"], encoding: "utf8" }
|
|
26644
26664
|
);
|
|
@@ -31449,7 +31469,7 @@ function syncCommands(claudeDir, targetBase) {
|
|
|
31449
31469
|
}
|
|
31450
31470
|
|
|
31451
31471
|
// src/commands/update.ts
|
|
31452
|
-
import { execSync as
|
|
31472
|
+
import { execSync as execSync61 } from "child_process";
|
|
31453
31473
|
import * as path70 from "path";
|
|
31454
31474
|
|
|
31455
31475
|
// src/commands/restartDaemonAfterUpdate.ts
|
|
@@ -31473,7 +31493,7 @@ function isGlobalNpmInstall(dir) {
|
|
|
31473
31493
|
if (resolved.split(path70.sep).includes("node_modules")) {
|
|
31474
31494
|
return true;
|
|
31475
31495
|
}
|
|
31476
|
-
const globalPrefix =
|
|
31496
|
+
const globalPrefix = execSync61("npm prefix -g", { stdio: "pipe" }).toString().trim();
|
|
31477
31497
|
return resolved.toLowerCase().startsWith(path70.resolve(globalPrefix).toLowerCase());
|
|
31478
31498
|
} catch {
|
|
31479
31499
|
return false;
|
|
@@ -31484,18 +31504,18 @@ async function update2() {
|
|
|
31484
31504
|
console.log(`Assist is installed at: ${installDir}`);
|
|
31485
31505
|
if (isGitRepo(installDir)) {
|
|
31486
31506
|
console.log("Detected git repo installation, pulling latest...");
|
|
31487
|
-
|
|
31507
|
+
execSync61("git pull", { cwd: installDir, stdio: "inherit" });
|
|
31488
31508
|
console.log("Installing dependencies...");
|
|
31489
|
-
|
|
31509
|
+
execSync61("npm i", { cwd: installDir, stdio: "inherit" });
|
|
31490
31510
|
console.log("Building...");
|
|
31491
|
-
|
|
31511
|
+
execSync61("npm run build", { cwd: installDir, stdio: "inherit" });
|
|
31492
31512
|
console.log("Syncing commands...");
|
|
31493
|
-
|
|
31513
|
+
execSync61("assist sync", { stdio: "inherit" });
|
|
31494
31514
|
} else if (isGlobalNpmInstall(installDir)) {
|
|
31495
31515
|
console.log("Detected global npm installation, updating...");
|
|
31496
|
-
|
|
31516
|
+
execSync61("npm i -g @staff0rd/assist@latest", { stdio: "inherit" });
|
|
31497
31517
|
console.log("Syncing commands...");
|
|
31498
|
-
|
|
31518
|
+
execSync61("assist sync", { stdio: "inherit" });
|
|
31499
31519
|
} else {
|
|
31500
31520
|
console.error(
|
|
31501
31521
|
"Could not determine installation method. Expected a git repo or global npm install."
|