Skip to content

Commit

Permalink
IDE: Symlinks to folders are considered folders.
Browse files Browse the repository at this point in the history
Closes #568.
  • Loading branch information
giuliomoro committed Oct 19, 2019
1 parent de2c63d commit 93342d6
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 2 deletions.
2 changes: 1 addition & 1 deletion IDE/dist/FileManager.js
Expand Up @@ -403,7 +403,7 @@ function directory_exists(dir_path) {
var stat;
return __generator(this, function (_a) {
switch (_a.label) {
case 0: return [4 /*yield*/, stat_file(dir_path)
case 0: return [4 /*yield*/, stat_file(dir_path + "/")
.catch(function (e) { })];
case 1:
stat = _a.sent();
Expand Down
3 changes: 2 additions & 1 deletion IDE/src/FileManager.ts
Expand Up @@ -168,7 +168,8 @@ export async function write_json(file_path: string, data: any): Promise<void> {
return write_file(file_path, JSON.stringify(data));
}
export async function directory_exists(dir_path: string): Promise<boolean>{
let stat: any = await stat_file(dir_path)
// the "/" ensure return stat.isDirectory() is "true" for symlinks to directories
let stat: any = await stat_file(dir_path+"/")
.catch( e => {} );
return (stat && stat.isDirectory && stat.isDirectory()) ? true : false;
}
Expand Down

0 comments on commit 93342d6

Please sign in to comment.