fix lint errors
This commit is contained in:
@@ -23,21 +23,21 @@ export const IS_WINDOWS = process.platform === 'win32'
|
|||||||
* maintain trailing backslash for backward compatibility with Node.js < 24
|
* maintain trailing backslash for backward compatibility with Node.js < 24
|
||||||
*/
|
*/
|
||||||
export async function readlink(fsPath: string): Promise<string> {
|
export async function readlink(fsPath: string): Promise<string> {
|
||||||
const result = await fs.promises.readlink(fsPath);
|
const result = await fs.promises.readlink(fsPath)
|
||||||
|
|
||||||
// Only on Windows, ensure directory symlinks end with a backslash
|
// Only on Windows, ensure directory symlinks end with a backslash
|
||||||
if (IS_WINDOWS) {
|
if (IS_WINDOWS) {
|
||||||
try {
|
try {
|
||||||
const stats = await fs.promises.lstat(result);
|
const stats = await fs.promises.lstat(result)
|
||||||
if (stats.isDirectory() && !result.endsWith('\\')) {
|
if (stats.isDirectory() && !result.endsWith('\\')) {
|
||||||
return `${result}\\`;
|
return `${result}\\`
|
||||||
}
|
}
|
||||||
} catch (err) {
|
} catch (err) {
|
||||||
// If we can't access the target, just return the original result
|
// If we can't access the target, just return the original result
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
return result;
|
return result
|
||||||
}
|
}
|
||||||
// See https://github.com/nodejs/node/blob/d0153aee367422d0858105abec186da4dff0a0c5/deps/uv/include/uv/win.h#L691
|
// See https://github.com/nodejs/node/blob/d0153aee367422d0858105abec186da4dff0a0c5/deps/uv/include/uv/win.h#L691
|
||||||
export const UV_FS_O_EXLOCK = 0x10000000
|
export const UV_FS_O_EXLOCK = 0x10000000
|
||||||
|
|||||||
Reference in New Issue
Block a user