Skip to content

Commit e0adde2

Browse files
committed
Harden workspace release command resolution
1 parent 0f28f62 commit e0adde2

File tree

3 files changed

+18
-3
lines changed

3 files changed

+18
-3
lines changed

packages/happy-agent/package.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -37,7 +37,7 @@
3737
"test": "$npm_execpath run build && vitest run",
3838
"dev": "tsx src/index.ts",
3939
"prepublishOnly": "$npm_execpath run build && $npm_execpath test",
40-
"release": "release-it"
40+
"release": "npx --no-install release-it"
4141
},
4242
"dependencies": {
4343
"axios": "^1.13.2",

packages/happy-cli/package.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -65,7 +65,7 @@
6565
"dev:local-server": "$npm_execpath run build && tsx --env-file .env.dev-local-server src/index.ts",
6666
"dev:integration-test-env": "$npm_execpath run build && tsx --env-file .env.integration-test src/index.ts",
6767
"prepublishOnly": "$npm_execpath run build && $npm_execpath test",
68-
"release": "release-it",
68+
"release": "npx --no-install release-it",
6969
"postinstall": "node scripts/unpack-tools.cjs",
7070
"// ==== Dev/Stable Variant Management ====": "",
7171
"stable": "node scripts/env-wrapper.cjs stable",

scripts/release.cjs

Lines changed: 16 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -81,13 +81,28 @@ function runRelease(target) {
8181
`Running release pipeline for ${target.id} (workspace: ${target.workspaceName})`
8282
);
8383

84+
const workspaceBin = path.join(
85+
repoRoot,
86+
target.workspacePath,
87+
"node_modules",
88+
".bin"
89+
);
90+
const rootBin = path.join(repoRoot, "node_modules", ".bin");
91+
const existingPath = process.env.PATH || "";
92+
const releasePath = [workspaceBin, rootBin, existingPath]
93+
.filter(Boolean)
94+
.join(path.delimiter);
95+
8496
const result = spawnSync(
8597
"yarn",
8698
["workspace", target.workspaceName, "run", "release"],
8799
{
88100
cwd: repoRoot,
89101
stdio: "inherit",
90-
env: process.env,
102+
env: {
103+
...process.env,
104+
PATH: releasePath,
105+
},
91106
}
92107
);
93108

0 commit comments

Comments
 (0)