nimble icon indicating copy to clipboard operation
nimble copied to clipboard

Command to retrieve path to .nimble file

Open timotheecour opened this issue 6 years ago • 4 comments

/cc @dom96 all other packages foo I installed after nimble develop behaved like: nimble path foo returns /Users/timothee/git_clone/nim/foo but not nimble: nimble path nimble returns /Users/timothee/git_clone/nim/nimble/src instead of /Users/timothee/git_clone/nim/nimble

timotheecour avatar Nov 29 '18 21:11 timotheecour

AFAIK nimble path returns the path to the source code, which seems correct for what you got.

dom96 avatar Nov 30 '18 00:11 dom96

ok i see; looks like every package I tried have nimble path pointing to dir where the nimble file is, not where the base of the import is, eg:

nimble path nimongo /pathto/nimongo

\ls /Users/timothee/git_clone/nim/nimongo LICENSE README.md nimongo nimongo.nimble tests

so maybe we need another command to get the dir that contains the nimble file; or, even better, the path to the nimble file itself: ie: nimble nimblepath nimble => would return: /pathto/nimble/nimble.nimble

from that, we can derive it's parent dir; but other way around is less trivial given corner cases, eg:

  • https://github.com/micklat/NimBorg contains NimBorg.babel, not NimBorg.nimble
  • aliases, eg: nimlibpng is Alias for png

timotheecour avatar Nov 30 '18 01:11 timotheecour

What's the use of knowing where the nimble file is? What's the use case here?

genotrance avatar Sep 08 '20 03:09 genotrance

at very least for debugging, to figure out which file was selected by nimble (eg in case there are multiple versions of the same packages); eg if you've installed X and then later nimble develop'd X in some local clone

timotheecour avatar Sep 23 '20 21:09 timotheecour