lucy-cli 0.7.5 → 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,8 +25,15 @@ 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
- fs.rm(join(moduleSettings.targetFolder, '.eslintrc.json'), { recursive: false });
29
- fs.writeFile(join(moduleSettings.targetFolder, 'lucy.json'), JSON.stringify(moduleSettings.settings, null, 2));
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")}`));
36
+ await fs.writeFile(join(moduleSettings.targetFolder, 'lucy.json'), JSON.stringify(moduleSettings.settings, null, 2));
30
37
  console.log(chalk.greenBright.underline('🐶 => Initialization done!'));
31
38
  }
32
39
  /**
package/package.json CHANGED
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "type": "module",
3
3
  "name": "lucy-cli",
4
- "version": "0.7.5",
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,8 +36,16 @@ export async function init(moduleSettings: ModuleSettings, projectSettings: Proj
36
36
 
37
37
  moduleSettings.settings.initialized = true;
38
38
 
39
- fs.rm(join(moduleSettings.targetFolder, '.eslintrc.json'), { recursive: false });
40
- fs.writeFile(join(moduleSettings.targetFolder, 'lucy.json'), JSON.stringify(moduleSettings.settings, null, 2));
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")}`));
48
+ await fs.writeFile(join(moduleSettings.targetFolder, 'lucy.json'), JSON.stringify(moduleSettings.settings, null, 2));
41
49
 
42
50
  console.log(chalk.greenBright.underline('🐶 => Initialization done!'));
43
51
  }