mirror of
https://github.com/awalsh128/cache-apt-pkgs-action.git
synced 2024-12-22 18:55:30 +00:00
Full qualify paths.
This commit is contained in:
parent
6c13cf414f
commit
e558e74c19
|
@ -9,11 +9,16 @@ cache_dir=$1
|
|||
# Typically filesystem root '/' but can be changed for testing.
|
||||
cache_restore_root=$2
|
||||
|
||||
for cache_filepath in $(ls $cache_dir); do
|
||||
cache_filenames=$(ls -1 $cache_dir | sort)
|
||||
echo "* Found ${#cache_filenames[@]} files in cache..."
|
||||
echo $cache_filenames
|
||||
|
||||
for cache_filename in $cache_filenames; do
|
||||
cache_filepath=$cache_dir/$cache_filename
|
||||
echo "* Restoring $cache_filepath from cache... "
|
||||
sudo tar -xf $cache_filepath -C $cache_restore_root
|
||||
done
|
||||
# Update all packages.
|
||||
sudo apt-get --yes --only-upgrade install
|
||||
|
||||
echo "Action complete. $(ls -l $cache_dir | wc -l) package(s) restored."
|
||||
echo "Action complete. $(echo $cache_filenames | wc -l) package(s) restored."
|
||||
|
|
Loading…
Reference in a new issue