aboutsummaryrefslogtreecommitdiff
path: root/sbodl
diff options
context:
space:
mode:
authorB. Watson <yalhcru@gmail.com>2022-03-10 15:08:24 -0500
committerB. Watson <yalhcru@gmail.com>2022-03-10 15:08:43 -0500
commit09c600b7a253f5b1714ae26810e53156f10f40ee (patch)
treeb11eb100097c5e6f9283e1e72006ec3d2060f14d /sbodl
parent12f4c9554b536b441d3ff873ae6661b906f8c4ea (diff)
downloadsbostuff-09c600b7a253f5b1714ae26810e53156f10f40ee.tar.gz
sbrun: rename old build.log to build.log.old instead of deleting, sbodl: always cache file if it exists already
Diffstat (limited to 'sbodl')
-rwxr-xr-xsbodl6
1 files changed, 5 insertions, 1 deletions
diff --git a/sbodl b/sbodl
index 43eacde..42623c2 100755
--- a/sbodl
+++ b/sbodl
@@ -90,7 +90,11 @@ for dl in $DL; do
[ "$FORCEDL" = "yes" ] && rm -f "$FILE"
- if [ -e "$FILE" ]; then
+ if [ -f "$FILE" -a ! -L "$FILE" ]; then
+ # file exists and is a regular file, cache it
+ mv -b "$FILE" "$CACHEDIR"
+ ln -s "$CACHEDIR/$FILE" "$FILE"
+ elif [ -e "$FILE" ]; then
# don't do anything
:
elif [ "$FORCEDL" != "yes" ] && [ -e "$CACHEDIR/$FILE" ]; then