Skip to content

Commit

Permalink
Fix #1152: Copy npm script file
Browse files Browse the repository at this point in the history
  • Loading branch information
melloware authored and eirslett committed Sep 9, 2024
1 parent 622ac16 commit 2750625
Showing 1 changed file with 12 additions and 1 deletion.
Original file line number Diff line number Diff line change
Expand Up @@ -201,7 +201,18 @@ private void installNodeDefault() throws InstallationException {
for (String script : Arrays.asList("npm", "npm.cmd")) {
File scriptFile = new File(npmDirectory, "bin" + File.separator + script);
if (scriptFile.exists()) {
scriptFile.setExecutable(true);
File copy = new File(destinationDirectory, script);
if (!copy.exists()) {
try
{
FileUtils.copyFile(scriptFile, copy);
}
catch (IOException e)
{
throw new InstallationException("Could not copy npm", e);
}
copy.setExecutable(true);
}
}
}
}
Expand Down

0 comments on commit 2750625

Please sign in to comment.