diff options
| author | Linus Färnstrand <linus@mullvad.net> | 2017-12-04 11:12:49 +0100 |
|---|---|---|
| committer | Linus Färnstrand <linus@mullvad.net> | 2017-12-04 12:19:36 +0100 |
| commit | 6f3ea40d003400a4b5802f12e119805c7f9b3fb7 (patch) | |
| tree | 7cdd9f74729e1aa473ce0ecae121784073a293f1 /format.sh | |
| parent | 26d9f85b9c779ca18f935df9006ca6fad037aeb7 (diff) | |
| download | mullvadvpn-6f3ea40d003400a4b5802f12e119805c7f9b3fb7.tar.xz mullvadvpn-6f3ea40d003400a4b5802f12e119805c7f9b3fb7.zip | |
Upgrade rustfmt to 0.2.17
Diffstat (limited to 'format.sh')
| -rwxr-xr-x | format.sh | 13 |
1 files changed, 11 insertions, 2 deletions
@@ -5,16 +5,25 @@ set -u -VERSION="0.2.16" +VERSION="0.2.17" CMD="rustfmt" INSTALL_CMD="cargo install --vers $VERSION --force rustfmt-nightly" +case "$(uname -s)" in + Linux*) export LD_LIBRARY_PATH=$(rustc --print sysroot)/lib;; + Darwin*) export DYLD_LIBRARY_PATH=$(rustc --print sysroot)/lib;; + *) exit 1 +esac + +# Allow rustfmt to use "nighly" features. `comment_width` is one of those for example. +# 0.2.17 started enforcing setting this variable to allow using the nighly features. +export CFG_RELEASE_CHANNEL=nightly + function correct_rustfmt() { if ! which $CMD; then echo "$CMD is not installed" >&2 return 1 fi - export DYLD_LIBRARY_PATH=$(rustc --print sysroot)/lib local installed_version=$($CMD --version | cut -d'-' -f1) if [[ "$installed_version" != "$VERSION" ]]; then echo "Wrong version of $CMD installed. Expected $VERSION, got $installed_version" >&2 |
