Skip to content

Commit

Permalink
Exit with error when hxml install fails (HaxeFoundation#625)
Browse files Browse the repository at this point in the history
* Install from hxml: exit with error when installing a lib failed

* Update run.n
  • Loading branch information
kLabz committed Apr 12, 2024
1 parent 888cdc8 commit 46f2139
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 0 deletions.
Binary file modified run.n
Binary file not shown.
5 changes: 5 additions & 0 deletions src/haxelib/api/Installer.hx
Original file line number Diff line number Diff line change
Expand Up @@ -263,6 +263,8 @@ class Installer {
if (confirmHxmlInstall != null && !confirmHxmlInstall(libVersions))
return;

var hasFailures = false;

for (library in installData) {
if (library.versionData.match(Haxelib(_)) && repository.isVersionInstalled(library.name, library.version)) {
final version = SemVer.ofString(library.version);
Expand All @@ -281,6 +283,7 @@ class Installer {
try
installFromVersionData(library.name, library.versionData)
catch (e) {
hasFailures = true;
userInterface.log(e.toString());
continue;
}
Expand All @@ -296,6 +299,8 @@ class Installer {

handleDependenciesGeneral(libraryName, library.versionData);
}

if (hasFailures) throw "Some libraries could not be installed.";
}

/**
Expand Down

0 comments on commit 46f2139

Please sign in to comment.