pass host to processLinks

This commit is contained in:
joshuaboud 2022-05-31 14:33:51 -03:00
parent 339aad2d6e
commit 19bed0a929
No known key found for this signature in database
GPG Key ID: 17EFB59E2A8BF50E

View File

@ -8,7 +8,7 @@ async function processLinks(linkTargets, host) {
await useSpawn(
// Separate by newline so errors will slot in
['stat', `--printf=%F${UNIT_SEPARATOR}%f\n`, ...linkTargets.map(target => target.path)],
{ superuser: 'try', err: 'out', host: host } // stderr >&stdout for maintaining index order
{ superuser: 'try', err: 'out', host } // stderr >&stdout for maintaining index order
).promise()
.catch(state => state) // ignore errors, error message will maintain index order
).stdout
@ -64,7 +64,7 @@ async function getDirEntryObjects(dirListing, cwd, host, failCallback, byteForma
.catch(state => state) // ignore errors
).stdout, cwd, host, failCallback, byteFormatter)
: [];
await processLinks(entries.filter(entry => entry.type === 'symbolic link').map(entry => entry.target));
await processLinks(entries.filter(entry => entry.type === 'symbolic link').map(entry => entry.target), host);
return entries;
}