I have a folder symlink to core files and a folder with my improvements like this:
- core/ -> /some/distant/root/directory/core/
- script_a.py
- special/script_b.py
- special/script_c.py
- core-improvements/
- special/script_b.py
What I want to do is to create third directory called improved-core/ (using bash script), where there is going to be the contents of core-improvements/ and recursively linked contents of core/ (I mean /some/distant/root/directory/core/):
- improved-core/
- script_a.py -> /some/distant/root/directory/core/script_a.py
- special/script_b.py (from core-improvements/)
- special/script_c.py -> /some/distant/root/directory/core/special/script_c.py
If I create it by hand using symlink to script_a.py, script_a.py calls script_b.py from the /some/distant/root/directory/core/special/ directory, not the one in improved-core/special/ directory.
So I suppose the hard links are needed here?
So far I created the following bash script, that works nicely for me, but it creates the symlinks instead of hardlinks:
cp -r core-improvements/ improved-core/ &&
cp -LnrsT core/ improved-core/
Then I tried to create hard links instead of symlinks by switching -LnrsT to -LnrlT, but I get the following errors:
cp: cannot create hard link 'improved-core/script_a.py' to '/some/distant/root/directory/core/script_a.py': Operation not permitted
I'm now completely lost how to solve the issue.