]> git.lizzy.rs Git - rust.git/blob - src/ci/scripts/verify-line-endings.sh
Merge commit 'a98e7ab8b94485be6bd03e0c6b8682ecab5b52e6' into clippyup
[rust.git] / src / ci / scripts / verify-line-endings.sh
1 #!/bin/bash
2 # See also the disable for autocrlf, this just checks that it worked.
3 #
4 # We check both in rust-lang/rust and in a submodule to make sure both are
5 # accurate. Submodules are checked out significantly later than the main
6 # repository in this script, so settings can (and do!) change between then.
7 #
8 # Linux (and maybe macOS) builders don't currently have dos2unix so just only
9 # run this step on Windows.
10
11 set -euo pipefail
12 IFS=$'\n\t'
13
14 source "$(cd "$(dirname "$0")" && pwd)/../shared.sh"
15
16 if isWindows; then
17     # print out the git configuration so we can better investigate failures in
18     # the following
19     git config --list --show-origin
20     dos2unix -ih Cargo.lock src/tools/rust-installer/install-template.sh
21     endings=$(dos2unix -ic Cargo.lock src/tools/rust-installer/install-template.sh)
22     # if endings has non-zero length, error out
23     if [ -n "$endings" ]; then exit 1 ; fi
24 fi