lucy-cli 0.7.6 → 0.7.7

Sign up to get free protection for your applications and to get access to all the features.
package/dist/init.js CHANGED
@@ -25,9 +25,14 @@ export async function init(moduleSettings, projectSettings) {
25
25
  await editJson(join(moduleSettings.targetFolder, 'typedoc.json'), ['name'], [path.basename(moduleSettings.targetFolder)]);
26
26
  await gitInit(moduleSettings.targetFolder, moduleSettings.settings.modules);
27
27
  moduleSettings.settings.initialized = true;
28
- await fs.rm(join(moduleSettings.targetFolder, '.eslintrc.json'), { recursive: false }).catch(e => {
29
- console.log((`💩 ${red.underline.bold("=> Could not delete .eslintrc.json")}`));
30
- });
28
+ const eslintrcPath = join(moduleSettings.targetFolder, '.eslintrc.json');
29
+ if (existsSync(eslintrcPath)) {
30
+ console.log((`🐕 ${blue.underline.bold("=> Deleting .eslintrc.json")}`));
31
+ await fs.rm(join(eslintrcPath), { recursive: false }).catch(e => {
32
+ console.log((`💩 ${red.underline.bold("=> Could not delete .eslintrc.json ")} ${red.bold("=> ", e)}`));
33
+ });
34
+ }
35
+ console.log((`🐕 ${blue.underline.bold("=> Writing settings to lucy.json")}`));
31
36
  await fs.writeFile(join(moduleSettings.targetFolder, 'lucy.json'), JSON.stringify(moduleSettings.settings, null, 2));
32
37
  console.log(chalk.greenBright.underline('🐶 => Initialization done!'));
33
38
  }
package/package.json CHANGED
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "type": "module",
3
3
  "name": "lucy-cli",
4
- "version": "0.7.6",
4
+ "version": "0.7.7",
5
5
  "description": "Lucy Framework for WIX Studio Editor",
6
6
  "main": ".dist/index.js",
7
7
  "scripts": {
package/src/index.ts CHANGED
@@ -37,7 +37,7 @@ export type LucySettings = {
37
37
  scripts: {
38
38
  [commandName: string]: string;
39
39
  };
40
- };
40
+ };
41
41
 
42
42
  export type ModuleSettings = {
43
43
  packageRoot: string;
package/src/init.ts CHANGED
@@ -36,9 +36,15 @@ export async function init(moduleSettings: ModuleSettings, projectSettings: Proj
36
36
 
37
37
  moduleSettings.settings.initialized = true;
38
38
 
39
- await fs.rm(join(moduleSettings.targetFolder, '.eslintrc.json'), { recursive: false }).catch(e => {
40
- console.log((`💩 ${red.underline.bold("=> Could not delete .eslintrc.json")}`));
41
- });
39
+ const eslintrcPath = join(moduleSettings.targetFolder, '.eslintrc.json');
40
+ if(existsSync(eslintrcPath)) {
41
+ console.log((`🐕 ${blue.underline.bold("=> Deleting .eslintrc.json")}`));
42
+ await fs.rm(join(eslintrcPath), { recursive: false }).catch(e => {
43
+ console.log((`💩 ${red.underline.bold("=> Could not delete .eslintrc.json ")} ${red.bold("=> ", e)}`));
44
+ });
45
+ }
46
+
47
+ console.log((`🐕 ${blue.underline.bold("=> Writing settings to lucy.json")}`));
42
48
  await fs.writeFile(join(moduleSettings.targetFolder, 'lucy.json'), JSON.stringify(moduleSettings.settings, null, 2));
43
49
 
44
50
  console.log(chalk.greenBright.underline('🐶 => Initialization done!'));