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'); | |
shell.exit(1); | |
} | |
var projectName = process.argv[3]; | |
if (!projectName) { | |
shell.echo('Please state the project name after the "start-app" command.'); | |
shell.exit(1); | |
} | |
shell.exec('git clone https://github.com/ionic-team/stencil-app-starter ' + projectName); | |
shell.cd(projectName); | |
shell.echo('Running: git remote rm origin'); | |
shell.exec('git remote rm origin'); | |
shell.echo('Updating npm package names to ' + projectName + '.'); | |
shell.ls('package*.json').forEach(function (file) { | |
shell.sed('-i', '@stencil/starter', projectName, file); | |
}); | |
shell.echo('Running: npm install'); | |
shell.exec('npm install'); | |
shell.exit(0); | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment