From 81655017172eaedd346b3efe63c5975c803c82b4 Mon Sep 17 00:00:00 2001 From: Nathan Fritz Date: Wed, 17 Aug 2022 12:26:35 -0700 Subject: [PATCH] deps: @npmcli/move-file@2.0.1 --- node_modules/@npmcli/move-file/lib/index.js | 22 +++++++++++++++------ node_modules/@npmcli/move-file/package.json | 6 +++--- package-lock.json | 6 +++--- 3 files changed, 22 insertions(+), 12 deletions(-) diff --git a/node_modules/@npmcli/move-file/lib/index.js b/node_modules/@npmcli/move-file/lib/index.js index ecc55f0171da5..5789bb127e096 100644 --- a/node_modules/@npmcli/move-file/lib/index.js +++ b/node_modules/@npmcli/move-file/lib/index.js @@ -97,14 +97,19 @@ const moveFile = async (source, destination, options = {}, root = true, symlinks } // try to determine what the actual file is so we can create the correct // type of symlink in windows - let targetStat + let targetStat = 'file' try { targetStat = await stat(resolve(dirname(symSource), target)) - } catch (err) {} + if (targetStat.isDirectory()) { + targetStat = 'junction' + } + } catch { + // targetStat remains 'file' + } await symlink( target, symDestination, - targetStat && targetStat.isDirectory() ? 'junction' : 'file' + targetStat ) })) await rimraf(source) @@ -157,14 +162,19 @@ const moveFileSync = (source, destination, options = {}, root = true, symlinks = } // try to determine what the actual file is so we can create the correct // type of symlink in windows - let targetStat + let targetStat = 'file' try { targetStat = statSync(resolve(dirname(symSource), target)) - } catch (err) {} + if (targetStat.isDirectory()) { + targetStat = 'junction' + } + } catch { + // targetStat remains 'file' + } symlinkSync( target, symDestination, - targetStat && targetStat.isDirectory() ? 'junction' : 'file' + targetStat ) } rimrafSync(source) diff --git a/node_modules/@npmcli/move-file/package.json b/node_modules/@npmcli/move-file/package.json index 1b1d377b0c7b2..58793b93a9ca0 100644 --- a/node_modules/@npmcli/move-file/package.json +++ b/node_modules/@npmcli/move-file/package.json @@ -1,6 +1,6 @@ { "name": "@npmcli/move-file", - "version": "2.0.0", + "version": "2.0.1", "files": [ "bin/", "lib/" @@ -13,7 +13,7 @@ }, "devDependencies": { "@npmcli/eslint-config": "^3.0.1", - "@npmcli/template-oss": "3.2.2", + "@npmcli/template-oss": "3.5.0", "tap": "^16.0.1" }, "scripts": { @@ -42,6 +42,6 @@ "author": "GitHub Inc.", "templateOSS": { "//@npmcli/template-oss": "This file is partially managed by @npmcli/template-oss. Edits may be overwritten.", - "version": "3.2.2" + "version": "3.5.0" } } diff --git a/package-lock.json b/package-lock.json index 516d0738810f5..67cddf08dc0d0 100644 --- a/package-lock.json +++ b/package-lock.json @@ -993,9 +993,9 @@ } }, "node_modules/@npmcli/move-file": { - "version": "2.0.0", - "resolved": "https://registry.npmjs.org/@npmcli/move-file/-/move-file-2.0.0.tgz", - "integrity": "sha512-UR6D5f4KEGWJV6BGPH3Qb2EtgH+t+1XQ1Tt85c7qicN6cezzuHPdZwwAxqZr4JLtnQu0LZsTza/5gmNmSl8XLg==", + "version": "2.0.1", + "resolved": "https://registry.npmjs.org/@npmcli/move-file/-/move-file-2.0.1.tgz", + "integrity": "sha512-mJd2Z5TjYWq/ttPLLGqArdtnC74J6bOzg4rMDnN+p1xTacZ2yPRCk2y0oSWQtygLR9YVQXgOcONrwtnk3JupxQ==", "inBundle": true, "dependencies": { "mkdirp": "^1.0.4",