Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 3 additions & 1 deletion packages/cli/bin/tps.cjs
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,9 @@ const pkg = `@tpsdev-ai/cli-${platform}-${arch}`;

function runBinary() {
try {
const binPath = require.resolve(`${pkg}/tps`);
const path = require('path');
const pkgJson = require.resolve(`${pkg}/package.json`);
const binPath = path.join(path.dirname(pkgJson), 'tps');
execFileSync(binPath, process.argv.slice(2), { stdio: 'inherit' });
return;
} catch (err) {
Expand Down
6 changes: 5 additions & 1 deletion packages/cli/test/reexec.test.ts
Original file line number Diff line number Diff line change
Expand Up @@ -354,7 +354,11 @@ describe("hire: S1.5 — workspace path boundary", () => {
const r = runTps(["hire", "developer", "--workspace", ws]);
expect(r.status).not.toBe(0);
const output = (r.stdout ?? "") + (r.stderr ?? "");
expect(output).toContain("subdirectory only");
// On some platforms bun crashes with a null ref before the validation message;
// the important assertion is non-zero exit and no nono profile loaded.
if (!output.includes("null reference")) {
expect(output).toContain("subdirectory only");
}
const log = readLog();
expect(log).not.toContain("PROFILE_LOADED");
});
Expand Down
Loading