Skip to content

Commit

Permalink
Diminish the notion of prelude #84 : get rid of tmp files
Browse files Browse the repository at this point in the history
  • Loading branch information
xonixx committed Dec 8, 2021
1 parent 78ed6ac commit 06c7c4c
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 9 deletions.
14 changes: 7 additions & 7 deletions Makesurefile
Original file line number Diff line number Diff line change
Expand Up @@ -62,7 +62,7 @@
function run_tush_file() {
local f="$1"

before_count=$(calc_temp_files)
# before_count=$(calc_temp_files)

export PATH="$PATH:$MYDIR/soft/tush/bin"
export NEXT_VERSION
Expand All @@ -74,12 +74,12 @@
echo >&2 "!!! TESTS FAILED !!! : $f"
exit 1
fi
after_count=$(calc_temp_files)
if (( before_count != after_count ))
then
echo >&2 "!!! temp file not deleted !!!"
exit 1
fi
# after_count=$(calc_temp_files)
# if (( before_count != after_count ))
# then
# echo >&2 "!!! temp file not deleted !!!"
# exit 1
# fi
}
function calc_temp_files {
local tmp_count=$(find /tmp -maxdepth 1 -type f -name 'makesure.*' | wc -l)
Expand Down
2 changes: 0 additions & 2 deletions makesure.awk
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,6 @@ BEGIN {
SupportedOptions["tracing"]
SupportedOptions["silent"]
SupportedOptions["timing"]
Tmp = isDir("/dev/shm") ? "/dev/shm" : "/tmp"
split("",Lines)
split("",Args) # parsed CLI args
split("",ArgGoals) # invoked goals
Expand Down Expand Up @@ -762,7 +761,6 @@ function arrLast(arr) { return arr[arrLen(arr)-1] }
function commandExists(cmd) { return ok("command -v " cmd " >/dev/null") }
function ok(cmd) { return system(cmd) == 0 }
function isFile(path) { return ok("test -f " quoteArg(path)) }
function isDir(path) { return ok("test -d " quoteArg(path)) }
function rm(f) { system("rm " quoteArg(f)) }
function quoteArg(a) { gsub("'", "'\\''", a); return "'" a "'" }
function trim(s) { sub(/^[ \t\r\n]+/, "", s); sub(/[ \t\r\n]+$/, "", s); return s }
Expand Down

0 comments on commit 06c7c4c

Please sign in to comment.