1415e46eaSLoGin#!/bin/bash 2415e46eaSLoGin 3*7b0ef108SLoGinCONFIG_FILE=~/.cargo/config.toml 4*7b0ef108SLoGin 5*7b0ef108SLoGinchange_rust_src_to_official() { 6*7b0ef108SLoGinecho -e "[source.crates-io] \n \ 7*7b0ef108SLoGinregistry = \"sparse+https://index.crates.io/\" \n \ 8*7b0ef108SLoGin[net] \n \ 9*7b0ef108SLoGingit-fetch-with-cli = true \n \ 10*7b0ef108SLoGin" > $CONFIG_FILE 11*7b0ef108SLoGin} 12*7b0ef108SLoGin 13*7b0ef108SLoGin# Check if the GITHUB_WORKFLOW environment variable is set and not empty 14*7b0ef108SLoGinif [ -n "$GITHUB_ACTION" ]; then 15*7b0ef108SLoGin change_rust_src_to_official 16*7b0ef108SLoGinfi 17*7b0ef108SLoGin 18*7b0ef108SLoGin 19415e46eaSLoGinexec "$@" 20