Explorar o código

chore: 增加类型

louhangfei %!s(int64=2) %!d(string=hai) anos
pai
achega
a653a7cf26
Modificáronse 2 ficheiros con 12 adicións e 1 borrados
  1. 11 0
      build/publish/config.ts
  2. 1 1
      build/publish/publish.ts

+ 11 - 0
build/publish/config.ts

@@ -4,3 +4,14 @@ export const config = {
   destFoler: 'skyeye-admin',
   reservedFiles: ['app.config.js'],
 };
+
+export interface Config {
+  host: string;
+  sourceFolder: string;
+  destFoler: string;
+  /**
+   * 一些配置文件,比如app.config.js,每个项目可能不同。所以每次打包部署的时候,不需要替换,用它原来的即可。
+   * 这个配置文件,每次备份之前先备份该文件,然后加压缩后再还原出来。
+   */
+  reservedFiles?: string[];
+}

+ 1 - 1
build/publish/publish.ts

@@ -42,7 +42,7 @@ const getPath = (dir: string) => {
 };
 
 const publish = async () => {
-  const tempDestZipPath = getPath('tempDest.zip');
+  const tempDestZipPath = getPath(config.destFoler + '.zip');
   console.log('destZipPath', tempDestZipPath);
   await zipFolder({
     sourceFolder: getPath(config.sourceFolder),