mirror of
https://github.com/julia-actions/cache.git
synced 2026-02-12 09:26:53 +08:00
Expand paths which use tilde (#141)
This commit is contained in:
@@ -66,6 +66,7 @@ runs:
|
|||||||
else
|
else
|
||||||
depot="~/.julia"
|
depot="~/.julia"
|
||||||
fi
|
fi
|
||||||
|
depot="${depot/#\~/$HOME}" # Expand tilde which cannot be used in BASH checks (i.e. `[ -d "~/.julia" ]` fails)
|
||||||
echo "depot=$depot" | tee -a "$GITHUB_OUTPUT"
|
echo "depot=$depot" | tee -a "$GITHUB_OUTPUT"
|
||||||
|
|
||||||
cache_paths=()
|
cache_paths=()
|
||||||
@@ -75,7 +76,7 @@ runs:
|
|||||||
[ "${{ inputs.cache-packages }}" = "true" ] && cache_paths+=("$packages_path")
|
[ "${{ inputs.cache-packages }}" = "true" ] && cache_paths+=("$packages_path")
|
||||||
registries_path="${depot}/registries"
|
registries_path="${depot}/registries"
|
||||||
if [ "${{ inputs.cache-registries }}" = "true" ]; then
|
if [ "${{ inputs.cache-registries }}" = "true" ]; then
|
||||||
if [ ! -d "${registries_path/#\~/$HOME}" ]; then
|
if [ ! -d "${registries_path}" ]; then
|
||||||
cache_paths+=("$registries_path")
|
cache_paths+=("$registries_path")
|
||||||
else
|
else
|
||||||
echo "::warning::Julia depot registries already exist. Skipping restoring of cached registries to avoid potential merge conflicts when updating. Please ensure that \`julia-actions/cache\` precedes any workflow steps which add registries."
|
echo "::warning::Julia depot registries already exist. Skipping restoring of cached registries to avoid potential merge conflicts when updating. Please ensure that \`julia-actions/cache\` precedes any workflow steps which add registries."
|
||||||
|
|||||||
Reference in New Issue
Block a user