From bb1b3066db0208fb1d79cc5715843d5655c3c521 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Valentin=20Lemi=C3=A8re?= Date: Thu, 10 Mar 2016 16:35:05 +0100 Subject: [PATCH] Prevent version remove if dev link to it --- src/haxelib/client/Main.hx | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/src/haxelib/client/Main.hx b/src/haxelib/client/Main.hx index 83be5aac4..5dc7651fb 100644 --- a/src/haxelib/client/Main.hx +++ b/src/haxelib/client/Main.hx @@ -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"); }