Skip to content

Commit

Permalink
fix dry-run on pack tasks
Browse files Browse the repository at this point in the history
  • Loading branch information
mpetuska committed May 1, 2023
1 parent f3702ac commit 8f52842
Showing 1 changed file with 6 additions and 3 deletions.
9 changes: 6 additions & 3 deletions npm-publish-gradle-plugin/src/main/kotlin/task/NpmPackTask.kt
Original file line number Diff line number Diff line change
Expand Up @@ -87,8 +87,11 @@ public abstract class NpmPackTask : NpmExecTask() {
if (d) add("--dry-run")
}
npmExec(args) { it.workingDir(tmpDir) }.rethrowFailure()
val outFile = tmpDir.listFiles()?.firstOrNull() ?: error("Internal error. Temporary packed file not found.")
outFile.copyTo(oDir, true)
if (!d) info { "Packed package at ${pDir.path} to ${oDir.path}" }
if (!d) {
val outFile =
tmpDir.listFiles()?.firstOrNull() ?: error("[npm-publish] Internal error. Temporary packed file not found.")
outFile.copyTo(oDir, true)
info { "Packed package at ${pDir.path} to ${oDir.path}" }
}
}
}

0 comments on commit 8f52842

Please sign in to comment.