@corva/create-app 0.45.0-2 → 0.45.0-4

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -155,7 +155,7 @@ const resolveDataForZipNodeJsApp = async (itemsToZip = [], { options, pkg, dirNa
155
155
  const packageDirContent = await fs.readdir(dirName);
156
156
  const shouldPushDefaultSrc = !itemsToZip.length;
157
157
 
158
- itemsToZip.push('config', 'manifest.json', 'package.json', '.nvmrc', '.npmrc');
158
+ itemsToZip.push('config', 'manifest.json', 'package.json', '.nvmrc', '.npmrc', '.eslintrc.js');
159
159
 
160
160
  if (packageDirContent.includes('package-lock.json')) {
161
161
  itemsToZip.push('package-lock.json');
package/lib/main.js CHANGED
@@ -347,11 +347,26 @@ async function initPackage(projectName, opts) {
347
347
 
348
348
  logger.log(`Creating a new Corva app in ${chalk.green(root)}.`);
349
349
 
350
- if (fs.existsSync(root)) {
351
- throw new Error(`Directory already exists: ${root}`);
350
+ await fs.ensureDir(root);
351
+
352
+ if ((await fs.readdir(root)).length) {
353
+ const shouldCleanup = await inquirer
354
+ .prompt([
355
+ {
356
+ message: `Directory "${root}" is not empty. Clean it to proceed?`,
357
+ name: 'cleanup',
358
+ type: 'confirm',
359
+ },
360
+ ])
361
+ .then(_.get('cleanup'));
362
+
363
+ if (shouldCleanup) {
364
+ await fs.emptyDir(root);
365
+ } else {
366
+ throw new Error(`Directory is not empty: ${root}`);
367
+ }
352
368
  }
353
369
 
354
- await fs.mkdir(root);
355
370
  await fs.writeJSON(path.join(root, 'manifest.json'), manifest.manifest, writejsonOptions);
356
371
 
357
372
  await addTemplate(root, manifest, runtime);
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@corva/create-app",
3
- "version": "0.45.0-2",
3
+ "version": "0.45.0-4",
4
4
  "private": false,
5
5
  "description": "Create an app to use it in CORVA.AI",
6
6
  "keywords": [
@@ -1 +0,0 @@
1
- module.exports = { extends: '@corva/eslint-config-node' };
@@ -1 +0,0 @@
1
- "@corva/eslint-config-node/prettier"
@@ -1 +0,0 @@
1
- module.exports = { extends: '@corva/eslint-config-node' };
@@ -1 +0,0 @@
1
- "@corva/eslint-config-node/prettier"
@@ -1 +0,0 @@
1
- "@corva/eslint-config-node/prettier"
@@ -1 +0,0 @@
1
- "@corva/eslint-config-node/prettier"
@@ -1 +0,0 @@
1
- "@corva/eslint-config-node/prettier"