diff options
| author | David Lönnhager <david.l@mullvad.net> | 2026-04-20 14:47:46 +0200 |
|---|---|---|
| committer | David Lönnhager <david.l@mullvad.net> | 2026-04-20 18:04:06 +0200 |
| commit | 5939c0fb74231e5e5cd92f6ef5fc044ce60c7cf3 (patch) | |
| tree | f7e45d3b23dd40f57b46fcdc49c74ecd771184f3 | |
| parent | 7a72e78518620f8eb14b7d9c1fd8f9e434931484 (diff) | |
| download | mullvadvpn-5939c0fb74231e5e5cd92f6ef5fc044ce60c7cf3.tar.xz mullvadvpn-5939c0fb74231e5e5cd92f6ef5fc044ce60c7cf3.zip | |
Default to host platform in setup-rust-post-checkout
| -rwxr-xr-x | scripts/setup-rust-post-checkout | 15 |
1 files changed, 11 insertions, 4 deletions
diff --git a/scripts/setup-rust-post-checkout b/scripts/setup-rust-post-checkout index ce3e5f1d94..6e65e87f11 100755 --- a/scripts/setup-rust-post-checkout +++ b/scripts/setup-rust-post-checkout @@ -13,10 +13,17 @@ if [[ ! -f "$SETUP_RUST_SCRIPT" ]]; then exit 0 fi -if [[ -z ${MULLVAD_SETUP_PLATFORM+x} ]]; then - echo "MULLVAD_SETUP_PLATFORM is not set, must be set to one of the following: " >&2 - echo "\`android\`, \`ios\`, \`windows\`, \`linux\`, \`macos\`" >&2 - exit 1 +if [[ -z "$MULLVAD_SETUP_PLATFORM" ]]; then + case "$(uname -s)" in + Linux) MULLVAD_SETUP_PLATFORM="linux" ;; + Darwin) MULLVAD_SETUP_PLATFORM="macos" ;; + MINGW*|CYGWIN*|MSYS*) MULLVAD_SETUP_PLATFORM="windows" ;; + *) + echo "Unable to detect current platform, MULLVAD_SETUP_PLATFORM must be set to one of: " >&2 + echo "\`android\`, \`ios\`, \`windows\`, \`linux\`, \`macos\`" >&2 + exit 1 + ;; + esac fi git diff-tree --exit-code "$1".."$2" --quiet -- rust-toolchain.toml |
