Skip to content

Commit

Permalink
Fix npm version
Browse files Browse the repository at this point in the history
  • Loading branch information
tuomas2 committed Jan 14, 2023
1 parent e6a057c commit b8d8246
Showing 1 changed file with 3 additions and 2 deletions.
5 changes: 3 additions & 2 deletions app/build.gradle.kts
Original file line number Diff line number Diff line change
Expand Up @@ -62,17 +62,18 @@ fun getGitDescribe(): String = ByteArrayOutputStream().use { stdout ->
return stdout.toString().trim()
}

val npmVersion = "9.1.2"

val npmUpgrade by tasks.registering(Exec::class) {
inputs.file("$jsDir/package.json")
outputs.file("$jsDir/node_modules/.bin/npm")
workingDir = file(jsDir)
// Workaround for F-droid, which has buggy npm version 5.8, that always fails when installing packages.
if (System.getProperty("os.name").toLowerCase(Locale.ROOT).contains("windows")) {
commandLine("npx.cmd", "npm@latest", "ci", "--save-dev", "npm@latest")
commandLine("npx.cmd", "npm@${npmVersion}", "ci", "--save-dev", "npm@${npmVersion}")
}
else {
commandLine("npx", "npm@latest", "ci", "--save-dev", "npm@latest")
commandLine("npx", "npm@${npmVersion}", "ci", "--save-dev", "npm@${npmVersion}")
}
}

Expand Down

0 comments on commit b8d8246

Please sign in to comment.