grunt-contrib-symlink
Advanced tools
Comparing version 0.2.0 to 0.3.0
{ | ||
"name": "grunt-contrib-symlink", | ||
"description": "Create symbolic links.", | ||
"version": "0.2.0", | ||
"version": "0.3.0", | ||
"homepage": "https://github.com/gruntjs/grunt-contrib-symlink", | ||
@@ -23,3 +23,2 @@ "author": { | ||
], | ||
"main": "Gruntfile.js", | ||
"engines": { | ||
@@ -36,3 +35,4 @@ "node": ">= 0.8.0" | ||
"grunt-contrib-internal": "~0.4.5", | ||
"grunt": "~0.4.1" | ||
"grunt": "~0.4.1", | ||
"grunt-contrib-copy": "~0.4.1" | ||
}, | ||
@@ -49,3 +49,7 @@ "peerDependencies": { | ||
"symbolic" | ||
], | ||
"files": [ | ||
"tasks", | ||
"LICENSE-MIT" | ||
] | ||
} |
@@ -1,2 +0,2 @@ | ||
# grunt-contrib-symlink | ||
# grunt-contrib-symlink v0.3.0 | ||
@@ -37,2 +37,6 @@ > Create symbolic links. | ||
symlink: { | ||
// Enable overwrite to delete symlinks before recreating them | ||
options: { | ||
overwrite: false | ||
}, | ||
// The "build/target.txt" symlink will be created and linked to | ||
@@ -54,2 +58,3 @@ // "source/target.txt". It should appear like this in a file listing: | ||
expand: true, | ||
overwrite: false, | ||
cwd: 'source', | ||
@@ -63,2 +68,3 @@ src: ['foo-*'], | ||
expand: true, | ||
overwrite: false, | ||
cwd: 'source', | ||
@@ -74,5 +80,19 @@ src: ['*'], | ||
#### CLI overwrite option | ||
To override the overwrite option via the CLI pass it as an option | ||
```shell | ||
grunt symlink --overwrite | ||
``` | ||
#### Usage tips on Microsoft Windows | ||
Make sure your command prompt has administrative privileges, otherwise | ||
the task will not work. | ||
## Release History | ||
* 2014-02-01 v0.3.0 Fixed symlinking to '.' Add Windows usage hints. Added error logging and force failure when unable to create a symlink | ||
* 2013-07-26 v0.2.0 Initial release as rewritten, officially-maintained, contrib plugin. | ||
@@ -86,2 +106,2 @@ * 2012-12-21 v0.1.1 Unofficial release. | ||
*This file was generated on Mon Jul 29 2013 12:12:23.* | ||
*This file was generated on Sat Feb 01 2014 23:58:37.* |
@@ -19,2 +19,11 @@ /* | ||
var linkCount = 0; | ||
// default options | ||
var options = this.options({ | ||
overwrite: false | ||
}); | ||
// overwrite options from CLI | ||
options.overwrite = grunt.option('overwrite') || options.overwrite; | ||
this.files.forEach(function(f) { | ||
@@ -27,4 +36,7 @@ var srcpath = f.src[0]; | ||
} else if (grunt.file.exists(destpath)) { | ||
grunt.log.warn('Destination ' + destpath + ' already exists.'); | ||
return; | ||
if (!options.overwrite) { | ||
grunt.log.warn('Destination ' + destpath + ' already exists.'); | ||
return; | ||
} | ||
grunt.file.delete(destpath); | ||
} | ||
@@ -37,3 +49,3 @@ // Strip any trailing slashes. | ||
if (!grunt.file.isPathAbsolute(srcpath)) { | ||
srcpath = path.relative(destdir, srcpath); | ||
srcpath = path.relative(destdir, srcpath) || '.'; | ||
} | ||
@@ -52,2 +64,4 @@ // Create any necessary interim directories. | ||
grunt.verbose.error(); | ||
grunt.log.error(e); | ||
grunt.fail.warn('Failed to create symlink: ' + '(' + mode + ') ' + destpath + ' -> ' + srcpath + '.'); | ||
} | ||
@@ -54,0 +68,0 @@ linkCount++; |
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
New author
Supply chain riskA new npm collaborator published a version of the package for the first time. New collaborators are usually benign additions to a project, but do indicate a change to the security surface area of a package.
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
Major refactor
Supply chain riskPackage has recently undergone a major refactor. It may be unstable or indicate significant internal changes. Use caution when updating to versions that include significant changes.
Found 1 instance in 1 package
New author
Supply chain riskA new npm collaborator published a version of the package for the first time. New collaborators are usually benign additions to a project, but do indicate a change to the security surface area of a package.
Found 1 instance in 1 package
103
1
7602
6
4
61