We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
1 parent 4a1f44d commit dab7263Copy full SHA for dab7263
1 file changed
pkgm.ts
@@ -506,12 +506,23 @@ function expand_runtime_env(
506
}
507
508
function symlink_with_overwrite(src: string, dst: string) {
509
- if (existsSync(dst) && Deno.lstatSync(dst).isSymlink) {
+ if (isSymlink(dst)) {
510
Deno.removeSync(dst);
511
512
Deno.symlinkSync(src, dst);
513
514
515
+function isSymlink(path: string): boolean {
516
+ try {
517
+ return Deno.lstatSync(path).isSymlink;
518
+ } catch (err) {
519
+ if (err instanceof Deno.errors.NotFound) {
520
+ return false;
521
+ }
522
+ throw err;
523
524
+}
525
+
526
function get_pkgx() {
527
for (const path of Deno.env.get("PATH")!.split(":")) {
528
const pkgx = join(path, "pkgx");
0 commit comments