Browse Source

fix: dev: [compose-core] minor improvement against unintended option to ``echo`` !minor

Signed-off-by: Valentin Lab <valentin.lab@kalysto.org>
master
Valentin Lab 2 years ago
parent
commit
de940f402e
  1. 6
      bin/compose-core

6
bin/compose-core

@ -2836,7 +2836,7 @@ get_relation_data_file() {
new= new=
if [ -e "$relation_data_file" ]; then if [ -e "$relation_data_file" ]; then
## Has reference changed ? ## Has reference changed ?
new_md5=$(echo "$relation_config" | md5_compat)
new_md5=$(e "$relation_config" | md5_compat)
if [ "$new_md5" != "$(cat "$relation_data_file.md5_ref" 2>/dev/null)" ]; then if [ "$new_md5" != "$(cat "$relation_data_file.md5_ref" 2>/dev/null)" ]; then
new=true new=true
fi fi
@ -2845,9 +2845,9 @@ get_relation_data_file() {
fi fi
if [ "$new" ]; then if [ "$new" ]; then
echo "$relation_config" > "$relation_data_file"
e "$relation_config" > "$relation_data_file"
chmod go-rwx "$relation_data_file" ## protecting this file chmod go-rwx "$relation_data_file" ## protecting this file
echo "$relation_config" | md5_compat > "$relation_data_file.md5_ref"
e "$relation_config" | md5_compat > "$relation_data_file.md5_ref"
fi fi
echo "$relation_data_file" echo "$relation_data_file"
} }

Loading…
Cancel
Save