Created
February 10, 2023 17:44
-
-
Save rmdashrfv/363fa4c8535820ae9c98d5ac3d3a1fa4 to your computer and use it in GitHub Desktop.
Code Challenge script
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| const { exec } = require('child_process') | |
| const fs = require('fs') | |
| if (process.argv.length < 3) { | |
| console.log('File must be run as "node start.js your-name" (e.g., "node start.js ada-lovelace"') | |
| return; | |
| } | |
| let concatName = process.argv[2] | |
| fs.writeFileSync('bin/config', concatName, (err) => err && console.log('Error occurred when writing file:', err)) | |
| exec('git clone code-challenge.bundle') | |
| exec(`cd code-challenge.bundle && git checkout -b ${concatName}`) | |
| exec('cd code-challenge && git commit --allow-empty -m "Initial commit"') | |
| console.log('Removing code-challenge.bundle') | |
| exec('rm code-challenge.bundle') |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment