Skip to content

Commit 9334871

Browse files
authored
Merge pull request #87 from nelsonjr/copy_folder
Allow restoring directories
2 parents fc41bd5 + 0a97226 commit 9334871

File tree

1 file changed

+5
-1
lines changed

1 file changed

+5
-1
lines changed

backends/cache_fs

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -22,7 +22,11 @@ restore_cache() {
2222
# shellcheck disable=2064 # actually want variable interpolated here
2323
trap "release_lock_folder '${from}'" SIGINT SIGTERM SIGQUIT
2424

25-
cp -a "$from" "$to"
25+
if [ -d "$from" ]; then
26+
cp -a "${from}/." "$to" # copy as folder
27+
else
28+
cp -a "$from" "$to"
29+
fi
2630

2731
release_lock "${from}"
2832
}

0 commit comments

Comments
 (0)