From 5a392ad45968da29c341404116fa907d41756b2c Mon Sep 17 00:00:00 2001 From: Finn Petersen Date: Fri, 1 Feb 2019 09:04:50 +0100 Subject: [PATCH] Relativize symlink to npmScriptFile This way the downloaded node install can also be used where the filesystem mapping is different, eg. in a docker container. --- src/main/groovy/com/moowork/gradle/node/task/SetupTask.groovy | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/src/main/groovy/com/moowork/gradle/node/task/SetupTask.groovy b/src/main/groovy/com/moowork/gradle/node/task/SetupTask.groovy index 01ff719..417199c 100644 --- a/src/main/groovy/com/moowork/gradle/node/task/SetupTask.groovy +++ b/src/main/groovy/com/moowork/gradle/node/task/SetupTask.groovy @@ -135,7 +135,9 @@ class SetupTask Path npm = Paths.get( variant.nodeBinDir.path, 'npm' ) if ( Files.deleteIfExists( npm ) ) { - Files.createSymbolicLink( npm, Paths.get( variant.npmScriptFile ) ) + Files.createSymbolicLink( + npm, + variant.nodeBinDir.toPath().relativize(Paths.get(variant.npmScriptFile))) } } }