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: 2 additions & 2 deletions package-lock.json

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "@coderbuzz/dsh",
"version": "0.1.4",
"version": "0.1.5",
"description": "DeepSeek harness for orchestrators: structured JSON SDK and CLI on top of the deepcode-cli engine",
"license": "MIT",
"repository": {
Expand Down
6 changes: 4 additions & 2 deletions test/install.test.mjs
Original file line number Diff line number Diff line change
Expand Up @@ -8,16 +8,18 @@ import os from "node:os";
import path from "node:path";

const run = promisify(execFile);
// `npm publish` runs this via prepublishOnly and leaks npm_* config (dry-run, command, ...) into child npm calls.
const cleanEnv = Object.fromEntries(Object.entries(process.env).filter(([k]) => !k.toLowerCase().startsWith("npm_")));
const script = path.resolve("install.sh");
const version = JSON.parse(fs.readFileSync("package.json", "utf8")).version;

test("install.sh: install, rerun, refuse to overwrite, uninstall", async () => {
const tmp = fs.mkdtempSync(path.join(os.tmpdir(), "dsh-inst-"));
const packed = (await run("npm", ["pack", "--pack-destination", tmp, "--ignore-scripts", "--json"])).stdout;
const packed = (await run("npm", ["pack", "--pack-destination", tmp, "--ignore-scripts", "--json"], { env: cleanEnv })).stdout;
const tarball = path.join(tmp, JSON.parse(packed)[0].filename);
const prefix = path.join(tmp, "prefix");
const bin = path.join(tmp, "bin");
const env = { ...process.env, DSH_PACKAGE: tarball, HOME: tmp };
const env = { ...cleanEnv, DSH_PACKAGE: tarball, HOME: tmp };
const install = (...args) => run("sh", [script, "--prefix", prefix, "--bin-dir", bin, ...args], { env });

const first = await install();
Expand Down
Loading