Welcome to mirror list, hosted at ThFree Co, Russian Federation.

github.com/npm/cli.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorNathan Fritz <fritzy@github.com>2022-08-17 22:26:35 +0300
committerNathan Fritz <fritzy@github.com>2022-08-17 22:44:30 +0300
commit81655017172eaedd346b3efe63c5975c803c82b4 (patch)
treea97f99929ce532305a64e4d88ca09e3c30b435a0
parent07536a4be30ac3305fe4827335d621387bae3ca7 (diff)
deps: @npmcli/move-file@2.0.1
-rw-r--r--node_modules/@npmcli/move-file/lib/index.js22
-rw-r--r--node_modules/@npmcli/move-file/package.json6
-rw-r--r--package-lock.json6
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 ecc55f017..5789bb127 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 1b1d377b0..58793b93a 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 516d07388..67cddf08d 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",