If you want to know in witch directory your current pack is on runtime, you can use $InputFileName
This is a problem when you test your code in the notebook, but run your package as a script. To solve this, I use my own function
fileDirectory[]:=If[$InputFileName=="",NotebookDirectory[],DirectoryName[$InputFileName]]
so fileDirectory[]
is independent over environment