(src, dest, cb)
| 229 | var lstat = Promise.promisify(fs.lstat); |
| 230 | |
| 231 | function createLink(src, dest, cb) { |
| 232 | return lstat(dest).catch(function (err) { |
| 233 | if (err.code !== 'ENOENT') { |
| 234 | return Promise.reject(err); |
| 235 | } |
| 236 | }).then(function (stat) { |
| 237 | if (stat) { |
| 238 | if (stat.isSymbolicLink()) { |
| 239 | return unlink(dest); |
| 240 | } else { |
| 241 | return Promise.reject( |
| 242 | new Error('Please remove existing module before using --link') |
| 243 | ); |
| 244 | } |
| 245 | } |
| 246 | }).then(function () { |
| 247 | return symlink(src, dest, 'junction'); |
| 248 | }).nodeify(cb); |
| 249 | } |
| 250 | |
| 251 | module.exports = new ModuleCache(); |
| 252 | module.exports.CACHE_PATH = MODULE_CACHE; |
no outgoing calls
no test coverage detected
searching dependent graphs…