Skip to content

Commit

Permalink
fix: added check for creating .Leapp .aws directories if missing
Browse files Browse the repository at this point in the history
  • Loading branch information
urz9999 committed Nov 26, 2021
1 parent b075440 commit 25e720e
Show file tree
Hide file tree
Showing 2 changed files with 14 additions and 0 deletions.
3 changes: 3 additions & 0 deletions src/app/app.component.ts
Original file line number Diff line number Diff line change
Expand Up @@ -71,6 +71,9 @@ export class AppComponent implements OnInit {
// Prevent Dev Tool to show on production mode
this.app.blockDevToolInProductionMode();

// Create folders if missing
this.updaterService.createFoldersIfMissing();

// Before retrieving an actual copy of the workspace we
// check and in case apply, our retro compatibility service
if (this.retrocompatibilityService.isRetroPatchNecessary()) {
Expand Down
11 changes: 11 additions & 0 deletions src/app/services/updater.service.ts
Original file line number Diff line number Diff line change
Expand Up @@ -112,4 +112,15 @@ export class UpdaterService {
isReady() {
return (this.version !== undefined);
}

createFoldersIfMissing() {
try {
if(!this.electronService.fs.existsSync(this.electronService.os.homedir() + '/.Leapp/')) {
this.electronService.fs.mkdirSync(this.electronService.os.homedir() + '/.Leapp/');
}
if(!this.electronService.fs.existsSync(this.electronService.os.homedir() + '/.aws/')) {
this.electronService.fs.mkdirSync(this.electronService.os.homedir() + '/.aws/');
}
} catch(_) {}
}
}

0 comments on commit 25e720e

Please sign in to comment.