symlink-dir
Advanced tools
Comparing version 5.0.1 to 5.1.0
@@ -1,2 +0,4 @@ | ||
declare function symlinkDir(src: string, dest: string): Promise<{ | ||
declare function symlinkDir(src: string, dest: string, opts?: { | ||
overwrite?: boolean; | ||
}): Promise<{ | ||
reused: Boolean; | ||
@@ -3,0 +5,0 @@ warn?: string; |
@@ -17,3 +17,3 @@ "use strict"; | ||
} | ||
function symlinkDir(src, dest) { | ||
function symlinkDir(src, dest, opts) { | ||
dest = betterPathResolve(dest); | ||
@@ -24,3 +24,3 @@ src = betterPathResolve(src); | ||
src = resolveSrc(src, dest); | ||
return forceSymlink(src, dest); | ||
return forceSymlink(src, dest, opts); | ||
} | ||
@@ -31,3 +31,3 @@ /** | ||
*/ | ||
async function forceSymlink(src, dest) { | ||
async function forceSymlink(src, dest, opts) { | ||
try { | ||
@@ -53,2 +53,5 @@ await fs_1.promises.symlink(src, dest, symlinkType); | ||
case 'EISDIR': | ||
if ((opts === null || opts === void 0 ? void 0 : opts.overwrite) === false) { | ||
throw err; | ||
} | ||
// If the target file already exists then we proceed. | ||
@@ -55,0 +58,0 @@ // Additional checks are done below. |
136
package.json
{ | ||
"name": "symlink-dir", | ||
"version": "5.0.1", | ||
"description": "Cross-platform directory symlinking", | ||
"main": "dist/index.js", | ||
"files": [ | ||
"dist/", | ||
"!*.map" | ||
], | ||
"typings": "dist/index.d.ts", | ||
"bin": "dist/cli.js", | ||
"keywords": [ | ||
"symlink", | ||
"symlinking", | ||
"junction", | ||
"directory", | ||
"dir", | ||
"folder" | ||
], | ||
"repository": { | ||
"type": "git", | ||
"url": "git+https://github.com/zkochan/symlink-dir.git" | ||
}, | ||
"author": { | ||
"name": "Zoltan Kochan", | ||
"email": "z@kochan.io", | ||
"url": "https://www.kochan.io" | ||
}, | ||
"license": "MIT", | ||
"bugs": { | ||
"url": "https://github.com/zkochan/symlink-dir/issues" | ||
}, | ||
"homepage": "https://github.com/zkochan/symlink-dir#readme", | ||
"devDependencies": { | ||
"@types/node": "^14.0.11", | ||
"@types/tape": "^4.13.0", | ||
"mos": "^1.3.1", | ||
"mos-plugin-readme": "^1.0.4", | ||
"rimraf": "^3.0.2", | ||
"tape": "^5.0.1", | ||
"tempy": "^1.0.0", | ||
"ts-node": "^9.0.0", | ||
"typescript": "^4.0.0", | ||
"write-json-file": "^4.3.0" | ||
}, | ||
"dependencies": { | ||
"better-path-resolve": "^1.0.0", | ||
"rename-overwrite": "^4.0.0" | ||
}, | ||
"mos": { | ||
"plugins": [ | ||
"readme" | ||
], | ||
"installation": { | ||
"useShortAlias": true | ||
} | ||
}, | ||
"engines": { | ||
"node": ">=12.10" | ||
}, | ||
"scripts": { | ||
"pretest": "rimraf node_modules/src", | ||
"test": "ts-node test", | ||
"test-md": "mos t", | ||
"premd": "rimraf node_modules/src && npm run tsc", | ||
"md": "mos", | ||
"tsc": "rimraf dist && tsc" | ||
} | ||
} | ||
"name": "symlink-dir", | ||
"version": "5.1.0", | ||
"description": "Cross-platform directory symlinking", | ||
"main": "dist/index.js", | ||
"files": [ | ||
"dist/", | ||
"!*.map" | ||
], | ||
"typings": "dist/index.d.ts", | ||
"bin": "dist/cli.js", | ||
"keywords": [ | ||
"symlink", | ||
"symlinking", | ||
"junction", | ||
"directory", | ||
"dir", | ||
"folder" | ||
], | ||
"repository": { | ||
"type": "git", | ||
"url": "git+https://github.com/pnpm/symlink-dir.git" | ||
}, | ||
"author": { | ||
"name": "Zoltan Kochan", | ||
"email": "z@kochan.io", | ||
"url": "https://www.kochan.io" | ||
}, | ||
"license": "MIT", | ||
"bugs": { | ||
"url": "https://github.com/pnpm/symlink-dir/issues" | ||
}, | ||
"homepage": "https://github.com/pnpm/symlink-dir#readme", | ||
"devDependencies": { | ||
"@types/node": "^16.18.3", | ||
"@types/tape": "^4.13.2", | ||
"mos": "^1.3.1", | ||
"mos-plugin-readme": "^1.0.4", | ||
"rimraf": "^3.0.2", | ||
"tape": "^5.6.1", | ||
"tempy": "^1.0.1", | ||
"ts-node": "^10.9.1", | ||
"typescript": "^4.9.3", | ||
"write-json-file": "^4.3.0" | ||
}, | ||
"dependencies": { | ||
"better-path-resolve": "^1.0.0", | ||
"rename-overwrite": "^4.0.3" | ||
}, | ||
"mos": { | ||
"plugins": [ | ||
"readme" | ||
], | ||
"installation": { | ||
"useShortAlias": true | ||
} | ||
}, | ||
"engines": { | ||
"node": ">=12.10" | ||
}, | ||
"scripts": { | ||
"pretest": "rimraf node_modules/src", | ||
"test": "ts-node test", | ||
"test-md": "mos t", | ||
"premd": "rimraf node_modules/src && npm run tsc", | ||
"md": "mos", | ||
"tsc": "rimraf dist && tsc" | ||
} | ||
} |
@@ -5,4 +5,4 @@ # symlink-dir | ||
<!--@shields('npm', 'travis', 'appveyor')--> | ||
[![npm version](https://img.shields.io/npm/v/symlink-dir.svg)](https://www.npmjs.com/package/symlink-dir) [![Build Status](https://img.shields.io/travis/zkochan/symlink-dir/master.svg)](https://travis-ci.org/zkochan/symlink-dir) [![Build Status on Windows](https://img.shields.io/appveyor/ci/zkochan/symlink-dir/master.svg)](https://ci.appveyor.com/project/zkochan/symlink-dir/branch/master) | ||
<!--@shields('npm')--> | ||
[![npm version](https://img.shields.io/npm/v/symlink-dir.svg)](https://www.npmjs.com/package/symlink-dir) | ||
<!--/@--> | ||
@@ -53,6 +53,10 @@ | ||
### `symlinkDir(src, dest): Promise<{ reused: boolean, warn?: string }>` | ||
### `symlinkDir(src, dest, opts?): Promise<{ reused: boolean, warn?: string }>` | ||
Creates a symlink in `dest` that points to `src`. | ||
Options: | ||
* `overwrite` - *boolean* - is `true` by default. When `false`, existing files at dest are not overwritten. | ||
Result: | ||
@@ -59,0 +63,0 @@ |
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
10627
97
68
Updatedrename-overwrite@^4.0.3