fix: replace . & .. & $PWD with ~

This commit is contained in:
Andras Bacsai 2023-03-07 10:44:53 +01:00
parent 04f7e8e777
commit 3e81d7e9cb
2 changed files with 6 additions and 4 deletions

View File

@ -82,9 +82,10 @@ export default async function (data) {
v.startsWith('.') || v.startsWith('.') ||
v.startsWith('..') || v.startsWith('..') ||
v.startsWith('/') || v.startsWith('/') ||
v.startsWith('~') v.startsWith('~') ||
v.startsWith('$PWD')
) { ) {
// Nothing to do here, host path v = v.replace('$.', `~`).replace('$..', '~').replace('$$PWD', '~');
} else { } else {
if (!path) { if (!path) {
path = v; path = v;

View File

@ -40,9 +40,10 @@
volume.startsWith('.') || volume.startsWith('.') ||
volume.startsWith('..') || volume.startsWith('..') ||
volume.startsWith('/') || volume.startsWith('/') ||
volume.startsWith('~') volume.startsWith('~') ||
volume.startsWith('$PWD')
) { ) {
// Nothing to do here, host path volume = volume.replace('$.', `~`).replace('$..', '~').replace('$$PWD', '~');
} else { } else {
if (!target) { if (!target) {
target = volume; target = volume;