File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree Original file line number Diff line number Diff line change @@ -37,14 +37,32 @@ init() {
3737 export VOLO_DIR=" $PWD "
3838 echo_command cargo build -p volo-cli
3939 export VOLO_CLI=" $PWD /target/debug/volo"
40+ detect_pilota_branch
41+ }
42+
43+ detect_pilota_branch () {
44+ local cargo_toml=" $VOLO_DIR /Cargo.toml"
45+
46+ if grep -q ' ^\[patch\.crates-io\]' " $cargo_toml " ; then
47+ local pilota_line=$( sed -n ' /^\[patch\.crates-io\]/,/^\[/p' " $cargo_toml " | grep ' ^pilota[[:space:]]*=' | grep ' branch[[:space:]]*=' | head -n 1)
48+
49+ if [ -n " $pilota_line " ]; then
50+ export PILOTA_BRANCH=$( echo " $pilota_line " | sed -n ' s/.*branch[[:space:]]*=[[:space:]]*"\([^"]*\)".*/\1/p' )
51+ echo " Detected pilota patch: branch = $PILOTA_BRANCH "
52+ return
53+ fi
54+ fi
55+
56+ export PILOTA_BRANCH=" main"
57+ echo " No pilota patch detected, using default: branch = main"
4058}
4159
4260append_volo_dep_item () {
4361 echo " $1 = { path = \" $VOLO_DIR /$1 \" }" >> Cargo.toml
4462}
4563
4664append_pilota_dep_item () {
47- echo " $1 = { git = \" https://github.com/cloudwego/pilota.git\" , branch = \" main \" }" >> Cargo.toml
65+ echo " $1 = { git = \" https://github.com/cloudwego/pilota.git\" , branch = \" $PILOTA_BRANCH \" }" >> Cargo.toml
4866}
4967
5068patch_cargo_toml () {
You can’t perform that action at this time.
0 commit comments