Skip to content

Commit

Permalink
Add hx list
Browse files Browse the repository at this point in the history
  • Loading branch information
kLabz committed Apr 21, 2024
1 parent 54e542d commit 1458f28
Show file tree
Hide file tree
Showing 5 changed files with 5 additions and 19 deletions.
1 change: 0 additions & 1 deletion extra/install-all.sh
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,6 @@ ROOT=$(dirname $(readlink -f $0))

sh "$ROOT/++haxe/install.sh"
sh "$ROOT/fzf/install.sh"
sh "$ROOT/list/install.sh"
sh "$ROOT/local/install.sh"
sh "$ROOT/make-haxe/install.sh"
sh "$ROOT/nightlies/install.sh"
Expand Down
12 changes: 0 additions & 12 deletions extra/list/install.sh

This file was deleted.

5 changes: 0 additions & 5 deletions extra/list/list-haxe-versions.sh

This file was deleted.

2 changes: 2 additions & 0 deletions src/HaxeManager.hx
Original file line number Diff line number Diff line change
Expand Up @@ -26,6 +26,8 @@ class HaxeManager {

Sys.println(Utils.getCurrentName().or("") + ' (' + Utils.getCurrent() + ')');

case ["list", []]: for (v in Utils.getVersions()) Sys.println(v);

case ["--help", []]: displayUsage();
case ["--help", ["download"]]: HaxeDownload.displayUsage();
case ["--help", ["select"]]: HaxeSelect.displayUsage();
Expand Down
4 changes: 3 additions & 1 deletion src/tools/Utils.hx
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
package tools;

import eval.luv.File;
import haxe.Utf8;
import haxe.io.Path;
import sys.FileSystem;
import sys.io.Process;
Expand Down Expand Up @@ -46,12 +47,13 @@ class Utils {
}
}

@:haxe.warning("-WDeprecated")
public static function getVersions():Array<String> {
if (!FileSystem.exists(versionsDir)) FileSystem.createDirectory(versionsDir);
if (!FileSystem.isDirectory(versionsDir)) throw '${FileSystem.absolutePath(versionsDir)} should be a directory';

final ret = FileSystem.readDirectory(versionsDir);
ret.sort((a,b) -> a > b ? -1 : 1);
ret.sort((a, b) -> Utf8.compare(b,a));
return ret;
}

Expand Down

0 comments on commit 1458f28

Please sign in to comment.