Closed mpeuster closed 6 years ago
I thought this could easily be fixed by adding
# change into project root directory (for correct relative paths)
os.chdir(self._prj_root)
inside _create_dirs()
and avoid using _prj_root
for constructing paths from then on. It works fine when creating projects but breaks when adding new files. I'll have to look into it again on Firday.
TODO: Properly deal with relative paths, given that we don't know, in which directory tng-project
is executed.
When adding/removing a file with tng-project -p <prj-path> --add file <file-path>
:
-p prj-path
may be omitted when using tng-project --add
from the project root directoryproject.yaml
Does that make sense?
You know the absolute path of project.yml
, say /x/y/z/project.yml
then get the basepath of it (folder w/o file name): /x/y/z/
... then the relative path to the project root is the absolute path of the added file minus /x/y/z
. This would not require any change dir operations or so.
Now we have:
but
test_project1
should not be part of the paths to the files. The paths need to be relative to theproject.yml
itself, not to thePWD
in whichtng-project
was called.Should be: