feat(cli): add site cli to run scripts + handle media
This commit is contained in:
parent
5055816f68
commit
d08787f5aa
12 changed files with 1615 additions and 26 deletions
23
cli/bin/index.js
Executable file
23
cli/bin/index.js
Executable file
|
@ -0,0 +1,23 @@
|
|||
#!/usr/bin/env node
|
||||
|
||||
import { program } from 'commander';
|
||||
import chalk from 'chalk';
|
||||
import figlet from 'figlet';
|
||||
import { initConfig, loadConfig } from '../lib/config.js';
|
||||
import { downloadAsset } from '../lib/download.js';
|
||||
import { runRootScript } from '../lib/runScript.js';
|
||||
|
||||
program.name('coryd').description('🪄 Run commands, download things and have fun.').version('1.0.0');
|
||||
program.command('init').description('Initialize CLI and populate required config.').action(initConfig);
|
||||
program.command('run [script]').description('Run site scripts and commands.').action(runRootScript);
|
||||
program.command('download').description('Download, name and store image assets.').action(downloadAsset);
|
||||
|
||||
if (process.argv.length <= 2) {
|
||||
const ascii = figlet.textSync('coryd.dev', { horizontalLayout: 'default' });
|
||||
console.log(chalk.hex('#3364ff')(ascii));
|
||||
console.log();
|
||||
program.outputHelp();
|
||||
process.exit(0);
|
||||
}
|
||||
|
||||
program.parse(process.argv);
|
Loading…
Add table
Add a link
Reference in a new issue