MCPcopy Index your code
hub / github.com/nodejs/corepack / removePosixLink

Method removePosixLink

sources/commands/Disable.ts:71–85  ·  view source on GitHub ↗
(installDirectory: string, binName: string)

Source from the content-addressed store, hash-verified

69 }
70
71 async removePosixLink(installDirectory: string, binName: string) {
72 const file = path.join(installDirectory, binName);
73 try {
74 if (binName.includes(`yarn`) && corepackUtils.isYarnSwitchPath(await fs.promises.realpath(file))) {
75 console.warn(`${binName} is already installed in ${file} and points to a Yarn Switch install - skipping`);
76 return;
77 }
78
79 await fs.promises.unlink(file);
80 } catch (err) {
81 if ((err as NodeError).code !== `ENOENT`) {
82 throw err;
83 }
84 }
85 }
86
87 async removeWin32Link(installDirectory: string, binName: string) {
88 for (const ext of [``, `.ps1`, `.cmd`]) {

Callers 1

executeMethod · 0.95

Calls

no outgoing calls

Tested by

no test coverage detected