MCPcopy Create free account
hub / github.com/play-co/devkit / createLink

Function createLink

src/install/cache.js:231–249  ·  view source on GitHub ↗
(src, dest, cb)

Source from the content-addressed store, hash-verified

229var lstat = Promise.promisify(fs.lstat);
230
231function 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
251module.exports = new ModuleCache();
252module.exports.CACHE_PATH = MODULE_CACHE;

Callers 1

cache.jsFile · 0.70

Calls

no outgoing calls

Tested by

no test coverage detected

Used in the wild real call sites across dependent graphs

searching dependent graphs…