Path of included file
So I have 2 projects and they share some common code.
Project1 is C:\Project1\one.pjs. It has a script file projOneLib.js
Project2 is C:\Project2\two.pjs. It has 2 script files. One is projTwoLib.js, but I also included the script file from Project1, projOneLib.js.
Now, while running Project2, I need the location of projOneLib.js' path. How would I do that? I need a way to say, grab me the original file location of projOneLib.js.
This can't be too hard-coded either, so in projOneLib.js, if I can save its own file location to a in-memory variable, that'd be good.
Thanks!
Why can't you put your source code somewhere to the static path which doesn't include version number? It would simplify your work.
Anyway, if that is not possible, you have at least two options:
- Take the version from any external source (like registry, file info, source control output, etc.). I am not aware about your specific situation, but usually there are different ways how you can get the same info from different places.
- Probably the simpler way: use FileFiles Method to search for the desired file.