microsoft/AI-For-Beginners
Publicmirrored fromhttps://github.com/microsoft/AI-For-BeginnersAvailable
.devcontainer/add-notice.sh
19lines · modecode
| 1 | # Display a notice when not running in GitHub Codespaces |
| 2 | |
| 3 | cat << 'EOF' > /usr/local/etc/vscode-dev-containers/conda-notice.txt |
| 4 | When using "conda" from outside of GitHub Codespaces, note the Anaconda repository |
| 5 | contains restrictions on commercial use that may impact certain organizations. See |
| 6 | https://aka.ms/vscode-remote/conda/miniconda |
| 7 | |
| 8 | EOF |
| 9 | |
| 10 | notice_script="$(cat << 'EOF' |
| 11 | if [ -t 1 ] && [ "${IGNORE_NOTICE}" != "true" ] && [ "${TERM_PROGRAM}" = "vscode" ] && [ "${CODESPACES}" != "true" ] && [ ! -f "$HOME/.config/vscode-dev-containers/conda-notice-already-displayed" ]; then |
| 12 | cat "/usr/local/etc/vscode-dev-containers/conda-notice.txt" |
| 13 | mkdir -p "$HOME/.config/vscode-dev-containers" |
| 14 | ((sleep 10s; touch "$HOME/.config/vscode-dev-containers/conda-notice-already-displayed") &) |
| 15 | fi |
| 16 | EOF |
| 17 | )" |
| 18 | |
| 19 | echo "${notice_script}" | tee -a /etc/bash.bashrc >> /etc/zsh/zshrc |