cmyr-template-cli 1.13.1 → 1.13.2

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.
package/dist/index.js CHANGED
@@ -13,7 +13,7 @@ var path__default = /*#__PURE__*/_interopDefaultLegacy(path);
13
13
 
14
14
  const program = new commander.Command('ct')
15
15
  .description('草梅项目创建器');
16
- program.version("1.13.0" , '-v, --version');
16
+ program.version("1.13.1" , '-v, --version');
17
17
  const args = process.argv.slice(2);
18
18
  if (args.length === 0) {
19
19
  args.push('create');
package/dist/plopfile.js CHANGED
@@ -174,17 +174,7 @@ async function init(projectPath, answers) {
174
174
  await asyncExec('git add .', {
175
175
  cwd: projectPath,
176
176
  });
177
- const loading = ora__default["default"]('正在安装依赖……').start();
178
- try {
179
- await asyncExec(`${PACKAGE_MANAGER} i`, {
180
- cwd: projectPath,
181
- });
182
- loading.succeed('依赖安装成功!');
183
- }
184
- catch (error) {
185
- console.error(error);
186
- loading.fail('依赖安装失败!');
187
- }
177
+ await installNpmPackages(projectPath);
188
178
  await asyncExec('git add .', {
189
179
  cwd: projectPath,
190
180
  });
@@ -208,6 +198,21 @@ async function getGitUserName() {
208
198
  const username = (await asyncExec('git config user.name')) || '';
209
199
  return username.trim();
210
200
  }
201
+ async function installNpmPackages(projectPath) {
202
+ const loading = ora__default["default"]('正在安装依赖……').start();
203
+ try {
204
+ const files = ['.npmrc'];
205
+ await copyFilesFromTemplates(projectPath, files);
206
+ await asyncExec(`${PACKAGE_MANAGER} i`, {
207
+ cwd: projectPath,
208
+ });
209
+ loading.succeed('依赖安装成功!');
210
+ }
211
+ catch (error) {
212
+ console.error(error);
213
+ loading.fail('依赖安装失败!');
214
+ }
215
+ }
211
216
  async function initDependabot(projectPath, answers) {
212
217
  try {
213
218
  const { isOpenSource, isRemoveDependabot } = answers;
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "cmyr-template-cli",
3
- "version": "1.13.1",
3
+ "version": "1.13.2",
4
4
  "description": "草梅友仁自制的项目模板创建器",
5
5
  "author": "CaoMeiYouRen",
6
6
  "license": "MIT",