Resolve pathing issues, move script inits out of user rc files (#529)

This commit is contained in:
Chuck Lantz 2020-08-30 08:09:03 -07:00 коммит произвёл GitHub
Родитель 26246453d1
Коммит 98d2a50181
Не найден ключ, соответствующий данной подписи
Идентификатор ключа GPG: 4AEE18F83AFDEB23
12 изменённых файлов: 89 добавлений и 114 удалений

Просмотреть файл

@ -11,7 +11,19 @@ ARG USER_GID=$USER_UID
# Default to bash shell (other shells available at /usr/bin/fish and /usr/bin/zsh)
ENV SHELL=/bin/bash \
ORYX_ENV_TYPE=vsonline-present \
DOTNET_ROOT="/home/${USERNAME}/.dotnet"
DOTNET_ROOT="/home/${USERNAME}/.dotnet" \
NVM_SYMLINK_CURRENT=true \
NVM_DIR="/home/${USERNAME}/.nvm" \
NVS_HOME="/home/${USERNAME}/.nvs" \
PIPX_HOME="/usr/local/py-utils" \
PIPX_BIN_DIR="/usr/local/py-utils/bin" \
RVM_PATH="/usr/local/rvm" \
GOROOT="/usr/local/go" \
GOPATH="/go" \
CARGO_HOME="/usr/local/cargo" \
RUSTUP_HOME="/usr/local/rustup" \
SDKMAN_DIR="/usr/local/sdkman"
ENV PATH="${NVM_DIR}/current/bin:${DOTNET_ROOT}/tools:${SDKMAN_DIR}/bin:${SDKMAN_DIR}/candidates/java/current/bin:${SDKMAN_DIR}/candidates/gradle/current/bin:${SDKMAN_DIR}/candidates/maven/current/bin:${CARGO_HOME}/bin:${GOROOT}/bin:${PATH}:${PIPX_BIN_DIR}"
# Install needed utilities and setup non-root user. Use a separate RUN statement to add your own dependencies.
COPY library-scripts/azcli-debian.sh library-scripts/common-debian.sh library-scripts/git-lfs-debian.sh library-scripts/github-debian.sh \
@ -21,7 +33,7 @@ RUN apt-get update && export DEBIAN_FRONTEND=noninteractive \
&& rm /etc/apt/sources.list.d/buster.list \
# Run common script and setup user
&& bash /tmp/scripts/common-debian.sh "true" "${USERNAME}" "${USER_UID}" "${USER_GID}" "false" \
&& bash /tmp/scripts/setup-user.sh "${USERNAME}" "${DOTNET_ROOT}" \
&& bash /tmp/scripts/setup-user.sh "${USERNAME}" "${PATH}" \
# Upgrade git to avoid security issue
&& apt-get upgrade -yq git \
# Remove 'imagemagick imagemagick-6-common' due to http://cve.mitre.org/cgi-bin/cvename.cgi?name=CVE-2019-10131
@ -50,64 +62,46 @@ RUN bash /tmp/scripts/powershell-debian.sh \
&& apt-get clean -y && rm -rf /home/${USERNAME}/symlinkDotNetCore.sh /tmp/scripts/
# Setup Node.js, install NVM and NVS
ARG NVS_HOME="/home/${USERNAME}/.nvs"
ENV NVM_DIR="/home/${USERNAME}/.nvm"
ENV NVM_SYMLINK_CURRENT=true \
PATH="${NVM_DIR}/current/bin:${PATH}"
COPY library-scripts/node-debian.sh /tmp/scripts/
RUN sudo -u ${USERNAME} npm config set prefix /home/${USERNAME}/.npm-global \
&& npm config -g set prefix /home/${USERNAME}/.npm-global \
# Install nvm
&& bash /tmp/scripts/node-debian.sh "${NVM_DIR}" "none" "${USERNAME}" \
RUN bash /tmp/scripts/node-debian.sh "${NVM_DIR}" "none" "${USERNAME}" \
&& (cd ${NVM_DIR} && git remote get-url origin && echo $(git log -n 1 --pretty=format:%H -- .)) > ${NVM_DIR}/.git-remote-and-commit \
# Install nvs (alternate cross-platform Node.js version-management tool)
&& sudo -u ${USERNAME} git clone -b v1.5.4 -c advice.detachedHead=false --depth 1 https://github.com/jasongin/nvs ${NVS_HOME} 2>&1 \
&& sudo -u ${USERNAME} /bin/bash ${NVS_HOME}/nvs.sh install \
# Clear the nvs cache and link to an existing node binary to reduce the size of the image.
&& sudo -u ${USERNAME} git clone -c advice.detachedHead=false --depth 1 https://github.com/jasongin/nvs ${NVS_HOME} 2>&1 \
&& (cd ${NVS_HOME} && git remote get-url origin && echo $(git log -n 1 --pretty=format:%H -- .)) > ${NVS_HOME}/.git-remote-and-commit \
&& sudo -u ${USERNAME} bash ${NVS_HOME}/nvs.sh install \
&& rm ${NVS_HOME}/cache/* \
&& sudo -u codespace ln -s /opt/nodejs/10.17.0/bin/node ${NVS_HOME}/cache/node \
&& sed -i "s/node\/[0-9.]\+/node\/10.17.0/" ${NVS_HOME}/defaults.json \
# Set npm global location
&& sudo -u ${USERNAME} npm config set prefix /home/${USERNAME}/.npm-global \
&& npm config -g set prefix /root/.npm-global \
# Clean up
&& rm -rf ${NVM_DIR}/.git ${NVS_HOME}/.git /tmp/scripts/
# Install OpenJDK 8, latest Java LTS (11), gradle, maven
ENV SDKMAN_DIR="/usr/local/sdkman"
ENV PATH="${SDKMAN_DIR}/bin:${SDKMAN_DIR}/candidates/java/current/bin:${SDKMAN_DIR}/candidates/gradle/current/bin:${SDKMAN_DIR}/candidates/maven/current/bin:${PATH}"
COPY library-scripts/java-debian.sh library-scripts/maven-debian.sh library-scripts/gradle-debian.sh /tmp/scripts/
RUN bash /tmp/scripts/java-debian.sh "lts" "${SDKMAN_DIR}" "${USERNAME}" "true" \
&& bash /tmp/scripts/gradle-debian.sh "lts" "${SDKMAN_DIR}" "${USERNAME}" "true" \
&& bash /tmp/scripts/maven-debian.sh "lts" "${SDKMAN_DIR}" "${USERNAME}" "true" \
&& bash /tmp/scripts/gradle-debian.sh "latest" "${SDKMAN_DIR}" "${USERNAME}" "true" \
&& bash /tmp/scripts/maven-debian.sh "latest" "${SDKMAN_DIR}" "${USERNAME}" "true" \
&& echo "Installing JDK 8..." \
&& export DEBIAN_FRONTEND=noninteractive \
&& apt-get install -yq openjdk-8-jdk \
&& apt-get clean -y && rm -rf /tmp/scripts
# Install Rust
ENV CARGO_HOME="/usr/local/cargo" \
RUSTUP_HOME="/usr/local/rustup"
ENV PATH="${CARGO_HOME}/bin:${PATH}"
COPY library-scripts/rust-debian.sh /tmp/scripts/
RUN bash /tmp/scripts/rust-debian.sh "${CARGO_HOME}" "${RUSTUP_HOME}" "${USERNAME}" "true" \
&& apt-get clean -y && rm -rf /tmp/scripts
# Install Go
ARG GOLANG_VERSION="1.15"
ENV GOROOT="/usr/local/go" \
GOPATH="/go"
ENV PATH="${GOROOT}/bin:${PATH}"
COPY library-scripts/go-debian.sh /tmp/scripts/
RUN bash /tmp/scripts/go-debian.sh "${GOLANG_VERSION}" "${GOROOT}" "${GOPATH}" "${USERNAME}" \
RUN bash /tmp/scripts/go-debian.sh "latest" "${GOROOT}" "${GOPATH}" "${USERNAME}" \
&& apt-get clean -y && rm -rf /tmp/scripts
# Install rvm, Ruby, base gems
COPY library-scripts/ruby-debian.sh /tmp/scripts/
ENV PATH="${PATH}:/usr/local/rvm/bin"
RUN bash /tmp/scripts/ruby-debian.sh "stable" "${USERNAME}" "true" \
&& apt-get clean -y && rm -rf /tmp/scripts
# Install Python tools
ENV PIPX_HOME="/usr/local/py-utils" \
PIPX_BIN_DIR="/usr/local/py-utils/bin"
ENV PATH="${PATH}:${PIPX_BIN_DIR}"
COPY library-scripts/python-debian.sh /tmp/scripts/
RUN bash /tmp/scripts/python-debian.sh "stable" "/opt/python/stable" "${PIPX_HOME}" "${USERNAME}" "true" \
&& apt-get clean -y && rm -rf /tmp/scripts
@ -138,9 +132,9 @@ CMD [ "sleep", "infinity" ]
# [Optional] Install debugger for development of Codespaces - Not in resulting image by default
ARG DeveloperBuild
RUN if [ -z $DeveloperBuild ]; then \
echo "not including debugger" ; \
else \
curl -sSL https://aka.ms/getvsdbgsh | bash /dev/stdin -v latest -l /vsdbg ; \
fi
echo "not including debugger" ; \
else \
curl -sSL https://aka.ms/getvsdbgsh | bash /dev/stdin -v latest -l /vsdbg ; \
fi
USER ${USERNAME}

Просмотреть файл

@ -1,20 +1,14 @@
#!/bin/bash
USERNAME=${1:-codespace}
DOTNET_ROOT=${2:-"/home/${USERNAME}/.dotnet"}
# Define extra paths:Language executables provided by Oryx - see https://github.com/microsoft/Oryx/blob/master/images/build/slim.Dockerfile#L223
# Also adds ~/.npm-global/bin - For npm global and carg bin directory in user directory
EXTRA_PATHS="/opt/oryx:/opt/nodejs/lts/bin:/opt/python/latest/bin:/opt/yarn/stable/bin:${DOTNET_ROOT}/tools"
USER_EXTRA_PATHS_OVERRIDES="\$HOME/.dotnet"
USER_EXTRA_PATHS="${EXTRA_PATHS}:\$HOME/.npm-global/bin"
SECURE_PATH_BASE=${2:-$PATH}
BASH_PROMPT="PS1='\[\e]0;\u: \w\a\]\[\033[01;32m\]\u\[\033[00m\]:\[\033[01;34m\]\w\[\033[00m\]\$ '"
FISH_PROMPT="function fish_prompt\n set_color green\n echo -n (whoami)\n set_color normal\n echo -n \":\"\n set_color blue\n echo -n (pwd)\n set_color normal\n echo -n \"> \"\nend\n"
{ echo && echo $BASH_PROMPT ; } | tee -a /etc/skel/.bashrc /root/.bashrc /home/${USERNAME}/.bashrc >> /etc/bash.bashrc
{ echo && echo -e "export PATH=${USER_EXTRA_PATHS_OVERRIDES}:${USER_EXTRA_PATHS}:\$PATH" ; } | tee -a /etc/skel/.bashrc /etc/skel/.zshrc /root/.bashrc /root/.zshrc /home/${USERNAME}/.bashrc /home/${USERNAME}/.zshrc >> /etc/bash.bashrc
echo "Defaults secure_path=\"/usr/local/sbin:/usr/local/bin:/usr/sbin:/usr/bin:/sbin:/bin:/usr/local/bin:${EXTRA_PATHS}\"" >> /etc/sudoers.d/securepath
{ echo && echo $BASH_PROMPT ; } | tee -a /root/.bashrc /home/${USERNAME}/.bashrc >> /etc/skel/.bashrc
{ echo && echo -e "export PATH=\$HOME/.dotnet:\$PATH:\$HOME/.npm-global/bin" ; } | tee -a /etc/bash.bashrc >> /etc/zsh/zshrc
echo "Defaults secure_path=\"/usr/local/sbin:/usr/local/bin:/usr/sbin:/usr/bin:/sbin:/bin:/usr/local/bin:${SECURE_PATH_BASE}\"" >> /etc/sudoers.d/securepath
# Install and setup fish
apt-get install -yq fish

Просмотреть файл

@ -154,11 +154,7 @@ EOF
# Ensure ~/.local/bin is in the PATH for root and non-root users for bash. (zsh is later)
if [ "${RC_SNIPPET_ALREADY_ADDED}" != "true" ]; then
echo "${RC_SNIPPET}" | tee -a /root/.bashrc >> /etc/skel/.bashrc
if [ "${USERNAME}" != "root" ]; then
echo "${RC_SNIPPET}" >> /home/$USERNAME/.bashrc
chown $USER_UID:$USER_GID /home/$USERNAME/.bashrc
fi
echo "${RC_SNIPPET}" >> /etc/bash.bashrc
RC_SNIPPET_ALREADY_ADDED="true"
fi
@ -167,7 +163,8 @@ if [ "${INSTALL_ZSH}" = "true" ] && [ ! -d "/root/.oh-my-zsh" ] && [ "${ZSH_ALRE
apt-get-update-if-needed
apt-get install -y zsh
curl -fsSLo- https://raw.github.com/ohmyzsh/ohmyzsh/master/tools/install.sh | bash 2>&1
echo -e "${RC_SNIPPET}\nDEFAULT_USER=\$USER\nprompt_context(){}" >> /root/.zshrc
echo "${RC_SNIPPET}" >> /etc/zsh/zshrc
echo -e "DEFAULT_USER=\$USER\nprompt_context(){}" >> /root/.zshrc
cp -fR /root/.oh-my-zsh /etc/skel
cp -f /root/.zshrc /etc/skel
sed -i -e "s/\/root\/.oh-my-zsh/\/home\/\$(whoami)\/.oh-my-zsh/g" /etc/skel/.zshrc

Просмотреть файл

@ -6,7 +6,7 @@
# Syntax: ./github-debian.sh [version]
CLI_VERSION=${1:-"0.11.0"}
CLI_VERSION=${1:-"latest"}
set -e
@ -25,6 +25,12 @@ if ! dpkg -s curl ca-certificates > /dev/null 2>&1; then
apt-get -y install --no-install-recommends curl ca-certificates
fi
# Get latest release number if latest is specified
if [ "${CLI_VERSION}" = "latest" ] || [ "${CLI_VERSION}" = "current" ] || [ "${CLI_VERSION}" = "lts" ]; then
LATEST_RELEASE=$(curl -sSL -H "Accept: application/vnd.github.v3+json" "https://api.github.com/repos/cli/cli/releases?per_page=1&page=1")
CLI_VERSION=$(echo ${LATEST_RELEASE} | grep -oE 'tag_name":\s*"v[^"]+' | sed -n '/tag_name":\s*"v/s///p')
fi
# Install the GitHub CLI
echo "Downloading github CLI..."
curl -OsSL https://github.com/cli/cli/releases/download/v${CLI_VERSION}/gh_${CLI_VERSION}_linux_amd64.deb

Просмотреть файл

@ -6,7 +6,7 @@
# Syntax: ./go-debian.sh [Go version] [Go install path] [GOPATH] [non-root user] [Add GOPATH, GOROOT to rc files flag] [install tools]
TARGET_GO_VERSION=${1:-"1.15"}
TARGET_GO_VERSION=${1:-"latest"}
TARGET_GOROOT=${2:-"/usr/local/go"}
TARGET_GOPATH=${3:-"/go"}
USERNAME=${4:-"vscode"}
@ -25,6 +25,12 @@ if [ "${USERNAME}" = "none" ] || ! id -u ${USERNAME} > /dev/null 2>&1; then
USERNAME=root
fi
function updaterc() {
if [ "${UPDATE_RC}" = "true" ]; then
echo -e "$1" | tee -a /etc/bash.bashrc >> /etc/zsh/zshrc
fi
}
export DEBIAN_FRONTEND=noninteractive
# Install curl, tar, git, other dependencies if missing
@ -35,6 +41,11 @@ if ! dpkg -s curl ca-certificates tar git g++ gcc libc6-dev make pkg-config > /d
apt-get -y install --no-install-recommends curl ca-certificates tar git g++ gcc libc6-dev make pkg-config
fi
# Get latest version number if latest is specified
if [ "${TARGET_GO_VERSION}" = "latest" ] || [ "${TARGET_GO_VERSION}" = "current" ] || [ "${TARGET_GO_VERSION}" = "lts" ]; then
TARGET_GO_VERSION=$(curl -sSL "https://golang.org/VERSION?m=text" | sed -n '/^go/s///p' )
fi
# Install Go
GO_INSTALL_SCRIPT="$(cat <<EOF
set -e
@ -103,12 +114,6 @@ if [ "${INSTALL_GO_TOOLS}" = "true" ]; then
fi
# Add GOPATH variable and bin directory into PATH in bashrc/zshrc files (unless disabled)
if [ "${UPDATE_RC}" = "true" ]; then
RC_SNIPPET="export GOPATH=\"${TARGET_GOPATH}\"\nexport GOROOT=\"${TARGET_GOROOT}\"\nexport PATH=\"\${GOROOT}/bin:\${PATH}\""
echo -e ${RC_SNIPPET} | tee -a /root/.bashrc /root/.zshrc >> /etc/skel/.bashrc
if [ "${USERNAME}" != "root" ]; then
echo -e ${RC_SNIPPET} | tee -a /home/${USERNAME}/.bashrc >> /home/${USERNAME}/.zshrc
fi
fi
updaterc "export GOPATH=\"${TARGET_GOPATH}\"\nexport GOROOT=\"${TARGET_GOROOT}\"\nexport PATH=\"\${GOROOT}/bin:\${PATH}\""
echo "Done!"

Просмотреть файл

@ -30,11 +30,7 @@ fi
function updaterc() {
if [ "${UPDATE_RC}" = "true" ]; then
RC_SNIPPET="$1"
echo -e ${RC_SNIPPET} | tee -a /root/.bashrc /root/.zshrc >> /etc/skel/.bashrc
if [ "${USERNAME}" != "root" ]; then
echo -e ${RC_SNIPPET} | tee -a /home/${USERNAME}/.bashrc >> /home/${USERNAME}/.zshrc
fi
echo -e "$1" | tee -a /etc/bash.bashrc >> /etc/zsh/zshrc
fi
}

Просмотреть файл

@ -45,10 +45,7 @@ if [ ! -d "${SDKMAN_DIR}" ]; then
# Add sourcing of sdkman into bashrc/zshrc files (unless disabled)
if [ "${UPDATE_RC}" = "true" ]; then
RC_SNIPPET="export SDKMAN_DIR=${SDKMAN_DIR}\nsource \${SDKMAN_DIR}/bin/sdkman-init.sh"
echo -e ${RC_SNIPPET} | tee -a /root/.bashrc /root/.zshrc >> /etc/skel/.bashrc
if [ "${USERNAME}" != "root" ]; then
echo -e ${RC_SNIPPET} | tee -a /home/${USERNAME}/.bashrc >> /home/${USERNAME}/.zshrc
fi
echo -e ${RC_SNIPPET} | tee -a /etc/bash.bashrc >> /etc/zsh/zshrc
fi
fi

Просмотреть файл

@ -30,11 +30,7 @@ fi
function updaterc() {
if [ "${UPDATE_RC}" = "true" ]; then
RC_SNIPPET="$1"
echo -e ${RC_SNIPPET} | tee -a /root/.bashrc /root/.zshrc >> /etc/skel/.bashrc
if [ "${USERNAME}" != "root" ]; then
echo -e ${RC_SNIPPET} | tee -a /home/${USERNAME}/.bashrc >> /home/${USERNAME}/.zshrc
fi
echo -e "$1" | tee -a /etc/bash.bashrc >> /etc/zsh/zshrc
fi
}

Просмотреть файл

@ -9,6 +9,7 @@
export NVM_DIR=${1:-"/usr/local/share/nvm"}
export NODE_VERSION=${2:-"lts/*"}
USERNAME=${3:-"vscode"}
UPDATE_RC=${4:-"true"}
set -e
@ -56,27 +57,10 @@ if [ -d "${NVM_DIR}" ]; then
exit 0
fi
mkdir -p ${NVM_DIR}
NVM_INIT=$(cat <<EOF
export NVM_DIR="${NVM_DIR}"
[ -s "\$NVM_DIR/nvm.sh" ] && . "\$NVM_DIR/nvm.sh"
[ -s "\$NVM_DIR/bash_completion" ] && . "\$NVM_DIR/bash_completion"
if [ "\$(stat -c '%U' \$NVM_DIR)" != "${USERNAME}" ]; then
sudo chown -R ${USERNAME}:root \$NVM_DIR
fi
EOF
)
echo "${NVM_INIT}" | tee -a /root/.bashrc /root/.zshrc >> /etc/skel/.bashrc
# Set up non-root user if applicable
if [ "${USERNAME}" != "root" ]; then
# Add NVM init and add code to update NVM ownership if UID/GID changes
echo "${NVM_INIT}" | tee -a /home/${USERNAME}/.bashrc >> /home/${USERNAME}/.zshrc
chown ${USERNAME} ${NVM_DIR} /home/${USERNAME}/.bashrc /home/${USERNAME}/.zshrc
fi
# Run NVM installer as non-root if needed
mkdir -p ${NVM_DIR}
chown ${USERNAME} ${NVM_DIR}
su ${USERNAME} -c "$(cat << EOF
set -e
curl -so- https://raw.githubusercontent.com/nvm-sh/nvm/v0.35.3/install.sh | bash
@ -88,4 +72,16 @@ su ${USERNAME} -c "$(cat << EOF
EOF
)" 2>&1
if [ "${UPDATE_RC}" = "true" ]; then
(cat <<EOF
export NVM_DIR="${NVM_DIR}"
[ -s "\$NVM_DIR/nvm.sh" ] && . "\$NVM_DIR/nvm.sh"
[ -s "\$NVM_DIR/bash_completion" ] && . "\$NVM_DIR/bash_completion"
if [ "\$(stat -c '%U' \$NVM_DIR)" != "${USERNAME}" ]; then
sudo chown -R ${USERNAME}:root \$NVM_DIR
fi
EOF
) | tee -a /etc/bash.bashrc >> /etc/zsh/zshrc
fi
echo "Done!"

Просмотреть файл

@ -27,11 +27,7 @@ fi
function updaterc() {
if [ "${UPDATE_RC}" = "true" ]; then
RC_SNIPPET="$1"
echo -e ${RC_SNIPPET} | tee -a /root/.bashrc /root/.zshrc >> /etc/skel/.bashrc
if [ "${USERNAME}" != "root" ]; then
echo -e ${RC_SNIPPET} | tee -a /home/${USERNAME}/.bashrc >> /home/${USERNAME}/.zshrc
fi
echo -e "$1" | tee -a /etc/bash.bashrc >> /etc/zsh/zshrc
fi
}

Просмотреть файл

@ -22,6 +22,12 @@ if [ "${USERNAME}" = "none" ] || ! id -u ${USERNAME} > /dev/null 2>&1; then
USERNAME=root
fi
function updaterc() {
if [ "${UPDATE_RC}" = "true" ]; then
echo -e "$1" | tee -a /etc/bash.bashrc >> /etc/zsh/zshrc
fi
}
export DEBIAN_FRONTEND=noninteractive
# Install curl, software-properties-common, gnupg2 if missing
@ -56,13 +62,5 @@ rm -rf ${GNUPGHOME}
source /usr/local/rvm/scripts/rvm
rvm cleanup all
gem cleanup
# Add sourcing of rvm into bashrc/zshrc files (unless disabled)
if [ "${UPDATE_RC}" = "true" ]; then
RC_SNIPPET="source /usr/local/rvm/scripts/rvm"
echo -e ${RC_SNIPPET} | tee -a /root/.bashrc /root/.zshrc >> /etc/skel/.bashrc
if [ "${USERNAME}" != "root" ]; then
echo -e ${RC_SNIPPET} | tee -a /home/${USERNAME}/.bashrc >> /home/${USERNAME}/.zshrc
fi
fi
updaterc "source /usr/local/rvm/scripts/rvm"
echo "Done!"

Просмотреть файл

@ -23,6 +23,12 @@ if [ "${USERNAME}" = "none" ] || ! id -u ${USERNAME} > /dev/null 2>&1; then
USERNAME=root
fi
function updaterc() {
if [ "${UPDATE_RC}" = "true" ]; then
echo -e "$1" | tee -a /etc/bash.bashrc >> /etc/zsh/zshrc
fi
}
export DEBIAN_FRONTEND=noninteractive
# Install curl, lldb, python3-minimal,and rust dependencies if missing
@ -54,12 +60,6 @@ EOF
)"
# Add CARGO_HOME, RUSTUP_HOME and bin directory into bashrc/zshrc files (unless disabled)
if [ "${UPDATE_RC}" = "true" ]; then
RC_SNIPPET="export CARGO_HOME=\"${CARGO_HOME}\"\nexport RUSTUP_HOME=\"${RUSTUP_HOME}\"\nexport PATH=\"\${CARGO_HOME}/bin:\${PATH}\""
echo -e ${RC_SNIPPET} | tee -a /root/.bashrc /root/.zshrc >> /etc/skel/.bashrc
if [ "${USERNAME}" != "root" ]; then
echo -e ${RC_SNIPPET} | tee -a /home/${USERNAME}/.bashrc >> /home/${USERNAME}/.zshrc
fi
fi
updaterc "export CARGO_HOME=\"${CARGO_HOME}\"\nexport RUSTUP_HOME=\"${RUSTUP_HOME}\"\nexport PATH=\"\${CARGO_HOME}/bin:\${PATH}\""
echo "Done!"