MCPcopy
hub / github.com/spicetify/cli / CreateJunction

Function CreateJunction

src/utils/utils.go:337–348  ·  view source on GitHub ↗

CreateJunction creates a junction in Windows or a symlink in Linux/Mac.

(location, destination string)

Source from the content-addressed store, hash-verified

335
336// CreateJunction creates a junction in Windows or a symlink in Linux/Mac.
337func CreateJunction(location, destination string) error {
338 CheckExistAndDelete(destination)
339 switch runtime.GOOS {
340 case "windows":
341 exec.Command("cmd", "/C", "rmdir", destination).Run()
342 return exec.Command("cmd", "/C", "mklink", "/J", destination, location).Run()
343 case "linux", "darwin":
344 return exec.Command("ln", "-Fsf", location, destination).Run()
345 }
346
347 return nil
348}
349
350func SeekToCloseParen(content string, regexpTerm string, leftChar, rightChar byte) string {
351 loc := regexp.MustCompile(regexpTerm).FindStringIndex(content)

Callers 1

nodeModuleSymlinkFunction · 0.92

Calls 1

CheckExistAndDeleteFunction · 0.85

Tested by

no test coverage detected