UNPKG

create-custom-divi-extension

Version:

This project was bootstrapped with [Create Divi Extension](https://github.com/elegantthemes/create-divi-extension).

30 lines (21 loc) 881 B
#!/usr/bin/env node const { execSync } = require('child_process'); const runCommand = command => { try { execSync(`${command}`, { stdio: 'inherit' }); } catch (e) { console.error(`Failed to execute ${command}`, e); return false; } return true; } const repoName = process.argv[2]; const gitCheckoutCommand = `git clone --depth 1 https://github.com/YasithaRanga/create-custom-divi-extension ${repoName}`; const installDepsCommand = `cd ${repoName} && npm install`; console.log(`Cloning the repository with name ${repoName}`); const checkedOut = runCommand(gitCheckoutCommand); if (!checkedOut) process.exit(-1); console.log(`Installing dependencies for ${repoName}`); const installedDeps = runCommand(installDepsCommand); if (!installedDeps) process.exit(-1); console.log(`All good to go. Start by running cd ${repoName}, npm start`);