]> git.lizzy.rs Git - rust.git/blobdiff - src/ci/shared.sh
Rollup merge of #61420 - felixrabe:patch-2, r=dtolnay
[rust.git] / src / ci / shared.sh
index 3ba64ad412064e48b5eb3a91d84793fa891323bb..1e667fca5875afd8b57213211c3cdb63bd1207af 100644 (file)
@@ -24,6 +24,22 @@ function retry {
   done
 }
 
+function isCI {
+  [ "$CI" = "true" ] || [ "$TRAVIS" = "true" ] || [ "$TF_BUILD" = "True" ]
+}
+
+function isOSX {
+  [ "$TRAVIS_OS_NAME" = "osx" ] || [ "$AGENT_OS" = "Darwin" ]
+}
+
+function getCIBranch {
+  if [ "$TRAVIS" = "true" ]; then
+    echo "$TRAVIS_BRANCH"
+  else
+    echo "$BUILD_SOURCEBRANCHNAME"
+  fi;
+}
+
 if ! declare -F travis_fold; then
   if [ "${TRAVIS-false}" = 'true' ]; then
     # This is a trimmed down copy of