Merge branch 'main' of github.com:pyr0ball/PRbL-bashrc into develop
This commit is contained in:
commit
1239305ff4
2 changed files with 33 additions and 15 deletions
|
|
@ -1,8 +1,9 @@
|
||||||
#!/bin/bash
|
#!/bin/bash
|
||||||
# CodeDog Bootstrap installer script
|
# CodeDog Bootstrap installer script
|
||||||
# To run this script without cloning or downloading anything:
|
# To run this script without cloning or downloading anything:
|
||||||
# bash <(curl -ks 'https://github.com/pyr0ball/PRbL-bashrc/raw/main/extras/Slipstream.install')
|
# curl -H 'Cache-Control: no-cache' -kLs 'https://github.com/pyr0ball/PRbL-bashrc/raw/main/extras/Slipstream.install' | bash -s -- -i
|
||||||
# Bash expansions to get the name and location of this script when run
|
# Bash expansions to get the name and location of this script when run
|
||||||
|
installdir="$HOME/.local/share/s3dk"
|
||||||
scriptname="${BASH_SOURCE[0]##*/}"
|
scriptname="${BASH_SOURCE[0]##*/}"
|
||||||
rundir="${BASH_SOURCE[0]%/*}"
|
rundir="${BASH_SOURCE[0]%/*}"
|
||||||
|
|
||||||
|
|
@ -28,7 +29,6 @@ else
|
||||||
fi
|
fi
|
||||||
|
|
||||||
logfile="${rundir}/${pretty_date}_${scriptname}.log"
|
logfile="${rundir}/${pretty_date}_${scriptname}.log"
|
||||||
installdir="$HOME/devl"
|
|
||||||
|
|
||||||
# Dependencies
|
# Dependencies
|
||||||
sys_packages=(
|
sys_packages=(
|
||||||
|
|
@ -47,9 +47,9 @@ pip_packages=(
|
||||||
)
|
)
|
||||||
|
|
||||||
repo_packages=(
|
repo_packages=(
|
||||||
https://github.com/BruceDLong/CodeDog.git
|
BruceDLong/CodeDog
|
||||||
https://github.com/BruceDLong/Proteus.git
|
BruceDLong/Proteus
|
||||||
https://github.com/BruceDLong/Slipstream.git
|
BruceDLong/Slipstream
|
||||||
)
|
)
|
||||||
|
|
||||||
prbl_packages=(
|
prbl_packages=(
|
||||||
|
|
@ -71,12 +71,12 @@ check-deps(){
|
||||||
done
|
done
|
||||||
pybin=$(which python3)
|
pybin=$(which python3)
|
||||||
if [ -z $pybin ] ; then
|
if [ -z $pybin ] ; then
|
||||||
run install-packages python3 python3-pip
|
bins_missing+=(python3)
|
||||||
# TODO: make a universal package install function
|
# TODO: make a universal package install function
|
||||||
fi
|
fi
|
||||||
pipbin=$(which pip3)
|
pipbin=$(which pip3)
|
||||||
if [ -z $pipbin ] ; then
|
if [ -z $pipbin ] ; then
|
||||||
run install-packages python3-pip
|
bins_missing+=(pip3)
|
||||||
fi
|
fi
|
||||||
for pkg in ${pip_packages[@]} ; do
|
for pkg in ${pip_packages[@]} ; do
|
||||||
pippkg_installed=$(pip list | grep -F $pkg ; echo $?)
|
pippkg_installed=$(pip list | grep -F $pkg ; echo $?)
|
||||||
|
|
@ -95,7 +95,7 @@ check-deps(){
|
||||||
local _bins_missing=${#bins_missing[@]}
|
local _bins_missing=${#bins_missing[@]}
|
||||||
# If higher than 0, return a fail (1)
|
# If higher than 0, return a fail (1)
|
||||||
if [[ $_bins_missing != 0 ]] ; then
|
if [[ $_bins_missing != 0 ]] ; then
|
||||||
return 1
|
return ${#_bins_missing}
|
||||||
else
|
else
|
||||||
return 0
|
return 0
|
||||||
fi
|
fi
|
||||||
|
|
@ -178,15 +178,33 @@ install(){
|
||||||
fi
|
fi
|
||||||
run mkdir -p $installdir
|
run mkdir -p $installdir
|
||||||
pushd $installdir
|
pushd $installdir
|
||||||
for repo in ${repo_packages[@]} ; do
|
for repo in "${repo_packages[@]}"; do
|
||||||
clone-repo $repo
|
if ! check-git-repository "repositories/${repo#*/}"; then
|
||||||
|
if [ -d "repositories/${repo#*/}" ] ; then
|
||||||
|
warn "Existing repo ${repo#*/} is broken..."
|
||||||
|
return 1
|
||||||
|
else
|
||||||
|
logger echo "Cloning ${repo} into ${installdir}/repositories/${repo#*/}"
|
||||||
|
clone-repo "https://github.com/$repo" "${installdir}/repositories/${repo#*/}"
|
||||||
|
fi
|
||||||
|
else
|
||||||
|
pushd "${installdir}/repositories/${repo#*/}"
|
||||||
|
if [[ ${VERSIONS[${repo#*/}]} =~ ^[0-9]+\.[0-9]+\.[0-9]+$ ]]; then
|
||||||
|
echo "Version tag detected: ${VERSIONS[${repo#*/}]}"
|
||||||
|
git checkout "${VERSIONS[${repo#*/}]}"
|
||||||
|
else
|
||||||
|
echo "Branch Name / Commit hash detected: ${VERSIONS[${repo#*/}]}"
|
||||||
|
git checkout -q "${VERSIONS[${repo#*/}]}"
|
||||||
|
fi
|
||||||
|
popd
|
||||||
|
fi
|
||||||
done
|
done
|
||||||
popd
|
popd
|
||||||
pushd $installdir/Proteus
|
pushd $installdir/repositories/Proteus
|
||||||
run sudo python3 ruleMgr.py
|
run sudo python3 ruleMgr.py && logger echo "Proteus Initialized..."
|
||||||
popd
|
popd
|
||||||
pushd $installdir/Slipstream
|
pushd $installdir/repositories/Slipstream
|
||||||
run $installdir/CodeDog/codeDog ./Slipstream.dog && logger echo "Slipstream app built at ${installdir}/Slipstream/LinuxBuild"
|
run $installdir/repositories/CodeDog/codeDog ./Slipstream.dog && logger echo "Slipstream app built at ${installdir}/repositories/Slipstream/LinuxBuild"
|
||||||
popd
|
popd
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
||||||
Loading…
Reference in a new issue