Skip to content

Commit 25e720e

Browse files
committed
fix: added check for creating .Leapp .aws directories if missing
1 parent b075440 commit 25e720e

File tree

2 files changed

+14
-0
lines changed

2 files changed

+14
-0
lines changed

src/app/app.component.ts

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -71,6 +71,9 @@ export class AppComponent implements OnInit {
7171
// Prevent Dev Tool to show on production mode
7272
this.app.blockDevToolInProductionMode();
7373

74+
// Create folders if missing
75+
this.updaterService.createFoldersIfMissing();
76+
7477
// Before retrieving an actual copy of the workspace we
7578
// check and in case apply, our retro compatibility service
7679
if (this.retrocompatibilityService.isRetroPatchNecessary()) {

src/app/services/updater.service.ts

Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -112,4 +112,15 @@ export class UpdaterService {
112112
isReady() {
113113
return (this.version !== undefined);
114114
}
115+
116+
createFoldersIfMissing() {
117+
try {
118+
if(!this.electronService.fs.existsSync(this.electronService.os.homedir() + '/.Leapp/')) {
119+
this.electronService.fs.mkdirSync(this.electronService.os.homedir() + '/.Leapp/');
120+
}
121+
if(!this.electronService.fs.existsSync(this.electronService.os.homedir() + '/.aws/')) {
122+
this.electronService.fs.mkdirSync(this.electronService.os.homedir() + '/.aws/');
123+
}
124+
} catch(_) {}
125+
}
115126
}

0 commit comments

Comments
 (0)