Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP
Browse files

Add unlink.iced -u to remove symlinks for win+Parallels

  • Loading branch information...
commit cc439e0fc1b60ac219eee79854f1f4499efd4c7e 1 parent 2bb7394
@andreyvit andreyvit authored
Showing with 14 additions and 5 deletions.
  1. +2 −1  scripts/package.json
  2. +12 −4 scripts/relink.iced
View
3  scripts/package.json
@@ -6,6 +6,7 @@
"dependencies": {
"underscore": "~1.4.4",
"rimraf": "~2.1.4",
- "mkdirp": "~0.3.4"
+ "mkdirp": "~0.3.4",
+ "dreamopt": "~0.8.0"
}
}
View
16 scripts/relink.iced
@@ -7,6 +7,7 @@ mkdirp = require 'mkdirp'
dirs = { node_modules: Path.join(Path.dirname(__dirname), 'node_modules') }
+
class Module
constructor: (@name, @path) ->
@packageJsonPath = Path.join(@path, 'package.json')
@@ -15,6 +16,12 @@ class Module
readPackageJson: ->
@info = JSON.parse(fs.readFileSync(@packageJsonPath, 'utf8'))
+options = require('dreamopt') [
+ "Usage: iced scripts/relink.iced [-u]"
+
+ " -u, --unlink Remove the symlinks and don't recreate them"
+]
+
modules =
for moduleName in fs.readdirSync(dirs.node_modules)
continue if moduleName is ".bin"
@@ -36,7 +43,7 @@ for module in modules
catch e
stats = null
- if stats and stats.isSymbolicLink()
+ if stats and stats.isSymbolicLink() and !options.unlink
console.log("%s: %s (exists)", module.info.name, depName)
else
@@ -47,6 +54,7 @@ for module in modules
else
rimraf.sync(depPath)
- console.log "%s: %s (symlinking)", module.info.name, depName
- mkdirp.sync(Path.dirname(depPath))
- fs.symlinkSync(depTargetPath, depPath)
+ unless options.unlink
+ console.log "%s: %s (symlinking)", module.info.name, depName
+ mkdirp.sync(Path.dirname(depPath))
+ fs.symlinkSync(depTargetPath, depPath)
Please sign in to comment.
Something went wrong with that request. Please try again.