Skip to content

Commit

Permalink
fix: symlinks don’t work on windows (#307)
Browse files Browse the repository at this point in the history
When running on windows as a non-admin the symlink operation will fail.

See hashicorp/terraform-cdk#501 for error.

This just replaces the symlink with a copy.
  • Loading branch information
Elad Ben-Israel authored Feb 12, 2021
2 parents cf00770 + 8402fe2 commit 96ce223
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion src/compile.ts
Original file line number Diff line number Diff line change
Expand Up @@ -43,7 +43,7 @@ export async function compile(workdir: string, options: Options) {

const targetdir = path.join(path.join(workdir, 'node_modules'), moduleName);
await fs.mkdirp(path.dirname(targetdir));
await fs.ensureSymlink(dir, targetdir);
await fs.copy(dir, targetdir);

// add to "deps" and "peer deps"
if (!moduleName.startsWith('@types/')) {
Expand Down

0 comments on commit 96ce223

Please sign in to comment.