Closed aral closed 3 months ago
You could also append them to an archive.
Eg, to add /some/path/asdf
and /other/path/foo
to the same archive, do this:
const file = '/path/to/file.tar'
await tar.u({ file, cwd: '/some/path' }, ['asdf'])
await tar.u({ file, cwd: '/other/path' }, ['foo'])
Note the similarity:
#!/usr/bin/env bash
file='/path/to/file.tar'
tar u -f $file -C /some/path asdf
tar u -f $file -C /other/path foo
Not sure if this is the best way to do this but given it took me a moment to figure it out (as it does not seem to be a natively-supported use case), I thought I’d document it.
Please feel free to add to the documentation/examples or to close this and folks will still be able to find it if they search for it.
TL; DR: use symlinks.