Skip to content

Commit

Permalink
isDirectory for symlinks isn't exactly safe..
Browse files Browse the repository at this point in the history
  • Loading branch information
kLabz committed Apr 19, 2024
1 parent 154ee18 commit 4605031
Show file tree
Hide file tree
Showing 3 changed files with 4 additions and 2 deletions.
Binary file modified build/download.hxb
Binary file not shown.
Binary file modified build/select.hxb
Binary file not shown.
6 changes: 4 additions & 2 deletions src/Utils.hx
Original file line number Diff line number Diff line change
Expand Up @@ -42,7 +42,8 @@ function getVersions():Array<String> {
// TODO: windows vs symlinks
function hasVersion(v:String):Bool {
final dir = Path.join([versionsDir, v]);
return FileSystem.isDirectory(dir);
return FileSystem.exists(dir);
// return FileSystem.isDirectory(dir);
}

function selectVersion(v:String, ?skipCheck:Bool = false):Void {
Expand All @@ -55,7 +56,8 @@ function selectVersion(v:String, ?skipCheck:Bool = false):Void {

function selectRelease(r:String):Void {
final dir = Path.join([releasesDir, r]);
if (!FileSystem.isDirectory(dir)) throw 'Version $r is not installed';
if (!FileSystem.exists(dir)) throw 'Version $r is not installed';
// if (!FileSystem.isDirectory(dir)) throw 'Version $r is not installed';

unlinkCurrent();
link(dir);
Expand Down

0 comments on commit 4605031

Please sign in to comment.