mirror of
https://github.com/sigp/lighthouse.git
synced 2026-05-02 04:03:35 +00:00
add exist and update for future debug
This commit is contained in:
@@ -55,21 +55,29 @@ write_to_file "$vm_cli" "$vm" "Validator Manager"
|
|||||||
old_files=(./book/src/help_general.md ./book/src/help_bn.md ./book/src/help_vc.md ./book/src/help_am.md ./book/src/help_vm.md)
|
old_files=(./book/src/help_general.md ./book/src/help_bn.md ./book/src/help_vc.md ./book/src/help_am.md ./book/src/help_vm.md)
|
||||||
new_files=($general $bn $vc $am $vm)
|
new_files=($general $bn $vc $am $vm)
|
||||||
|
|
||||||
|
exist=()
|
||||||
|
update=()
|
||||||
|
diff=()
|
||||||
check() {
|
check() {
|
||||||
if [[ -f $1 ]]; # check for existence of file
|
if [[ -f $1 ]]; # check for existence of file
|
||||||
then
|
then
|
||||||
diff=$(diff $1 $2)
|
diff=$(diff $1 $2)
|
||||||
|
diff+=($diff)
|
||||||
|
exist+=(false)
|
||||||
else
|
else
|
||||||
cp $2 ./book/src
|
cp $2 ./book/src
|
||||||
changes=true
|
changes=true
|
||||||
|
exist+=(true)
|
||||||
fi
|
fi
|
||||||
|
|
||||||
if [[ -z $diff ]]; # check for difference
|
if [[ -z $diff ]]; # check for difference
|
||||||
then
|
then
|
||||||
|
update+=(false)
|
||||||
return 1 # exit a function (i.e., do nothing)
|
return 1 # exit a function (i.e., do nothing)
|
||||||
else
|
else
|
||||||
cp $2 ./book/src
|
cp $2 ./book/src
|
||||||
changes=true
|
changes=true
|
||||||
|
update+=(true)
|
||||||
fi
|
fi
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -85,6 +93,11 @@ check ${old_files[4]} ${new_files[4]}
|
|||||||
# remove help files
|
# remove help files
|
||||||
rm -f help_general.md help_bn.md help_vc.md help_am.md help_vm.md
|
rm -f help_general.md help_bn.md help_vc.md help_am.md help_vm.md
|
||||||
|
|
||||||
|
# used for debug to show status
|
||||||
|
echo "exist = ${exist[@]}"
|
||||||
|
echo "changes = ${changes[@]}"
|
||||||
|
echo "difference = ${diff[@]}"
|
||||||
|
|
||||||
# only exit at the very end
|
# only exit at the very end
|
||||||
if [[ $changes == true ]]; then
|
if [[ $changes == true ]]; then
|
||||||
echo "CLI parameters are not up to date. Run \"make cli\" to update, then commit the changes"
|
echo "CLI parameters are not up to date. Run \"make cli\" to update, then commit the changes"
|
||||||
|
|||||||
Reference in New Issue
Block a user