Skip to content

Commit dc85a4e

Browse files
committed
refactoring
1 parent 10f2a78 commit dc85a4e

File tree

1 file changed

+4
-4
lines changed

1 file changed

+4
-4
lines changed

usr/libexec/helper-scripts/temp.sh

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -18,7 +18,7 @@ check_tempdir() {
1818
tmpdir_expected="/tmp/user/${id_of_user}"
1919
true "TMPDIR: $TMPDIR"
2020

21-
if [ "$TMPDIR" != "$tmpdir_expected" ]; then
21+
if ! [ "$TMPDIR" = "$tmpdir_expected" ]; then
2222
printf "%s\n" "ERROR: tmpdir_expected '$tmpdir_expected' does not match TMPDIR '$TMPDIR'!" >&2
2323
return 1
2424
fi
@@ -34,13 +34,13 @@ check_tempdir() {
3434
fi
3535

3636
## 'sponge' can cause error "mkstemp failed: No such file or directory" when $TMPDIR does not exist.
37-
if ! printf "%s\n" "test" | sponge "$temp_file" ; then
37+
if ! printf "%s\n" "test" | sponge -- "$temp_file" ; then
3838
printf "%s\n" "ERROR: Testing 'sponge' failed!" >&2
3939
return 1
4040
fi
4141

42-
if ! safe-rm -f "$temp_file" ; then
43-
printf "%s\n" "ERROR: 'safe-rm -f $temp_file' failed!" >&2
42+
if ! safe-rm --force -- "$temp_file" ; then
43+
printf "%s\n" "ERROR: 'safe-rm --force -- $temp_file' failed!" >&2
4444
return 1
4545
fi
4646

0 commit comments

Comments
 (0)