X-Git-Url: https://git.madduck.net/code/vcsh.git/blobdiff_plain/09f129a260f5347219b8ac84c6f2204fa2b0d9a6..6cfdf9d7b757f247a38c3b3513fb7956e6931b45:/vcsh diff --git a/vcsh b/vcsh index 508c087..da71ab8 100755 --- a/vcsh +++ b/vcsh @@ -24,7 +24,7 @@ basename() { } SELF=$(basename $0) -VERSION='1.20130909' +VERSION='1.20130909.git-HEAD' fatal() { echo "$SELF: fatal: $1" >&2 @@ -365,7 +365,11 @@ write_gitignore() { file="$new" done; done | sort -u) - tempfile=$(mktemp) || fatal "could not create tempfile" 51 + + # Contrary to GNU mktemp, mktemp on BSD/OSX requires a template for temp files + # Use the template GNU mktemo defaults to + tempfile=$(mktemp tmp.XXXXXXXXXX) || fatal "could not create tempfile" 51 + echo '*' > "$tempfile" || fatal "could not write to '$tempfile'" 57 for gitignore in $gitignores; do echo "$gitignore" | sed 's@^@!/@' >> "$tempfile" || fatal "could not write to '$tempfile'" 57