Skip to content

Commit 8f52842

Browse files
committed
fix dry-run on pack tasks
1 parent f3702ac commit 8f52842

File tree

1 file changed

+6
-3
lines changed

1 file changed

+6
-3
lines changed

npm-publish-gradle-plugin/src/main/kotlin/task/NpmPackTask.kt

Lines changed: 6 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -87,8 +87,11 @@ public abstract class NpmPackTask : NpmExecTask() {
8787
if (d) add("--dry-run")
8888
}
8989
npmExec(args) { it.workingDir(tmpDir) }.rethrowFailure()
90-
val outFile = tmpDir.listFiles()?.firstOrNull() ?: error("Internal error. Temporary packed file not found.")
91-
outFile.copyTo(oDir, true)
92-
if (!d) info { "Packed package at ${pDir.path} to ${oDir.path}" }
90+
if (!d) {
91+
val outFile =
92+
tmpDir.listFiles()?.firstOrNull() ?: error("[npm-publish] Internal error. Temporary packed file not found.")
93+
outFile.copyTo(oDir, true)
94+
info { "Packed package at ${pDir.path} to ${oDir.path}" }
95+
}
9396
}
9497
}

0 commit comments

Comments
 (0)