How to use symlink-or-copy - 10 common examples

To help you get started, we’ve selected a few symlink-or-copy examples, based on popular ways it is used in public projects.

Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.

github angular / angular / tools / broccoli / broccoli-tree-stabilizer.ts View on Github external
rebuild() {
    fs.rmdirSync(this.outputPath);

    // TODO: investigate if we can use rename the directory instead to improve performance on
    // Windows
    symlinkOrCopy.sync(this.inputPath, this.outputPath);
  }
github broccolijs / broccoli-filter / index.js View on Github external
function symlinkOrCopyFromCache(entry, dest, relativePath) {
  try {
    symlinkOrCopySync(entry.cacheFile, dest + '/' + relativePath);
  } catch(err) {
    if (err.code === 'ENOENT') {
      // assume that the destination directory is missing create it and retry
      mkdirp.sync(path.dirname(entry.outputFile))
      symlinkOrCopySync(entry.cacheFile, dest + '/' + relativePath)
    } else {
      throw err;
    }
  }
}
github gobblejs / gobble / lib / builtins / include.js View on Github external
return sander.mkdir(outputdir, path.dirname(file)).then(function () {
				var src = inputdir + path.sep + file;
				var dest = outputdir + path.sep + file;

				// TODO sander-esque symlinkOrCopy
				symlink_or_copy.sync(src, dest);
			});
		});
github broccolijs / broccoli / test / plugins.js View on Github external
build() {
      super.build();
      for (let i = 0; i < this.inputPaths.length; i++) {
        symlinkOrCopySync(this.inputPaths[i], this.outputPath + '/' + i);
      }
    }
  };
github ef4 / ember-browserify / bin / install-ember-addons.js View on Github external
['modern', 'outdated'].forEach(function(inRepoAddon) {
  var source = path.resolve(__dirname, '..', 'lib/');
  var target = path.resolve(__dirname, '..', 'tests/dummy/lib', inRepoAddon, 'node_modules/ember-browserify/lib/');

  console.log('rimraf', target);
  rimraf.sync(target);

  console.log('symlink', source, target)
  symlinkOrCopy.sync(source, target);
});
github broccolijs / broccoli-debug / src / index.js View on Github external
build() {
    if (this._shouldSync) {
      let treeSync = this._sync;
      if (!treeSync) {
        treeSync = this._sync = new TreeSync(this.inputPaths[0], this._debugOutputPath);
      }

      treeSync.sync();
    }

    if (!this._haveLinked) {
      fs.rmdirSync(this.outputPath);
      symlinkOrCopy.sync(this.inputPaths[0], this.outputPath);
      this._haveLinked = true;
    }
  }
};
github salsify / ember-css-modules / lib / type-generator.js View on Github external
build() {
    if (!this.hasLinked) {
      fs.rmdirSync(this.outputPath);
      symlinkOrCopy.sync(this.inputPaths[0], this.outputPath);
      this.hasLinked = true;
    }
  }
}
github ember-learn / ember-cli-addon-docs / lib / broccoli / bridge.js View on Github external
build() {
    if (!this._inputNodes.length) {
      throw new Error(`BroccoliBridge placeholder '${this.name}' was never fulfilled.`);
    }

    if (!this._hasLinked) {
      fs.removeSync(this.outputPath);
      symlinkOrCopy.sync(this.inputPaths[0], this.outputPath);
      this._hasLinked = true;
    }
  }
}
github TryGhost / Ghost-CLI / lib / commands / install.js View on Github external
link(ctx) {
        symlinkSync(ctx.installPath, path.join(process.cwd(), 'current'));

        const instance = this.system.getInstance();

        instance.version = ctx.version;
        instance.cliVersion = this.system.cliVersion;
    }
}
github angular / angular-cli / lib / broccoli / broccoli-merge-trees.js View on Github external
function outputFileSync(sourcePath, destPath) {
    var dirname = path.dirname(destPath);
    fse.mkdirsSync(dirname, { fs: fs });
    symlinkOrCopySync(sourcePath, destPath);
}
function pathOverwrittenError(path) {

symlink-or-copy

Symlink files or directories, falling back to copying on Windows

MIT
Latest version published 5 years ago

Package Health Score

56 / 100
Full package analysis

Popular symlink-or-copy functions