diff --git a/run.n b/run.n index 170f3b60..ba6cb562 100644 Binary files a/run.n and b/run.n differ diff --git a/src/haxelib/api/Scope.hx b/src/haxelib/api/Scope.hx index 9b50076b..066f917f 100644 --- a/src/haxelib/api/Scope.hx +++ b/src/haxelib/api/Scope.hx @@ -61,8 +61,8 @@ abstract class Scope { final overrides:LockFormat; function new(isLocal:Bool, repository:Repository) { - this.isLocal = isLocal; this.repository = repository; + this.isLocal = isLocal; overrides = loadOverrides(); } diff --git a/src/haxelib/client/Main.hx b/src/haxelib/client/Main.hx index fc438511..db6e6b44 100644 --- a/src/haxelib/client/Main.hx +++ b/src/haxelib/client/Main.hx @@ -553,21 +553,35 @@ class Main { // sort projects alphabetically libraryInfo.sort(function(a, b) return Reflect.compare(a.name.toLowerCase(), b.name.toLowerCase())); - + + // we want to print in one batch, rather than one cli print for each line + var listStr = ''; + + if (scope.repository.path != RepoManager.suggestGlobalPath()) + Cli.printOptional('Local Haxelib Repository at: ${scope.repository.path}'); + else + Cli.printOptional('Global Haxelib at: ${scope.repository.path}'); + for (library in libraryInfo) { - var line = '${library.name}:'; + listStr += '${library.name}:'; for (version in library.versions) - line += + listStr += if (library.devPath == null && version == library.current) ' [$version]' else ' $version'; if (library.devPath != null) - line += ' [dev:${library.devPath}]'; + listStr += ' [dev:${library.devPath}]'; + + listStr += "\n"; - Cli.print(line); } + + listStr = listStr.trim(); + + Cli.print(listStr); + } function update() { diff --git a/test/tests/integration/TestDev.hx b/test/tests/integration/TestDev.hx index 2a8dd590..48af0932 100644 --- a/test/tests/integration/TestDev.hx +++ b/test/tests/integration/TestDev.hx @@ -47,7 +47,7 @@ class TestDev extends IntegrationTests { final r = haxelib(["dev", "bar", Path.join([IntegrationTests.projectRoot, "test/libraries/libBar"])]).result(); assertSuccess(r); - final r = haxelib(["list", "Bar"]).result(); + final r = haxelib(["list", "Bar", "--quiet"]).result(); assertTrue(r.out.startsWith("Bar")); assertSuccess(r); // even though the user used "bar", we show "Bar" as that is what is found in haxelib.json diff --git a/test/tests/integration/TestList.hx b/test/tests/integration/TestList.hx index d14f593a..1e701613 100644 --- a/test/tests/integration/TestList.hx +++ b/test/tests/integration/TestList.hx @@ -116,7 +116,7 @@ class TestList extends IntegrationTests { function testInvalidDirectories():Void { FileSystem.createDirectory('${projectRoot}$repo/LIBRARY'); - final r = haxelib(["list"]).result(); + final r = haxelib(["list", "--quiet"]).result(); assertSuccess(r); // the command should not crash assertEquals("", r.out);