HaxeFoundation / haxelib

The Haxe library manager
https://lib.haxe.org/
MIT License
172 stars 78 forks source link

Path of a removed lib/ver. #195

Closed boozook closed 8 years ago

boozook commented 9 years ago

Log:

$ haxelib version
3.2.0-rc.3

$ haxelib list h3d
h3d: git [dev:/Users/ak/Developer/Haxe/libs/h3d/git]
$ haxelib remove h3d git
Library h3d version git removed

$ haxelib path h3d
Library h3d version dev is not installed
fzzr:bin ak$ haxelib list h3d
h3d: [dev:/Users/ak/Developer/Haxe/libs/h3d/git]

$ cd /Users/ak/Developer/Haxe/libs/h3d/
$ ls -GFAC
.DS_Store  .current   .dev
$ cat .current
dev
$ cat .dev
/Users/ak/Developer/Haxe/libs/h3d/git

After haxelib remove h3d git a git directory really was deleted. But not removed record about it in the .dev (devPath).

Anyway I try to remove current version but no getting exception about it impossible (Main.hx#L1125).

If we can remove the current version and when the library not contain other versions => maybe we have to delete this library fully (in my case: /Users/ak/Developer/Haxe/libs/h3d) ?

nadako commented 8 years ago

This is somewhat related to #263, but that issue is quite heavy, so let's fix this for now by checking whether the path we're removing is the same that specified in .dev and remove the .dev file if so.

Removing the whole library folder when last version is removed makes sense too.

nadako commented 8 years ago

Or rather, forbid removing version if its path is specified in .dev (which will be true for vcs checkouts), so the behaviour is consistent.