feat: lake: GNU/BSD OS detection in test scripts (#3180)

fixes #3179
This commit is contained in:
Mario Carneiro 2024-01-13 18:49:38 -08:00 committed by GitHub
parent 53af5ead53
commit 42e6214a42
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
9 changed files with 18 additions and 10 deletions

View file

@ -3,7 +3,8 @@ set -exo pipefail
LAKE=${LAKE:-../../.lake/build/bin/lake}
if [ "`uname`" = Darwin ]; then
unamestr=`uname`
if [ "$unamestr" = Darwin ] || [ "$unamestr" = FreeBSD ]; then
sed_i() { sed -i '' "$@"; }
else
sed_i() { sed -i "$@"; }

View file

@ -3,7 +3,8 @@ set -exo pipefail
LAKE=${LAKE:-../../../.lake/build/bin/lake}
if [ "`uname`" = Darwin ]; then
unamestr=`uname`
if [ "$unamestr" = Darwin ] || [ "$unamestr" = FreeBSD ]; then
sed_i() { sed -i '' "$@"; }
else
sed_i() { sed -i "$@"; }

View file

@ -3,7 +3,8 @@ set -exo pipefail
LAKE=${LAKE:-$PWD/../../.lake/build/bin/lake}
if [ "`uname`" = Darwin ]; then
unamestr=`uname`
if [ "$unamestr" = Darwin ] || [ "$unamestr" = FreeBSD ]; then
sed_i() { sed -i '' "$@"; }
else
sed_i() { sed -i "$@"; }

View file

@ -3,7 +3,8 @@ set -euxo pipefail
./clean.sh
if [ "`uname`" = Darwin ]; then
unamestr=`uname`
if [ "$unamestr" = Darwin ] || [ "$unamestr" = FreeBSD ]; then
sed_i() { sed -i '' "$@"; }
else
sed_i() { sed -i "$@"; }
@ -79,7 +80,7 @@ $LAKE -d 123-hello exe 123-hello
# Test creating packages with components that contain `.`s
# https://github.com/leanprover/lean4/issues/2999
# this fails on windows for unrelated reasons
if [ "$OSTYPE" != "msys" ]; then
$LAKE new «A.B».«C.D»

View file

@ -6,7 +6,8 @@ exit 0
LAKE=${LAKE:-../../.lake/build/bin/lake}
if [ "`uname`" = Darwin ]; then
unamestr=`uname`
if [ "$unamestr" = Darwin ] || [ "$unamestr" = FreeBSD ]; then
TAIL=gtail
else
TAIL=tail

View file

@ -3,7 +3,8 @@ set -exo pipefail
LAKE=${LAKE:-../../.lake/build/bin/lake}
if [ "`uname`" = Darwin ]; then
unamestr=`uname`
if [ "$unamestr" = Darwin ] || [ "$unamestr" = FreeBSD ]; then
sed_i() { sed -i '' "$@"; }
else
sed_i() { sed -i "$@"; }

View file

@ -1,7 +1,8 @@
#!/usr/bin/env bash
set -euo pipefail
if [ "`uname`" = Darwin ]; then
unamestr=`uname`
if [ "$unamestr" = Darwin ] || [ "$unamestr" = FreeBSD ]; then
TAIL=gtail
else
TAIL=tail

View file

@ -11,7 +11,8 @@ if ! command -v elan > /dev/null; then
exit 0
fi
if [ "`uname`" = Darwin ]; then
unamestr=`uname`
if [ "$unamestr" = Darwin ] || [ "$unamestr" = FreeBSD ]; then
sed_i() { sed -i '' "$@"; }
else
sed_i() { sed -i "$@"; }

View file

@ -1,7 +1,7 @@
#!/usr/bin/env bash
unamestr=`uname`
if [[ "$unamestr" == 'Darwin' ]]; then
if [ "$unamestr" = Darwin ] || [ "$unamestr" = FreeBSD ]; then
# OSX
if command -v greadlink >/dev/null 2>&1; then
# macOS readlink doesn't support -f option