Skip to content

Commit 3da4ec2

Browse files
authored
check for colab
1 parent 66eb153 commit 3da4ec2

File tree

1 file changed

+7
-1
lines changed

1 file changed

+7
-1
lines changed

Linux/.bashrc

Lines changed: 7 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -49,7 +49,13 @@ if ! command -v curl &>/dev/null; then
4949
else
5050
export HAS_CURL="1"
5151
fi
52-
##Is on WSL
52+
##Is on Colab?
53+
IS_ON_COLAB="0"
54+
command -v colab_diagnose_me &>/dev/null && IS_ON_COLAB="1"
55+
command -v colab-fileshim.py &>/dev/null && IS_ON_COLAB="1"
56+
[[ -S "/tmp/colab_runtime.sock" ]] && IS_ON_COLAB="1"
57+
export IS_ON_COLAB
58+
##Is on WSL?
5359
IS_ON_WSL="0"
5460
[[ -n "${WSLENV+x}" ]] && IS_ON_WSL="1"
5561
[[ -s "/etc/wsl.conf" ]] && IS_ON_WSL="1"

0 commit comments

Comments
 (0)