mirror of
https://github.com/zenstackhq/zenstack
synced 2026-05-24 10:08:55 +00:00
Co-authored-by: Augustin <43639468+Azzerty23@users.noreply.github.com> Co-authored-by: Jonathan Stevens <jonathan.stevens@resnovas.com> Co-authored-by: Jonathan S <jonathan.stevens@eventiva.co.uk> Co-authored-by: coderabbitai[bot] <136622811+coderabbitai[bot]@users.noreply.github.com> Co-authored-by: github-actions[bot] <41898282+github-actions[bot]@users.noreply.github.com> Co-authored-by: ErikMCM <70036542+ErikMCM@users.noreply.github.com> Co-authored-by: Jason Kleinberg <ustice@gmail.com> Co-authored-by: Jonathan S <punk.gift9475@alias.org.uk> Co-authored-by: Jiasheng <jiashengguo@outlook.com>
24 lines
739 B
TypeScript
24 lines
739 B
TypeScript
import path from 'path';
|
|
import fs from 'fs';
|
|
import { execSync } from 'child_process';
|
|
|
|
const scaffoldPath = path.join(__dirname, '../.test/scaffold');
|
|
if (fs.existsSync(scaffoldPath)) {
|
|
fs.rmSync(scaffoldPath, { recursive: true, force: true });
|
|
}
|
|
fs.mkdirSync(scaffoldPath, { recursive: true });
|
|
|
|
function run(cmd: string) {
|
|
console.log(`Running: ${cmd}, in ${scaffoldPath}`);
|
|
try {
|
|
execSync(cmd, { cwd: scaffoldPath, stdio: 'ignore' });
|
|
} catch (err) {
|
|
console.error(`Test project scaffolding cmd error: ${err}`);
|
|
throw err;
|
|
}
|
|
}
|
|
|
|
run('npm init -y');
|
|
run('npm i --no-audit --no-fund typescript prisma @prisma/client zod decimal.js @types/node');
|
|
|
|
console.log('Test scaffold setup complete.');
|