Newer
Older
vmk-demo-bot / admin / node_modules / vinyl-fs / lib / src / read-contents / read-symbolic-link.js
@eugene-sukhodolskiy eugene-sukhodolskiy on 15 Jul 342 bytes init
'use strict';

var fs = require('graceful-fs');

function readLink(file, optResolver, onRead) {
  fs.readlink(file.path, onReadlink);

  function onReadlink(readErr, target) {
    if (readErr) {
      return onRead(readErr);
    }

    // Store the link target path
    file.symlink = target;

    onRead();
  }
}

module.exports = readLink;