Open NewtonChutney opened 10 months ago
I wish the following syntax works:
Can you put the entire conditional in an interpolation? -
# justfile
scp folder target:
{{if folder == "plugins" { \
"scp -r ./plugins " + target + ":./dev" \
} \
else { \
"scp -r ./dags/" + folder + " " + target + ":./dev/dags" \
} }}
Can you put the entire conditional in an interpolation? -
Okay.. I'd say that solves the first half of the issue! ♥️
Have to check the output.. Will update
To make the bash version nicer, you can also do:
scp folder target:
!#/usr/bin/env bash
set -euxo pipefail
if [ "{{ folder }}" == "plugins" ]; then
scp -r ./plugins {{ target }}:./dev
else
scp -r ./dags/{{ folder }} {{ target }}:./dev/dags
fi
I couldn't find duplicate issues until 6 pages deep..
I work in airflow repos and the folder structure is as follows:
I wanted to make a simple just recipe for scp-ing each of those folders to a particular ssh target, given their names as arguments.
I wish the following syntax works:
Doing the same in bash like such gives a lengthy incomprehensible output:
Output of
just scp utils server
Also, I wish the preview is given when the confirm attribute is set instead of just
Run recipe 'scp'?
similar to--evaluate
Pun unintentional.. 😂