From 5bbcedd7d87fbbfcf21f26c61ea4e0f0603e4398 Mon Sep 17 00:00:00 2001 From: Tadeas Palusga Date: Mon, 5 Jun 2023 22:44:31 +0200 Subject: [PATCH] Update NodePlugin.kt The addPnpmRule should use the same logic as addNpmRule. It should create (and not only register) the task. --- src/main/kotlin/com/github/gradle/node/NodePlugin.kt | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/main/kotlin/com/github/gradle/node/NodePlugin.kt b/src/main/kotlin/com/github/gradle/node/NodePlugin.kt index ff10e2a1..662314a2 100644 --- a/src/main/kotlin/com/github/gradle/node/NodePlugin.kt +++ b/src/main/kotlin/com/github/gradle/node/NodePlugin.kt @@ -118,11 +118,11 @@ class NodePlugin : Plugin { } } - private fun addPnpmRule(enableTaskRules: Property) { // note this rule also makes it possible to specify e.g. "dependsOn npm_install" + private fun addPnpmRule(enableTaskRules: Property) { // note this rule also makes it possible to specify e.g. "dependsOn pnpm_install" project.tasks.addRule("Pattern: \"pnpm_\": Executes an PNPM command.") { val taskName = this if (taskName.startsWith("pnpm_") && enableTaskRules.get()) { - project.tasks.register(taskName) { + project.tasks.create(taskName) { val tokens = taskName.split("_").drop(1) // all except first pnpmCommand.set(tokens) if (tokens.first().equals("run", ignoreCase = true)) {