MCPcopy Create free account
hub / github.com/SethGammon/Citadel / withTempProject

Function withTempProject

scripts/test-sandbox-provider.js:16–23  ·  view source on GitHub ↗
(run)

Source from the content-addressed store, hash-verified

14} = require('../core/sandbox/providers');
15
16async function withTempProject(run) {
17 const dir = fs.mkdtempSync(path.join(os.tmpdir(), 'citadel-sandbox-'));
18 try {
19 await run(dir);
20 } finally {
21 fs.rmSync(dir, { recursive: true, force: true });
22 }
23}
24
25withTempProject(async (projectRoot) => {
26 fs.writeFileSync(path.join(projectRoot, 'package.json'), JSON.stringify({ scripts: { test: 'node test.js' } }), 'utf8');

Callers 1

Calls 1

runFunction · 0.70

Tested by

no test coverage detected