UNPKG

530 BPlain TextView Raw
1#!/usr/bin/env node
2import fs from 'fs-extra';
3import { execSync } from 'child_process';
4
5const [, , ...args] = process.argv;
6
7async function main() {
8 if (args[0] === 'init') {
9 const dir = process.cwd();
10 await fs.copy(__dirname + '/../template/', dir);
11 await fs.rename(dir + '/_tsconfig.json', dir + '/tsconfig.json');
12 execSync('npm install');
13 // execSync('npm link back-base');
14 try {
15 execSync('git init');
16 execSync('git add .');
17 } catch (e) {}
18 }
19}
20main().catch(err => console.error(err));