From 083a40a5dce8a71ee03b3917e959ad00ff0dbc17 Mon Sep 17 00:00:00 2001 From: Alex Grintsvayg Date: Fri, 14 Jul 2017 08:29:52 -0400 Subject: [PATCH] rename script --- README.md | 2 +- dev-prepare.sh | 3 --- dev.sh | 9 +++++++-- dev-docker.sh => docker.sh | 7 ++++++- 4 files changed, 14 insertions(+), 7 deletions(-) delete mode 100644 dev-prepare.sh rename dev-docker.sh => docker.sh (62%) diff --git a/README.md b/README.md index 0c3c6bdf..7bbeecb6 100644 --- a/README.md +++ b/README.md @@ -15,7 +15,7 @@ You can also run the development server using docker: - Install Docker - Checkout the project -- Run `./dev-docker.sh` from the project root +- Run `./docker.sh` from the project root - Access [localhost:8000](http://localhost:8000) in your browser Both the `dev.sh` and `dev-docker.sh` scripts will initialise a configuration based on `data/config.php.example` if `data/config.php` does not exist. diff --git a/dev-prepare.sh b/dev-prepare.sh deleted file mode 100644 index 7c0d9186..00000000 --- a/dev-prepare.sh +++ /dev/null @@ -1,3 +0,0 @@ -if [ ! -e "data/config.php" ]; then - cp "data/config.php.example" "data/config.php" -fi diff --git a/dev.sh b/dev.sh index b48d5e02..22f09dbd 100755 --- a/dev.sh +++ b/dev.sh @@ -1,5 +1,10 @@ #!/bin/bash -source dev-prepare.sh +DIR="$( cd "$( dirname "${BASH_SOURCE[0]}" )" && pwd )" -php7.0 --server localhost:8000 --docroot web/ web/index.php + +if [ ! -e "data/config.php" ]; then + cp "$DIR/data/config.php.example" "$DIR/data/config.php" +fi + +php7.0 --server localhost:8000 --docroot "$DIR/web" "$DIR/web/index.php" diff --git a/dev-docker.sh b/docker.sh similarity index 62% rename from dev-docker.sh rename to docker.sh index ef49fac1..e5bb466e 100755 --- a/dev-docker.sh +++ b/docker.sh @@ -1,6 +1,11 @@ #!/bin/bash -source dev-prepare.sh +DIR="$( cd "$( dirname "${BASH_SOURCE[0]}" )" && pwd )" + + +if [ ! -e "data/config.php" ]; then + cp "$DIR/data/config.php.example" "$DIR/data/config.php" +fi docker run --rm -it --name "dev.lbry.io" \ -v "$(readlink -f .):/usr/src/lbry.io" \