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

Commit

Permalink
Prevent version remove if dev link to it
Browse files Browse the repository at this point in the history
  • Loading branch information
Valentin Lemière committed Mar 10, 2016
1 parent 7341901 commit bb1b306
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 bb1b306

Please sign in to comment.