Skip to content

Instantly share code, notes, and snippets.

Created June 2, 2018 19:51
What would you like to do?
stencil-cli start-app.js
// Command for starting a new stencil starter app, example 'stencil start-app my-app'
if (process.argv[2] === 'start-app') {
if (!shell.which('git')) {
shell.echo('Sorry, this script requires git');
var projectName = process.argv[3];
if (!projectName) {
shell.echo('Please state the project name after the "start-app" command.');
shell.exec('git clone ' + projectName);;
shell.echo('Running: git remote rm origin');
shell.exec('git remote rm origin');
shell.echo('Updating npm package names to ' + projectName + '.');'package*.json').forEach(function (file) {
shell.sed('-i', '@stencil/starter', projectName, file);
shell.echo('Running: npm install');
shell.exec('npm install');
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment