mirror of
https://codeberg.org/vegvisir/install.git
synced 2025-09-14 00:33:41 +02:00
feat: add --dir flag and use --install=n as flag for config only
This commit is contained in:
parent
9ae80a1707
commit
d8fcd8a68d
1 changed files with 15 additions and 6 deletions
17
install.sh
17
install.sh
|
@ -2,6 +2,7 @@
|
||||||
|
|
||||||
# Initialize variables
|
# Initialize variables
|
||||||
cwd=""
|
cwd=""
|
||||||
|
dir=""
|
||||||
install=""
|
install=""
|
||||||
example=""
|
example=""
|
||||||
overwrite=""
|
overwrite=""
|
||||||
|
@ -156,8 +157,12 @@ main() {
|
||||||
# Get the current working directory
|
# Get the current working directory
|
||||||
cwd=$(pwd)
|
cwd=$(pwd)
|
||||||
|
|
||||||
|
# Download and install the Vegvisir repository
|
||||||
|
if [[ "$install" != "n" ]]; then
|
||||||
check_sys_depend
|
check_sys_depend
|
||||||
install_vegvisir
|
install_vegvisir
|
||||||
|
fi
|
||||||
|
|
||||||
configure_vegvisir
|
configure_vegvisir
|
||||||
|
|
||||||
echo "Vegvisir has been sucessfully installed."
|
echo "Vegvisir has been sucessfully installed."
|
||||||
|
@ -178,6 +183,10 @@ main() {
|
||||||
# Loop through all arguments
|
# Loop through all arguments
|
||||||
for arg in "$@"; do
|
for arg in "$@"; do
|
||||||
case $arg in
|
case $arg in
|
||||||
|
--dir=*)
|
||||||
|
dir="${arg#*=}"
|
||||||
|
;;
|
||||||
|
|
||||||
--install=*)
|
--install=*)
|
||||||
install="${arg#*=}"
|
install="${arg#*=}"
|
||||||
;;
|
;;
|
||||||
|
@ -197,14 +206,14 @@ for arg in "$@"; do
|
||||||
done
|
done
|
||||||
|
|
||||||
# Start execution immediately if an install directory was passed
|
# Start execution immediately if an install directory was passed
|
||||||
if [ -n "$install" ]; then
|
if [ -n "$dir" ]; then
|
||||||
if ! [ -d "$install" ]; then
|
if ! [ -d "$dir" ]; then
|
||||||
echo_err "Installation aborted: '$install' is not a directory"
|
echo_err "Installation aborted: '$dir' is not a directory"
|
||||||
exit 1
|
exit 1
|
||||||
fi
|
fi
|
||||||
|
|
||||||
# Move to install directory and run main
|
# Move to install directory and run main
|
||||||
cd $install
|
cd $dir
|
||||||
main
|
main
|
||||||
fi
|
fi
|
||||||
|
|
||||||
|
|
Loading…
Add table
Reference in a new issue