basepath=$(cd `dirname $0`; pwd) cd $basepath source cgrpcrecreate.sh echo "---1---" find . -type f -name "*.go"|grep -v "/local/"|grep -v "/api/"|grep -v "/daemon/"|grep -v "/business/"|grep -v "/business/"|grep -v "/ggrpcprotos/"|grep -v "/ggrpcs/"|xargs grep -E "type\s+(\w+)\s+struct" |sed "s@\./@@g"|sed "s@\.pb\.go@.go@g"|awk -F "." '{print $1}'|awk -F "/" '{print $NF;$NF="";print $0}'|tr ' ' '.'|sed 's@ggrpcprotos.@@g'|xargs -n 2 bash -c "[ \"\$1\" != \"cc.\" ] && (grep \$1\$0 all/AllStructs.go || sed -i '' \"s/}\s*$/ \\\"\$1\$0\\\": \$1\$0{},\n}\n/g\" all/AllStructs.go) " echo "---2---" find . -type f -name "*.go"|grep "/api/"|xargs grep -HE "type\s+(\w+)\s+struct" |sed "s@\./@@g"|sed "s@\.pb\.go@.go@g"|awk -F "." '{print $1}'|awk -F "/" '{print $NF;$NF="";print $0}'|tr ' ' '.'|sed 's@ggrpcprotos.@@g'|xargs -n 2 bash -c "[ \"\$1\" != \"cc.\" ] && (grep \$1\$0 allwebs/AllWebs.go || sed -i '' \"s/}\s*$/ \\\"\$1\$0\\\": \$1\$0{},\n}\n/g\" allwebs/AllWebs.go) " echo "---3---" find . -type f -name "*.go"|grep "/business/"|xargs grep -HE "type\s+(\w+)\s+struct" |sed "s@\./@@g"|sed "s@\.pb\.go@.go@g"|awk -F "." '{print $1}'|awk -F "/" '{print $NF;$NF="";print $0}'|tr ' ' '.'|sed 's@ggrpcprotos.@@g'|xargs -n 2 bash -c "[ \"\$1\" != \"cc.\" ] && (grep \$1\$0 allbusinesses/AllBusinesses.go || sed -i '' \"s/}\s*$/ \\\"\$1\$0\\\": \$1\$0{},\n}\n/g\" allbusinesses/AllBusinesses.go) " echo "---4---" echo "---5---" find . -type f -name "*.go"|xargs grep -E "type\s+(\w+)\s+interface" |sed "s@\./@@g"|sed "s@\.pb\.go@.go@g"|awk -F "[ /]" '{print $(NF-4);print $(NF-2);print $(NF-4)"."$(NF-2)}'|xargs -n 3 bash -c "grep \$2 all/AllInterfaces.go || sed -i '' \"s/}\s*$/ \\\"\$2\\\":\treflect.TypeOf((* \$2)(nil)),\n}/g\" all/AllInterfaces.go " echo "---6---" echo "---7---" echo "---8---" echo "---10---" ls .. exit 0 go mod tidy i=1 ~/go/bin/gopls imports all/AllInterfaces.go > /tmp/$i.txt cat /tmp/$i.txt >all/AllInterfaces.go ((i++)) ~/go/bin/gopls imports all/AllStructs.go > /tmp/$i.txt cat /tmp/$i.txt >all/AllStructs.go ((i++)) ~/go/bin/gopls imports allwebs/AllWebs.go > /tmp/$i.txt cat /tmp/$i.txt >allwebs/AllWebs.go ((i++)) ~/go/bin/gopls imports allbusinesses/AllBusinesses.go > /tmp/$i.txt cat /tmp/$i.txt >allbusinesses/AllBusinesses.go ((i++))