create-react-bs-starter
v0.7.0
Published
create react bs starter
Downloads
2
Readme
create react bs starter
#!/usr/bin/env node const { execSync } = require('child_process');
const runCommand = (command) => {
try {
execSync(command, { stdio: 'inherit' });
return true;
} catch (error) {
console.error(Failed to execute ${command}
, error);
return false;
}
};
if (process.argv.length !== 3) { console.error('Please provide a repository name as an argument.'); process.exit(-1); }
const repoName = process.argv[2];
const gitCloneCommand = git clone --depth 1 https://github.com/Risad212/react-bs-starter ${repoName}
;
const installDepsCommand = cd ${repoName} && npm install
;
console.log(Cloning the repository with the name ${repoName}
);
const cloned = runCommand(gitCloneCommand);
if (!cloned) process.exit(-1);
console.log(Installing dependencies for ${repoName}
);
const installedDeps = runCommand(installDepsCommand);
if (!installedDeps) process.exit(-1);
console.log("Congratulations! You're ready. Follow these commands to start:");
console.log(cd ${repoName}
);
console.log(npm start
);