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() {
|
||||
|
||||
# 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
|
||||
export DOTFILES_OS_NAME=android-termux
|
||||
elif echo $OSTYPE | grep -qE '^linux-gnu.*' && [ -f '/etc/debian_version' ]; then
|
||||
|
@ -93,6 +94,16 @@ installDeps() {
|
|||
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() {
|
||||
if [ ! -d "$HOME/.dotfiles" ]; then
|
||||
echoStageName "Cloning the dotfiles repo"
|
||||
|
@ -300,8 +311,9 @@ main() {
|
|||
# step 1: check the OS first
|
||||
checkOs
|
||||
|
||||
# step 2: install needed tools
|
||||
# step 2: install needed tools and create ~/.local/bin
|
||||
installDeps
|
||||
userspcaeBinDirCheck
|
||||
|
||||
# step 3.1: then clone the repo
|
||||
cloneRepo
|
||||
|
|
Loading…
Reference in New Issue