Skip to content

Commit

Permalink
IDE: do not crash if Bela/projects doesn't exist.
Browse files Browse the repository at this point in the history
Closes #159.
  • Loading branch information
giuliomoro committed Jan 28, 2021
1 parent 2da8c4f commit 2bc806f
Show file tree
Hide file tree
Showing 2 changed files with 11 additions and 2 deletions.
8 changes: 7 additions & 1 deletion IDE/dist/main.js
Original file line number Diff line number Diff line change
Expand Up @@ -44,6 +44,7 @@ var file_manager = require("./FileManager");
var paths = require("./paths");
var routes = require("./RouteManager");
var path = require("path");
var fs = require("fs-extra-promise");
var globals = require("./globals");
var TerminalManager = require('./TerminalManager');
function init(args) {
Expand Down Expand Up @@ -80,10 +81,15 @@ function init(args) {
}
++n;
}
// ensure required folders exist
return [4 /*yield*/, fs.mkdirp(paths.projects)];
case 1:
// ensure required folders exist
_a.sent();
console.log('starting IDE from ' + paths.Bela);
return [4 /*yield*/, check_lockfile()
.catch(function (e) { return console.log('error checking lockfile', e); })];
case 1:
case 2:
_a.sent();
app = express();
server = new http.Server(app);
Expand Down
5 changes: 4 additions & 1 deletion IDE/src/main.ts
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@ import * as paths from './paths';
import * as util from './utils';
import * as routes from './RouteManager';
import * as path from 'path';
import * as fs from 'fs';
import * as fs from 'fs-extra-promise';
import * as globals from './globals';
var TerminalManager = require('./TerminalManager');

Expand Down Expand Up @@ -42,6 +42,9 @@ export async function init(args : Array<any>){
}
++n;
}

// ensure required folders exist
await fs.mkdirp(paths.projects);
console.log('starting IDE from ' + paths.Bela);

await check_lockfile()
Expand Down

0 comments on commit 2bc806f

Please sign in to comment.