Fix auto-restore from stored optimization state file

This commit is contained in:
Slavi Pantaleev 2023-11-20 16:41:42 +02:00
parent 7d3bae4c4b
commit cbdf15440a

View file

@ -19,10 +19,10 @@ roles: _requirements-yml
# Optimizes the playbook based on stored configuration (vars.yml paths)
optimize-restore:
#!/usr/bin/env sh
if [ -f "$optimization_vars_files_file_path" ]; then
if [ -f "{{ optimization_vars_files_file_path }}" ]; then
just --justfile {{ justfile() }} \
_optimize-for-var-paths \
$(cat $optimization_vars_files_file_path)
$(cat {{ optimization_vars_files_file_path }})
else
echo "Cannot restore optimization state from a file ($optimization_vars_files_file_path), because it doesn't exist"
exit 1
@ -144,10 +144,10 @@ _ensure_file_prepared src_path dst_path:
cp {{ src_path }} {{ dst_path }}
echo $src_hash > $hash_path
if [ -f "$optimization_vars_files_file_path" ]; then
if [ -f "{{ optimization_vars_files_file_path }}" ]; then
just --justfile {{ justfile() }} \
_optimize-for-var-paths \
$(cat $optimization_vars_files_file_path)
$(cat {{ optimization_vars_files_file_path }})
fi
fi
fi