fix(fs.helpers.ts): ensure folder exists before cleaning up
This commit is contained in:
parent
14ee8a3493
commit
33ce277710
1 changed files with 2 additions and 2 deletions
|
@ -43,12 +43,12 @@ export const getSeed = () => {
|
|||
};
|
||||
|
||||
export const ensureAppFolder = (appName: string, cleanup = false) => {
|
||||
if (cleanup) {
|
||||
if (cleanup && fileExists(`/apps/${appName}`)) {
|
||||
deleteFolder(`/apps/${appName}`);
|
||||
}
|
||||
|
||||
if (!fileExists(`/apps/${appName}/docker-compose.yml`)) {
|
||||
deleteFolder(`/apps/${appName}`);
|
||||
if (fileExists(`/apps/${appName}`)) deleteFolder(`/apps/${appName}`);
|
||||
// Copy from apps repo
|
||||
fs.copySync(getAbsolutePath(`/repos/${config.APPS_REPO_ID}/apps/${appName}`), getAbsolutePath(`/apps/${appName}`));
|
||||
}
|
||||
|
|
Loading…
Add table
Reference in a new issue