Skip to content
This repository has been archived by the owner on Mar 12, 2022. It is now read-only.

Commit

Permalink
Merge pull request HaxeFoundation#285 from ibilon/preventDevRemove
Browse files Browse the repository at this point in the history
Prevent version remove if dev link to it
  • Loading branch information
nadako committed Mar 10, 2016
2 parents 7341901 + bb1b306 commit c875791
Showing 1 changed file with 4 additions and 1 deletion.
5 changes: 4 additions & 1 deletion src/haxelib/client/Main.hx
Original file line number Diff line number Diff line change
Expand Up @@ -1155,9 +1155,12 @@ class Main {
if( !FileSystem.exists(vdir) )
throw "Library "+prj+" does not have version "+version+" installed";

var cur = getCurrent(pdir);
var cur = File.getContent(pdir + "/.current").trim(); // set version regardless of dev
if( cur == version )
throw "Can't remove current version of library "+prj;
var dev = try getDev(pdir) catch (_:Dynamic) null; // dev is checked here
if( dev == vdir )
throw "Can't remove dev version of library "+prj;
deleteRec(vdir);
print("Library "+prj+" version "+version+" removed");
}
Expand Down

0 comments on commit c875791

Please sign in to comment.