mirror of
https://codeberg.org/reflect/install.git
synced 2025-09-13 18:03:40 +02:00
Compare commits
3 commits
2e7ccdbe25
...
8b80663a32
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
|
# Arguments
|
||||||
You can pass optional named arguments to this script for headless installation of Reflect.
|
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
|
```sh
|
||||||
./install.sh --example=n
|
./install.sh --example=n
|
||||||
```
|
```
|
||||||
|
|
28
install.sh
28
install.sh
|
@ -7,6 +7,7 @@ dir=""
|
||||||
host=""
|
host=""
|
||||||
user=""
|
user=""
|
||||||
seed=""
|
seed=""
|
||||||
|
install=""
|
||||||
password=""
|
password=""
|
||||||
seed_host=""
|
seed_host=""
|
||||||
seed_user=""
|
seed_user=""
|
||||||
|
@ -48,12 +49,15 @@ install_reflect() {
|
||||||
exit 1
|
exit 1
|
||||||
fi
|
fi
|
||||||
|
|
||||||
if ! [ -d "reflect" ] ; then
|
# Download and install the Reflect repository
|
||||||
git submodule add https://codeberg.org/reflect/reflect
|
if [[ "$install" != "n" ]]; then
|
||||||
fi
|
if ! [ -d "reflect" ] ; then
|
||||||
|
git submodule add https://codeberg.org/reflect/reflect
|
||||||
|
fi
|
||||||
|
|
||||||
# Update submodules
|
# Update submodules
|
||||||
git submodule update --init --recursive
|
git submodule update --init --recursive
|
||||||
|
fi
|
||||||
|
|
||||||
# Install dependencies with composer
|
# Install dependencies with composer
|
||||||
(cd reflect && composer install --classmap-authoritative)
|
(cd reflect && composer install --classmap-authoritative)
|
||||||
|
@ -61,7 +65,14 @@ install_reflect() {
|
||||||
# Bail out if composer didn't create a vendor folder
|
# Bail out if composer didn't create a vendor folder
|
||||||
if ! [ -d "reflect/vendor" ] ; then
|
if ! [ -d "reflect/vendor" ] ; then
|
||||||
echo_err "Something went wrong with the installation."
|
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
|
fi
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -198,6 +209,7 @@ main() {
|
||||||
cwd=$(pwd)
|
cwd=$(pwd)
|
||||||
|
|
||||||
check_sys_depend
|
check_sys_depend
|
||||||
|
|
||||||
install_reflect
|
install_reflect
|
||||||
configure_reflect
|
configure_reflect
|
||||||
|
|
||||||
|
@ -232,6 +244,10 @@ for arg in "$@"; do
|
||||||
seed="${arg#*=}"
|
seed="${arg#*=}"
|
||||||
;;
|
;;
|
||||||
|
|
||||||
|
--install=*)
|
||||||
|
install="${arg#*=}"
|
||||||
|
;;
|
||||||
|
|
||||||
--seed-host=*)
|
--seed-host=*)
|
||||||
seed_host="${arg#*=}"
|
seed_host="${arg#*=}"
|
||||||
;;
|
;;
|
||||||
|
|
Loading…
Add table
Reference in a new issue