chore(bootstrap): add checks to check if PREFIX/bin exists
This commit is contained in:
parent
a0c9d56770
commit
0b828cdcd0
16
bootstrap
16
bootstrap
|
@ -55,7 +55,8 @@ success() {
|
||||||
}
|
}
|
||||||
|
|
||||||
checkOs() {
|
checkOs() {
|
||||||
|
# This step is required for different actions, like installing deps from system-wide package managers
|
||||||
|
# among other sorts of shitfuckery
|
||||||
if echo $OSTYPE | grep -qE "linux-android.*"; then
|
if echo $OSTYPE | grep -qE "linux-android.*"; then
|
||||||
export DOTFILES_OS_NAME=android-termux
|
export DOTFILES_OS_NAME=android-termux
|
||||||
elif echo $OSTYPE | grep -qE '^linux-gnu.*' && [ -f '/etc/debian_version' ]; then
|
elif echo $OSTYPE | grep -qE '^linux-gnu.*' && [ -f '/etc/debian_version' ]; then
|
||||||
|
@ -93,6 +94,16 @@ installDeps() {
|
||||||
sleep 5
|
sleep 5
|
||||||
}
|
}
|
||||||
|
|
||||||
|
userspcaeBinDirCheck() {
|
||||||
|
echoStageName "checking if PREFIX/bin exists"
|
||||||
|
if [ ! -d $PREFIX/bin ]; then
|
||||||
|
warn "$PREFIX/bin doesn't exists, creating..."
|
||||||
|
mkdir -p $PREFIX/bin
|
||||||
|
else
|
||||||
|
success "Looks good!"
|
||||||
|
fi
|
||||||
|
}
|
||||||
|
|
||||||
cloneRepo() {
|
cloneRepo() {
|
||||||
if [ ! -d "$HOME/.dotfiles" ]; then
|
if [ ! -d "$HOME/.dotfiles" ]; then
|
||||||
echoStageName "Cloning the dotfiles repo"
|
echoStageName "Cloning the dotfiles repo"
|
||||||
|
@ -300,8 +311,9 @@ main() {
|
||||||
# step 1: check the OS first
|
# step 1: check the OS first
|
||||||
checkOs
|
checkOs
|
||||||
|
|
||||||
# step 2: install needed tools
|
# step 2: install needed tools and create ~/.local/bin
|
||||||
installDeps
|
installDeps
|
||||||
|
userspcaeBinDirCheck
|
||||||
|
|
||||||
# step 3.1: then clone the repo
|
# step 3.1: then clone the repo
|
||||||
cloneRepo
|
cloneRepo
|
||||||
|
|
Loading…
Reference in New Issue