|
1 | 1 | import { execSync } from 'child_process'; |
2 | 2 | import { packageManagerInstallChoices } from 'const/packagesMng.ts'; |
3 | 3 | import fs from 'fs'; |
| 4 | +import checkIsMonorepo from 'lib/check-is-monorepo.js'; |
4 | 5 | import detectPackageManager from 'lib/detect-package-manger.ts'; |
5 | 6 | import getSettingFilePath from 'lib/get-setting-file-path.ts'; |
6 | 7 | import path from 'path'; |
@@ -32,7 +33,7 @@ const installImportSortDependencies = async (): Promise<void> => { |
32 | 33 | } |
33 | 34 | } |
34 | 35 | const installCommand = `${packageMng} ${dependencies}`; |
35 | | - execSync(`${installCommand} -D`, { stdio: 'inherit' }); |
| 36 | + execSync(`${installCommand} -D ${checkIsMonorepo() ? '-w' : ''}`, { stdio: 'inherit' }); |
36 | 37 | } catch (error) { |
37 | 38 | console.error('🥲 🥲 🥲 Failed to install dependencies...'); |
38 | 39 | process.exit(1); |
@@ -65,7 +66,7 @@ const installAirbnbDependencies = async (): Promise<void> => { |
65 | 66 | } |
66 | 67 | } |
67 | 68 | const installCommand = `${packageMng} ${dependencies}`; |
68 | | - execSync(`${installCommand} -D`, { stdio: 'inherit' }); |
| 69 | + execSync(`${installCommand} -D ${checkIsMonorepo() ? '-w' : ''}`, { stdio: 'inherit' }); |
69 | 70 | } catch (error) { |
70 | 71 | console.error('🥲 🥲 🥲 Failed to install dependencies...'); |
71 | 72 | process.exit(1); |
@@ -97,7 +98,7 @@ const installGoogleDependencies = async (): Promise<void> => { |
97 | 98 | } |
98 | 99 | } |
99 | 100 | const installCommand = `${packageMng} ${dependencies}`; |
100 | | - execSync(`${installCommand} -D`, { stdio: 'inherit' }); |
| 101 | + execSync(`${installCommand} -D ${checkIsMonorepo() ? '-w' : ''}`, { stdio: 'inherit' }); |
101 | 102 | } catch (error) { |
102 | 103 | console.error('🥲 🥲 🥲 Failed to install dependencies...'); |
103 | 104 | process.exit(1); |
@@ -129,7 +130,7 @@ const installXODependencies = async (): Promise<void> => { |
129 | 130 | } |
130 | 131 | } |
131 | 132 | const installCommand = `${packageMng} ${dependencies}`; |
132 | | - execSync(`${installCommand} -D`, { stdio: 'inherit' }); |
| 133 | + execSync(`${installCommand} -D ${checkIsMonorepo() ? '-w' : ''}`, { stdio: 'inherit' }); |
133 | 134 | } catch (error) { |
134 | 135 | console.error('🥲 🥲 🥲 Failed to install dependencies...'); |
135 | 136 | process.exit(1); |
|
0 commit comments