Don't validate non-absolute paths

This commit is contained in:
Daniel Imms 2021-03-22 16:43:59 -07:00
parent 2cde743fe2
commit 851a849d2c
No known key found for this signature in database
GPG key ID: D12BE8272D6284CC

View file

@ -217,6 +217,14 @@ async function validateProfilePaths(label: string, potentialPaths: string[], sta
return validateProfilePaths(label, potentialPaths, statProvider, args);
}
if (basename(current) === current) {
return {
profileName: label,
path: current,
args
};
}
try {
const result = await fs.promises.stat(normalize(current));
if (result.isFile() || result.isSymbolicLink()) {
@ -224,7 +232,7 @@ async function validateProfilePaths(label: string, potentialPaths: string[], sta
return {
profileName: label,
path: current,
args: args
args
};
} else {
return {
@ -245,7 +253,7 @@ async function validateProfilePaths(label: string, potentialPaths: string[], sta
return {
profileName: label,
path: current,
args: args
args
};
} else {
return {