Skip to content

Commit

Permalink
Common: Moving contents from setup-user.sh (#16)
Browse files Browse the repository at this point in the history
* common: append data

* move contents

* nit
  • Loading branch information
samruddhikhandale authored May 16, 2022
1 parent d0dd070 commit 4df144e
Showing 1 changed file with 18 additions and 0 deletions.
18 changes: 18 additions & 0 deletions src/common/install.sh
Original file line number Diff line number Diff line change
Expand Up @@ -451,4 +451,22 @@ echo -e "\
RC_SNIPPET_ALREADY_ADDED=${RC_SNIPPET_ALREADY_ADDED}\n\
ZSH_ALREADY_INSTALLED=${ZSH_ALREADY_INSTALLED}" > "${MARKER_FILE}"

# Display a notice on conda when not running in GitHub Codespaces
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
)"

echo "${notice_script}" | tee -a /etc/bash.bashrc >> /etc/zsh/zshrc

echo "Done!"

0 comments on commit 4df144e

Please sign in to comment.