forked from AztecProtocol/noir-starter
-
Notifications
You must be signed in to change notification settings - Fork 0
/
npx.js
executable file
·39 lines (32 loc) · 894 Bytes
/
npx.js
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
#!/usr/bin/env node
import { Command } from 'commander';
import select from '@inquirer/select';
import input from '@inquirer/input';
const program = new Command();
import tiged from 'tiged';
program.action(async () => {
const appType = await select({
message: 'Please choose an option:',
choices: [
{ value: 'vite-hardhat', name: 'Browser App using Vite' },
{ value: 'with-foundry', name: 'Solidity App using Foundry' },
],
});
console.log(`You chose: ${appType}`);
const appName = await input({
message: 'Your app name:',
default: 'my-noir-app',
});
const emitter = tiged(`noir-lang/noir-starter/${appType}`, {
disableCache: true,
force: true,
verbose: true,
});
emitter.on('info', info => {
console.log(info.message);
});
emitter.clone(`./${appName}`).then(() => {
console.log('done');
});
});
program.parse();