@seayoo-web/scripts 1.3.11 → 1.3.12

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/node.js CHANGED
@@ -122,6 +122,14 @@ async function initSampleFiles(targetDir) {
122
122
  }
123
123
  }
124
124
  }
125
+ async function copyGlobalFiles(targetDir) {
126
+ for (const filename of [".env.local"]) {
127
+ if (await fs.pathExists(path.join(targetDir, filename))) {
128
+ await fs.copy(path.join(targetDir, filename), path.join(targetDir, filename.replace(/\.sample$/, "")));
129
+ fs.unlink(path.join(targetDir, filename));
130
+ }
131
+ }
132
+ }
125
133
  async function startCreateJob$1(target) {
126
134
  if (target === "project") {
127
135
  await createProject();
@@ -159,6 +167,8 @@ async function createRepo() {
159
167
  await copyTemplate(answers.template, targetDir);
160
168
  spinner.text = "更新 package.json...";
161
169
  await updatePackageFiles(targetDir, answers);
170
+ spinner.text = "复制全局文件...";
171
+ await copyGlobalFiles(targetDir);
162
172
  spinner.succeed("仓库创建成功!".green);
163
173
  console.log("\n接下来你可以:");
164
174
  console.log(`cd ${answers.project}/${answers.repoName}`.cyan);
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@seayoo-web/scripts",
3
- "version": "1.3.11",
3
+ "version": "1.3.12",
4
4
  "description": "scripts for seayoo web repos",
5
5
  "type": "module",
6
6
  "source": "index.ts",
@@ -31,6 +31,10 @@ export declare function getProjectName(project: string): Promise<string>;
31
31
  * 复制模板到目标目录
32
32
  */
33
33
  export declare function copyTemplate(templateName: string, targetDir: string): Promise<void>;
34
+ /**
35
+ * 复制全局文件
36
+ */
37
+ export declare function copyGlobalFiles(targetDir: string): Promise<void>;
34
38
  /**
35
39
  * 更新 workspace.yaml
36
40
  */