Use TMP_DIR for calls

This commit is contained in:
2025-10-07 14:54:09 +02:00
parent 6c7e7f496b
commit 420e50f23a
2 changed files with 3 additions and 2 deletions

View File

@@ -36,6 +36,7 @@ object Main {
logger.debug(s"Subcommand requires ${tasks.size} tasks")
try {
tasks.foreach(_.run())
c.cleanup()
} catch {
case e: AssertException =>
logger.error(s"Error during task execution, see above!")
@@ -43,7 +44,6 @@ object Main {
logger.error(s"General exception ${e.getMessage}")
e.printStackTrace()
}
c.cleanup()
case _ =>
logger.error(s"Found no subcommand, see help below")
conf.printHelp()

View File

@@ -1,5 +1,6 @@
package com.minres.tgc.hammer.tasks
import com.minres.tgc.hammer.Global.TMP_DIR
import com.minres.tgc.hammer.Main
import com.minres.tgc.hammer.util.Logging
import os.{Path, Shellable}
@@ -26,6 +27,6 @@ trait TaskImpl[T <: Task : ClassTag] extends Task with Logging[T] {
os.Inherit
else
logFile
os.proc("bash", "-c", command).call(stdout = output)
os.proc("bash", "-c", command).call(cwd = TMP_DIR, stdout = output)
}
}