Socket
Socket
Sign inDemoInstall

bin-links

Package Overview
Dependencies
Maintainers
6
Versions
28
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

bin-links - npm Package Compare versions

Comparing version 2.1.2 to 2.1.3

16

lib/link-gently.js

@@ -21,2 +21,3 @@ // if the thing isn't there, skip it

const SKIP = Symbol('skip - missing or already installed')
const CLOBBER = Symbol('clobber - ours or in forceful mode')

@@ -39,3 +40,3 @@ const linkGently = ({path, to, from, absFrom, force}) => {

if (!stTo.isSymbolicLink())
return force ? rm(to) : Promise.resolve()
return force && rm(to).then(() => CLOBBER)

@@ -48,3 +49,3 @@ return readlink(to).then(target => {

if (target.indexOf(path) === 0 || force)
return rm(to)
return rm(to).then(() => CLOBBER)
})

@@ -56,6 +57,13 @@ } else {

})
// this will fail if we didn't remove it
.then(skip => skip !== SKIP && symlink(from, to, 'file').then(() => true))
.then(skipOrClobber => {
if (skipOrClobber === SKIP)
return true
return symlink(from, to, 'file').catch(er => {
if (skipOrClobber === CLOBBER || force)
return rm(to).then(() => symlink(from, to, 'file'))
throw er
}).then(() => true)
})
}
module.exports = linkGently
{
"name": "bin-links",
"version": "2.1.2",
"version": "2.1.3",
"description": "JavaScript package binary linker",

@@ -5,0 +5,0 @@ "main": "index.js",

SocketSocket SOC 2 Logo

Product

  • Package Alerts
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap
  • Changelog

Packages

npm

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc