implement some fixes btw, nothing special

probably just commiting stuff out in order to be synced with
remote branch

Signed-off-by: Andrei Jiroh Eugenio Halili <ajhalili2006@gmail.com>
This commit is contained in:
Andrei Jiroh Halili 2021-09-30 22:54:34 +08:00
parent 7d3cf39eb8
commit 77c2839069
Signed by: ajhalili2006
GPG Key ID: A30EBE40AD856D88
1 changed files with 16 additions and 11 deletions

View File

@ -90,7 +90,7 @@ installDeps() {
fi
echoStageName "Installing build deps as needed by pyenv"
sudo apt-get update; sudo apt-get install make build-essential libssl-dev zlib1g-dev libbz2-dev libreadline-dev libsqlite3-dev wget curl llvm libncursesw5-dev xz-utils tk-dev libxml2-dev libxmlsec1-dev libffi-dev liblzma-dev -y
echoStageName "Installing Python3 through Pyenv"
"${PYENV_ROOT}/bin/pyenv" install 3.9.6
"${PYENV_ROOT}/bin/pyenv" global 3.9.6
@ -99,7 +99,7 @@ installDeps() {
sudo apt install python3 python3-pip --yes
fi
else
warn "Dependency installs are being skipped"
warn "Dependency installs are being skipped"
fi
sleep 5
}
@ -136,7 +136,7 @@ cloneRepo() {
elif [[ $GITLAB_LOGIN != "ajhalili2006" ]] && [ ! -d "$HOME/.dotfiles/secrets" ]; then
error "Only Andrei Jiroh can do this!" && exit 1
elif [[ $GITLAB_LOGIN == "ajhalili2006" ]] && [[ $GITLAB_TOKEN == "" ]] && [ ! -d "$HOME/.dotfiles/secrets" ]; then
error "Missing GitLab SaaS PAT! Check your Bitwarden vault for that key." && exit 1
error "Missing GitLab SaaS PAT! Check your Bitwarden vault for that PAT with atleast read_repository scope." && exit 1
fi
if [ ! -d "$HOME/.dotfiles/secrets" ]; then
@ -219,28 +219,31 @@ copyBashrc() {
copyGitConfig() {
echoStageName "Symlinking Git config"
if [[ $DOTFILES_OS_NAME == "android-termux" ]] && [[ $SKIP_CONFIG_LINKING == "" ]]; then
[ ! -L "$HOME/.gitconfig" ] && ln -s "$HOME/.dotfiles/gitconfig/termux" ~/.gitconfig || warn "Git configuration on userspace found, please fix any conflicts or soft link them manually!"
[ ! -L "$HOME/.gitconfig" ] && ln -s "$HOME/.dotfiles/gitconfig/termux" ~/.gitconfig && success "Git config symlinked" || warn "Git configuration on userspace found, either symlink is broken or customizations had been made. Please fix any conflicts or soft link them manually!"
# TODO: Write checks if it's Ubuntu or Debian
# See https://superuser.com/a/741610/1124908 for details
# By default, we'll use the one-size-fits-all Linux config for Git
elif [[ $DOTFILES_OS_NAME == "debian-ubuntu" ]] && [[ $SKIP_CONFIG_LINKING == "" ]]; then
[ ! -L "$HOME/.gitconfig" ] && ln -s "$HOME/.dotfiles/gitconfig/linux" "$HOME/.gitconfig" || warn "Git configuration on userspace found, please fix any conflicts or soft link them manually!"
[ ! -L "$HOME/.gitconfig" ] && ln -s "$HOME/.dotfiles/gitconfig/linux" "$HOME/.gitconfig" || warn "Git configuration on userspace found, either symlink is broken or customizations had been made. Please fix any conflicts or soft link them manually!"
fi
}
copyNanoConfig() {
echoStagename "Symlinking GNU nano config file"
if [[ $DOTFILES_OS_NAME == "android-termux" ]]; then
[ "$SKIP_CONFIG_LINKING" == "" ] && ln -s "$HOME/.dotfiles/nanorc/config/termux" "$HOME/.nanorc"
else
[ "$SKIP_CONFIG_LINKING" == "" ] && [ ! -L "$HOME/.gitconfig" ] && ln -s "$HOME/.dotfiles/nanorc/config/linux.nanorc" "$HOME/.nanorc"
fi
}
installShellCheck() {
echoStageName "Installing Shellcheck"
if [[ $SKIP_DEPENDENCY_INSTALL == "" ]]; then
if [[ $SKIP_DEPENDENCY_INSTALL == "" || $SKIP_REINSTALL_SHELLCHECK == "" ]]; then
scversion="stable" # or "v0.4.7", or "latest"
current_shellcheck_path=$(command -v shellcheck)
isOwnedByUser="$(find $PREFIX/bin -user $USER -file shellcheck)"
isOwnedByUser="$(find $PREFIX/bin -user $USER -file shellcheck)" # Don't check if its blank
current_path_dir="$(dirname $current_shellcheck_path)"
wget -qO- "https://github.com/koalaman/shellcheck/releases/download/${scversion?}/shellcheck-${scversion?}.linux.x86_64.tar.xz" | tar -xJv -C "$HOME"
if [[ $current_shellcheck_path == "" ]]; then
@ -263,6 +266,8 @@ installShellCheck() {
fi
cp "$HOME/shellcheck-${scversion}/shellcheck" "$PREFIX/bin"
fi
else
warn "Shellcheck install/upgrade is being skipped!"
fi
}
@ -274,7 +279,7 @@ installAscinema() {
if command -v python3>>/dev/null && [ -f "$HOME/.pyenv/shims/python3" ]; then
"$HOME/.pyenv/shims/pip3" install asciinema --user --upgrade
else
pip3 install thefuck --user --upgrade
pip3 install asciinema --user --upgrade
fi
fi
}
@ -320,7 +325,7 @@ customizeCloudShell() {
warn "Envirnment customization script found, deleting old one..."
rm -fv ~/.customize_environment
fi
cp ~/.dotfiles/.config/devshell.env ~/.customize_environment && chmod +x ~/.customize_environment
if [ ! -d "$HOME/.cloudshell" ]; then
mkdir "$HOME/.cloudshell"
@ -364,7 +369,7 @@ main() {
# import colors and show the banner
useColor
banner
# step 1: check the OS first
checkOs
@ -374,7 +379,7 @@ main() {
# step 3.1: then clone the repo
cloneRepo
# step 3.2: if we're in Cloud Shell, do this
[[ $GOOGLE_CLOUD_SHELL == "true" ]] && customizeCloudShell