@frctl/cli-command-new-project
Advanced tools
Comparing version 2.0.0-beta.1 to 2.0.0-beta.2
{ | ||
"name": "@frctl/cli-command-new-project", | ||
"description": "Create a new starter project via the Fractal CLI", | ||
"version": "2.0.0-beta.1", | ||
"version": "2.0.0-beta.2", | ||
"homepage": "http://fractal.build", | ||
@@ -6,0 +6,0 @@ "repository": "https://github.com/frctl/fractal/tree/v2/packages/cli-command-new-project", |
@@ -18,8 +18,15 @@ const {join} = require('path'); | ||
async handler(argv, app, cli) { | ||
async handler(argv, app, cli, {log}) { | ||
process.on('SIGINT', () => { | ||
shell.exit(0); | ||
}); | ||
if (!shell.which('git')) { | ||
shell.echo('The Fractal new project command requires Git to be installed on your machine'); | ||
log('The Fractal new project command requires Git to be installed on your machine'); | ||
shell.exit(1); | ||
} | ||
log('Creating directory...'); | ||
const dirPath = join(cli.cwd, argv.directoryPath); | ||
@@ -32,2 +39,4 @@ const tildeDir = tildify(dirPath); | ||
log('Cloning git repo...'); | ||
const git = simpleGit(cli.cwd); | ||
@@ -41,2 +50,4 @@ | ||
log('Installing NPM dependencies...'); | ||
shell.cd(argv.directoryPath); | ||
@@ -50,4 +61,5 @@ const result = shell.exec(`npm install --only=prod`); | ||
await fs.removeSync(join(dirPath, '.git')); | ||
shell.exec('git init'); | ||
} catch (err) { | ||
throw new Error(`Failed to delete git repo information [${err.message}]`); | ||
throw new Error(`Failed to reset git repo information [${err.message}]`); | ||
} | ||
@@ -54,0 +66,0 @@ |
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
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
2937
59