mirror of
https://github.com/tw93/Mole.git
synced 2026-02-07 07:05:47 +00:00
Fix support for BSD and GNU mktemp
This commit is contained in:
@@ -288,9 +288,12 @@ register_temp_dir() {
|
||||
}
|
||||
|
||||
# Create temp file with prefix (for analyze.sh compatibility)
|
||||
# Compatible with both BSD mktemp (macOS default) and GNU mktemp (coreutils)
|
||||
mktemp_file() {
|
||||
local prefix="${1:-mole}"
|
||||
mktemp -t "$prefix"
|
||||
# Use TMPDIR if set, otherwise /tmp
|
||||
# Add .XXXXXX suffix to work with both BSD and GNU mktemp
|
||||
mktemp "${TMPDIR:-/tmp}/${prefix}.XXXXXX"
|
||||
}
|
||||
|
||||
# Cleanup all tracked temp files and directories
|
||||
|
||||
Reference in New Issue
Block a user