aeboilerplate
Advanced tools
Comparing version 0.0.1 to 0.0.2
62
cli.js
@@ -5,2 +5,3 @@ #!/usr/bin/env node | ||
const shell = require('shelljs') | ||
const colors = require('colors') | ||
@@ -11,33 +12,46 @@ program | ||
.action(function(projectName) { | ||
console.log('Creating project: ', projectName) | ||
logStep(`Preparing AEboilerplate full-stack project: ${projectName}`) | ||
cloneAeboilerplateProject(projectName) | ||
executeAeboilerplate(projectName) | ||
}) | ||
.version('0.0.1', '-v, --version') | ||
.parse(process.argv) | ||
let gitUrl | ||
if (typeof argumentProjectName === 'undefined') { | ||
console.error('Please specify the project name:\n') | ||
console.error('aeboilerplate'.cyan, '<project-name> [--https]'.yellow) | ||
console.error('\nFor example:\n') | ||
console.error('aeboilerplate'.cyan, 'my-full-stack-app'.yellow) | ||
console.error('\n<project-name> is the name of the project that you would like to create using AEboilerplate.') | ||
console.error('[--https] to use https instead of ssh to clone from github.') | ||
process.exit(1) | ||
} | ||
if (program.https) { | ||
gitUrl = 'https://github.com/agencyenterprise/aeboilerplate.git' | ||
} else { | ||
gitUrl = 'git@github.com:agencyenterprise/aeboilerplate.git' | ||
} | ||
function logStep(message) { | ||
console.log(`${message}\n`.cyan) | ||
} | ||
// Needed by commander to set a global variable to check for an empty argument | ||
argumentProjectName = projectName | ||
function cloneAeboilerplateProject(projectName) { | ||
let gitUrl | ||
if (shell.exec(`git clone ${gitUrl} ${projectName}`).code !== 0) { | ||
console.log(`Error! Git clone failed for URL: ${gitUrl}`) | ||
process.exit(1) | ||
} | ||
if (program.https) { | ||
gitUrl = 'https://github.com/agencyenterprise/aeboilerplate.git' | ||
} else { | ||
gitUrl = 'git@github.com:agencyenterprise/aeboilerplate.git' | ||
} | ||
shell.cd(projectName) | ||
shell.exec(`npm run aeboilerplate`) | ||
}) | ||
// Needed by commander to set a global variable to check for an empty argument | ||
argumentProjectName = projectName | ||
.version('0.0.1', '-v, --version') | ||
.parse(process.argv) | ||
logStep(`Cloning ${gitUrl}`) | ||
if (shell.exec(`git clone ${gitUrl} ${projectName}`).code !== 0) { | ||
console.log(`Error! Git clone failed for URL: ${gitUrl}\n`.red) | ||
process.exit(1) | ||
} | ||
} | ||
if (typeof argumentProjectName === 'undefined') { | ||
console.error('\nError: Project name was not specified.') | ||
console.log('Try: aeboilerplate <projectName> [-ssh]') | ||
console.log('Where <projectName> is the name of the project that you would like to initiate using AEboilerplate.') | ||
console.log(' --https Use https instead of ssh to clone from github.') | ||
process.exit(1) | ||
function executeAeboilerplate(projectName) { | ||
logStep(`\nExecuting AEboilerplate generator`) | ||
shell.cd(projectName) | ||
shell.exec(`npm run aeboilerplate`) | ||
} |
{ | ||
"name": "aeboilerplate", | ||
"version": "0.0.1", | ||
"version": "0.0.2", | ||
"description": "Global scripts to create new full-stack projects using aeboilerplate", | ||
@@ -20,2 +20,3 @@ "main": "index.js", | ||
"dependencies": { | ||
"colors": "^1.3.2", | ||
"commander": "^2.19.0", | ||
@@ -22,0 +23,0 @@ "shelljs": "^0.8.3" |
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
New author
Supply chain riskA new npm collaborator published a version of the package for the first time. New collaborators are usually benign additions to a project, but do indicate a change to the security surface area of a package.
Found 1 instance in 1 package
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
3573
46
3
1
+ Addedcolors@^1.3.2
+ Addedcolors@1.4.0(transitive)