mirror of
https://github.com/sigp/lighthouse.git
synced 2026-03-16 03:12:41 +00:00
remove troubleshooting part
This commit is contained in:
@@ -55,9 +55,12 @@ 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)
|
||||||
|
|
||||||
|
# store for troubleshooting purpose
|
||||||
exist=()
|
exist=()
|
||||||
update=()
|
update=()
|
||||||
diff=()
|
diff=()
|
||||||
|
|
||||||
|
# function to check
|
||||||
check() {
|
check() {
|
||||||
if [[ -f $1 ]]; # check for existence of file
|
if [[ -f $1 ]]; # check for existence of file
|
||||||
then
|
then
|
||||||
@@ -93,7 +96,7 @@ 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
|
# used for troubleshooting to show status
|
||||||
echo "exist = ${exist[@]}"
|
echo "exist = ${exist[@]}"
|
||||||
echo "changes = ${update[@]}"
|
echo "changes = ${update[@]}"
|
||||||
echo "difference = ${diff[@]}"
|
echo "difference = ${diff[@]}"
|
||||||
@@ -107,64 +110,3 @@ else
|
|||||||
exit 0
|
exit 0
|
||||||
fi
|
fi
|
||||||
|
|
||||||
|
|
||||||
: '
|
|
||||||
exist=()
|
|
||||||
changes=()
|
|
||||||
diff=()
|
|
||||||
check() {
|
|
||||||
if [[ -f $1 ]]; # check for existence of file
|
|
||||||
then
|
|
||||||
diff=$(diff $1 $2)
|
|
||||||
diff+=($diff)
|
|
||||||
exist+=(false)
|
|
||||||
else
|
|
||||||
cp $2 ./book/src
|
|
||||||
exist+=(true)
|
|
||||||
fi
|
|
||||||
|
|
||||||
if [[ -z $diff ]]; # check for difference
|
|
||||||
then
|
|
||||||
changes+=(false)
|
|
||||||
return 1 # exit a function (i.e., do nothing)
|
|
||||||
else
|
|
||||||
cp $2 ./book/src
|
|
||||||
changes+=(true)
|
|
||||||
fi
|
|
||||||
}
|
|
||||||
|
|
||||||
# define changes as false
|
|
||||||
# changes=false
|
|
||||||
# call check function to check for each help file
|
|
||||||
check ${old_files[0]} ${new_files[0]}
|
|
||||||
check ${old_files[1]} ${new_files[1]}
|
|
||||||
check ${old_files[2]} ${new_files[2]}
|
|
||||||
check ${old_files[3]} ${new_files[3]}
|
|
||||||
check ${old_files[4]} ${new_files[4]}
|
|
||||||
|
|
||||||
# remove help files
|
|
||||||
rm -f help_general.md help_bn.md help_vc.md help_am.md help_vm.md
|
|
||||||
|
|
||||||
echo "exist = ${exist[@]}"
|
|
||||||
echo "changes = ${changes[@]}"
|
|
||||||
echo "difference = ${diff[@]}"
|
|
||||||
|
|
||||||
|
|
||||||
if [[ ${exist[@]} == *"true"* && ${update[@]} == *"true"* ]];
|
|
||||||
then
|
|
||||||
echo "exit 1 due to one or more .md file does not exist and changes updated."
|
|
||||||
exit 1
|
|
||||||
elif [[ ${exist[@]} == *"true"* ]];
|
|
||||||
then
|
|
||||||
echo "exit 1 due to one or more .md file does not exist"
|
|
||||||
exit 1
|
|
||||||
elif [[ ${changes[@]} == *"true"* ]];
|
|
||||||
then
|
|
||||||
echo "exit 1 due to changes updated"
|
|
||||||
exit 1
|
|
||||||
else
|
|
||||||
echo "Task completed, no changes in CLI parameters"
|
|
||||||
fi
|
|
||||||
'
|
|
||||||
|
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user