diff options
author | Samruddhi Khandale <skhandale@microsoft.com> | 2022-09-06 23:50:11 +0300 |
---|---|---|
committer | GitHub <noreply@github.com> | 2022-09-06 23:50:11 +0300 |
commit | a5fbdab3c096152dd3a318c0c23da9465815aa69 (patch) | |
tree | 30a1709f45c5351917864a7fd5c05ad782744b0c /src/anaconda | |
parent | d8ee2e8cf193bac39d9f31003f18d90b16dc969e (diff) |
fix bug - Debian / Ubuntu base conda-notice.txt error (#135)
* fix bug
* move config
* fix tests
Diffstat (limited to 'src/anaconda')
-rwxr-xr-x | src/anaconda/install.sh | 25 |
1 files changed, 25 insertions, 0 deletions
diff --git a/src/anaconda/install.sh b/src/anaconda/install.sh index 1802ce3..468fd01 100755 --- a/src/anaconda/install.sh +++ b/src/anaconda/install.sh @@ -103,4 +103,29 @@ if ! conda --version &> /dev/null ; then updaterc "export CONDA_DIR=${CONDA_DIR}/bin" fi +# Display a notice on conda when not running in GitHub Codespaces +mkdir -p /usr/local/etc/vscode-dev-containers +cat << 'EOF' > /usr/local/etc/vscode-dev-containers/conda-notice.txt +When using "conda" from outside of GitHub Codespaces, note the Anaconda repository contains +restrictions on commercial use that may impact certain organizations. See https://aka.ms/ghcs-conda + +EOF + +notice_script="$(cat << 'EOF' +if [ -t 1 ] && [ "${IGNORE_NOTICE}" != "true" ] && [ "${TERM_PROGRAM}" = "vscode" ] && [ "${CODESPACES}" != "true" ] && [ ! -f "$HOME/.config/vscode-dev-containers/conda-notice-already-displayed" ]; then + cat "/usr/local/etc/vscode-dev-containers/conda-notice.txt" + mkdir -p "$HOME/.config/vscode-dev-containers" + ((sleep 10s; touch "$HOME/.config/vscode-dev-containers/conda-notice-already-displayed") &) +fi +EOF +)" + +if [ -f "/etc/zsh/zshrc" ]; then + echo "${notice_script}" | tee -a /etc/zsh/zshrc +fi + +if [ -f "/etc/bash.bashrc" ]; then + echo "${notice_script}" | tee -a /etc/bash.bashrc +fi + echo "Done!"
\ No newline at end of file |