How to use symlink-dir - 5 common examples

To help you get started, we’ve selected a few symlink-dir 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 tommy351 / kosko / packages / cli / src / commands / __tests__ / generate.ts View on Github external
jest.resetAllMocks();

  // Reset env
  env.env = undefined;

  const root = await pkgDir();
  tmpDir = await tmp.dir({ dir: tempDir, unsafeCleanup: true });

  // Write kosko.toml
  await writeFile(
    join(tmpDir.path, "kosko.toml"),
    toml.stringify(config as toml.JsonMap)
  );

  // Install @kosko/env in the temp folder
  await symlinkDir(
    join(root!, "packages", "env"),
    join(tmpDir.path, "node_modules", "@kosko", "env")
  );
});
github umijs / father-doc / packages / umi-plugin-father-doc / src / index.ts View on Github external
getHostPkgAlias(api.paths).forEach(([pkgName, pkgPath]) => {
      const srcPath = path.join(pkgPath, 'src');
      const linkPath = path.join(api.paths.cwd, 'node_modules', pkgName);

      // use src path instead of main field in package.json if exists
      config.resolve.alias.set(pkgName, fs.existsSync(srcPath) ? srcPath : pkgPath);

      // link current pkgs into node_modules, for import module resolve when writing demo
      if (!fs.existsSync(linkPath)) {
        symlink(pkgPath, linkPath);
      }
    });
  });
github tommy351 / kosko / integration / kosko-generate / without-require / __tests__ / index.ts View on Github external
beforeAll(async () => {
  const root = await pkgDir();

  await symlinkDir(
    join(root!, "packages", "env"),
    join(testDir, "node_modules", "@kosko", "env")
  );
});
github tommy351 / kosko / integration / kosko-template / __tests__ / index.ts View on Github external
beforeEach(async () => {
  const root = await pkgDir();
  tmpDir = await tmp.dir({ dir: tempDir, unsafeCleanup: true });

  const src = join(__dirname, "..", "bin.js");
  const dst = join(tmpDir.path, "bin.js");
  await copyFile(src, dst);

  await symlinkDir(
    join(root!, "packages", "template"),
    join(tmpDir.path, "node_modules", "@kosko", "template")
  );

  result = await execa(dst, args, {
    ...options,
    cwd: tmpDir.path,
    env: {
      LC_ALL: "en_US"
    }
  });
});
github cerebral / cerebral / scripts / run.js View on Github external
link(packagePath, done) {
        const packageBin = path.join(packagePath, 'node_modules', '.bin')
        symlinkDir(rootBin, packageBin).then(
          () => done(null, true),
          (err) => {
            console.warn(
              `Cannot create symlink '${packageBin}' (there is a directory there probably).`
            )
            done(err)
          }
        )
      },
      npm(cwd, done) {

symlink-dir

Cross-platform directory symlinking

MIT
Latest version published 24 days ago

Package Health Score

78 / 100
Full package analysis

Popular symlink-dir functions