소스 검색

fix: delete .gitkeep files after copying data folder

Nicolas Meienberger 1 년 전
부모
커밋
93282a051e
1개의 변경된 파일7개의 추가작업 그리고 0개의 파일을 삭제
  1. 7 0
      packages/cli/src/executors/app/app.helpers.ts

+ 7 - 0
packages/cli/src/executors/app/app.helpers.ts

@@ -2,10 +2,14 @@ import crypto from 'crypto';
 import fs from 'fs';
 import path from 'path';
 import { appInfoSchema, envMapToString, envStringToMap } from '@runtipi/shared';
+import { exec } from 'child_process';
+import { promisify } from 'util';
 import { getEnv } from '@/utils/environment/environment';
 import { generateVapidKeys, getAppEnvMap } from './env.helpers';
 import { pathExists } from '@/utils/fs-helpers';
 
+const execAsync = promisify(exec);
+
 /**
  *  This function generates a random string of the provided length by using the SHA-256 hash algorithm.
  *  It takes the provided name and a seed value, concatenates them, and uses them as input for the hash algorithm.
@@ -186,4 +190,7 @@ export const copyDataDir = async (id: string) => {
       }
     }),
   );
+
+  // Remove any .gitkeep files from the app-data folder at any level
+  await execAsync(`find ${storagePath}/app-data/${id}/data -name .gitkeep -delete`);
 };