Files
scriptc/tests/corpus/fs-remove-readonly.ts
Chris Tate ee9f0d64eb feat: ship the self-hosted native scriptc CLI (#585)
* feat: ship the self-hosted native scriptc CLI

- Run the shared compiler and CLI natively, including library builds and compile-time evaluation.
- Install native platform packages and ship relocatable standalone distributions.
- Preserve program semantics and reuse validated build artifacts for fast rebuilds.

* fix: complete native CLI integration and validation

- Preserve library diagnostics and run recursive compiler work on the main stack.
- Restore packaged helper permissions and exercise native npm and Wasm library builds.
- Recover interrupted Sandbox status probes within the original command deadline.
2026-09-30 02:17:56 -05:00

19 lines
770 B
TypeScript

import { chmodSync, existsSync, mkdirSync, mkdtempSync, rmSync, writeFileSync } from "node:fs";
import { tmpdir } from "node:os";
import { join } from "node:path";
const root = mkdtempSync(join(tmpdir(), "scriptc-readonly-rm-"));
try {
const file = join(root, "readonly.txt");
writeFileSync(file, "keep until removed");
chmodSync(file, 0o400);
rmSync(file);
console.log(existsSync(file));
const nested = join(root, "tree", "nested");
mkdirSync(nested, { recursive: true });
writeFileSync(join(nested, "payload"), "read-only payload");
chmodSync(join(nested, "payload"), 0o400);
rmSync(join(root, "tree"), { recursive: true, force: true });
console.log(existsSync(join(root, "tree")));
} finally { rmSync(root, { recursive: true, force: true }); }