Skip to content

Commit

Permalink
Fix #294
Browse files Browse the repository at this point in the history
  • Loading branch information
mikebarkmin committed Oct 4, 2022
1 parent e2a4d15 commit 84bba40
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 1 deletion.
5 changes: 5 additions & 0 deletions .changeset/new-suns-invent.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
---
"hyperbook": patch
---

Fix bug requiring admin permissions for creating symlinks #294
4 changes: 3 additions & 1 deletion packages/hyperbook/helpers/make-symlink.ts
Original file line number Diff line number Diff line change
@@ -1,8 +1,10 @@
import fs from "fs";
import os from "os";

export async function makeSymlink(src: string, dst: string): Promise<void> {
const type = os.platform() == "win32" ? "junction" : null;
return new Promise((resolve, reject) => {
fs.symlink(src, dst, (err) => {
fs.symlink(src, dst, type, (err) => {
if (err) {
reject();
} else {
Expand Down

0 comments on commit 84bba40

Please sign in to comment.