xref: /DragonOS/tools/docker-entrypoint.sh (revision 20c58101dda979c0df4ab3f76f21555464cdfeeb)
1#!/bin/bash
2
3CONFIG_FILE=~/.cargo/config.toml
4
5change_rust_src_to_official() {
6echo -e "[source.crates-io]                             \n \
7registry = \"sparse+https://index.crates.io/\"            \n \
8[net]                                                   \n \
9git-fetch-with-cli = true                               \n \
10" > $CONFIG_FILE
11}
12
13# Check if the GITHUB_WORKFLOW environment variable is set and not empty
14if [ -n "$GITHUB_ACTION" ]; then
15    change_rust_src_to_official
16fi
17
18
19exec "$@"
20