mirror of
https://codeberg.org/reflect/install.git
synced 2025-09-13 18:03:40 +02:00
Compare commits
3 commits
Author | SHA1 | Date | |
---|---|---|---|
8b80663a32 | |||
366939068a | |||
ff5b177c67 |
2 changed files with 29 additions and 7 deletions
|
@ -21,7 +21,13 @@ curl -fsSL https://codeberg.org/reflect/install/raw/branch/master/install.sh | b
|
|||
# Arguments
|
||||
You can pass optional named arguments to this script for headless installation of Reflect.
|
||||
|
||||
## `--overwrite` - Overwrite existing configuration files
|
||||
### `--install` - Don't install, only configure Reflect
|
||||
```sh
|
||||
./install.sh --install=n
|
||||
```
|
||||
Pass `--install=n` to prevent download and installation of the Reflect git submodule. Use this option if you're version controlling Reflect from your project repository.
|
||||
|
||||
### `--overwrite` - Overwrite existing configuration files
|
||||
```sh
|
||||
./install.sh --example=n
|
||||
```
|
||||
|
|
28
install.sh
28
install.sh
|
@ -7,6 +7,7 @@ dir=""
|
|||
host=""
|
||||
user=""
|
||||
seed=""
|
||||
install=""
|
||||
password=""
|
||||
seed_host=""
|
||||
seed_user=""
|
||||
|
@ -48,12 +49,15 @@ install_reflect() {
|
|||
exit 1
|
||||
fi
|
||||
|
||||
if ! [ -d "reflect" ] ; then
|
||||
git submodule add https://codeberg.org/reflect/reflect
|
||||
fi
|
||||
# Download and install the Reflect repository
|
||||
if [[ "$install" != "n" ]]; then
|
||||
if ! [ -d "reflect" ] ; then
|
||||
git submodule add https://codeberg.org/reflect/reflect
|
||||
fi
|
||||
|
||||
# Update submodules
|
||||
git submodule update --init --recursive
|
||||
# Update submodules
|
||||
git submodule update --init --recursive
|
||||
fi
|
||||
|
||||
# Install dependencies with composer
|
||||
(cd reflect && composer install --classmap-authoritative)
|
||||
|
@ -61,7 +65,14 @@ install_reflect() {
|
|||
# Bail out if composer didn't create a vendor folder
|
||||
if ! [ -d "reflect/vendor" ] ; then
|
||||
echo_err "Something went wrong with the installation."
|
||||
exit_report
|
||||
|
||||
# Script was not run with the install flag disabled, this is probably a bug
|
||||
if [[ "$install" != "n" ]]; then
|
||||
exit_report
|
||||
fi
|
||||
|
||||
echo_err "Make sure you have cloned the Reflect repository. Or run without '--install=n'."
|
||||
exit 1
|
||||
fi
|
||||
}
|
||||
|
||||
|
@ -198,6 +209,7 @@ main() {
|
|||
cwd=$(pwd)
|
||||
|
||||
check_sys_depend
|
||||
|
||||
install_reflect
|
||||
configure_reflect
|
||||
|
||||
|
@ -232,6 +244,10 @@ for arg in "$@"; do
|
|||
seed="${arg#*=}"
|
||||
;;
|
||||
|
||||
--install=*)
|
||||
install="${arg#*=}"
|
||||
;;
|
||||
|
||||
--seed-host=*)
|
||||
seed_host="${arg#*=}"
|
||||
;;
|
||||
|
|
Loading…
Add table
Reference in a new issue