-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathplay
executable file
·24 lines (18 loc) · 1008 Bytes
/
play
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
#!/usr/bin/env node
const chalk = require('chalk');
const path = require('path');
const {spawnSync} = require('child_process');
const userArgs = process.argv.slice(2);
const playgroundDir = path.join(__dirname, 'playground');
// Change the process directory to the Playground
process.chdir(playgroundDir);
// Echo the fact that we're going to build @sfdx-falcon/playground
console.log(chalk`{yellow \nAttempting to build @sfdx-falcon/playground...\n}`);
// Build the Playground package, which should force a build of ALL monorepo packages.
spawnSync('yarn build', {shell: true, stdio: 'inherit'});
// Echo the command we're about to run.
console.log(chalk`{yellow \nAttempting to run ${userArgs[0]}...\n}`);
// Execute the command using the OCLIF command runner.
spawnSync('./bin/run', userArgs, {shell: false, stdio: 'inherit'});
// Echo the fact that command execution is complete.
console.log(chalk`{yellow \nExecution of ${userArgs[0]} is complete\n}`);