UNPKG

create-chrome-plugin

Version:

Chrome Extension Boilerplate with React 18, TypeScript and Webpack 5

28 lines (19 loc) 758 B
#!/usr/bin/env node const { execSync } = require('child_process'); const run = cmd => { try { execSync(`${cmd}`, { stdio: 'inherit' }); } catch (error) { console.error(`Unable to execute the command - ${cmd}`, error); return false; } return true; } const projectName = process.args[2]; const checkoutCmd = `git clone --depth 1 https://github.com/harshalslimaye/create-chrome-plugin.git ${projectName}`; const installDepsCmd = `cd ${projectName} && npm install`; console.log(`Cloning the repository with name ${projectName}`); const checkoutComplete = run(checkoutCmd); if (!checkoutComplete) process.exit(-1); console.log("Installing Dependencies..."); const installDepsComplete = run(installDepsCmd);