MCPcopy
hub / github.com/vercel/next.js / symlink

Method symlink

test/lib/next-modes/base.ts:793–802  ·  view source on GitHub ↗

* Makes `linkFilename` point to `targetFilename`. * * Performs an atomic update to the symlink: * https://blog.moertel.com/posts/2005-08-22-how-to-change-symlinks-atomically.html

(targetFilename: string, linkFilename: string)

Source from the content-addressed store, hash-verified

791 * https://blog.moertel.com/posts/2005-08-22-how-to-change-symlinks-atomically.html
792 */
793 public async symlink(targetFilename: string, linkFilename: string) {
794 const tmpLinkPath = path.join(this.testDir, linkFilename + '.tmp')
795 try {
796 await fs.symlink(path.join(this.testDir, targetFilename), tmpLinkPath)
797 await fs.rename(tmpLinkPath, path.join(this.testDir, linkFilename))
798 } catch (e) {
799 await fs.unlink(tmpLinkPath)
800 throw e
801 }
802 }
803
804 public async renameFolder(foldername: string, newFoldername: string) {
805 await fs.rename(

Callers 2

Calls 2

joinMethod · 0.45
renameMethod · 0.45

Tested by

no test coverage detected