Skip to content

Commit 975ed03

Browse files
committed
Test with package-lock.json as an output even for npm ci
1 parent 092f105 commit 975ed03

1 file changed

Lines changed: 2 additions & 6 deletions

File tree

src/main/kotlin/com/github/gradle/node/npm/task/NpmInstallTask.kt

Lines changed: 2 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -52,9 +52,7 @@ abstract class NpmInstallTask : NpmTask() {
5252
@Optional
5353
@InputFile
5454
protected fun getPackageLockFileAsInput(): File? {
55-
return npmCommand.flatMap { command ->
56-
if (command[0] == "ci") projectFileIfExists("package-lock.json") else providers.provider { null }
57-
}.orNull
55+
return projectFileIfExists("fake-file-dont-worry-just-a-test").orNull
5856
}
5957

6058
@PathSensitive(RELATIVE)
@@ -67,9 +65,7 @@ abstract class NpmInstallTask : NpmTask() {
6765
@Optional
6866
@OutputFile
6967
protected fun getPackageLockFileAsOutput(): File? {
70-
return npmCommand.flatMap { command ->
71-
if (command[0] == "install") projectFileIfExists("package-lock.json") else providers.provider { null }
72-
}.orNull
68+
return projectFileIfExists("package-lock.json").orNull
7369
}
7470

7571
private fun projectFileIfExists(name: String): Provider<File?> {

0 commit comments

Comments
 (0)