Skip to content

Commit

Permalink
fix: update blog admin installer
Browse files Browse the repository at this point in the history
  • Loading branch information
tanhongit committed Nov 15, 2024
1 parent 1c2ce6d commit 17b85a4
Show file tree
Hide file tree
Showing 3 changed files with 19 additions and 9 deletions.
19 changes: 13 additions & 6 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -21,6 +21,12 @@ First, copy the `.env.example` file to `.env` and update the values.
envsubst < .env.example > .env
```

If you don't have `envsubst` command, you can use the following command:

```bash
cp .env.example .env
```

In the `.env` file, update the values to match your environment.

```bash
Expand Down Expand Up @@ -60,9 +66,10 @@ Then, you can just run the following command to start the runner.

The runner has the following commands:

| Command | Description |
|----------------|------------------------------|
| `help`, `tips` | Shows the help message |
| `build`, `b` | Builds the Blog |
| `worker`, `w` | Create or restart the worker |
| `all`, `a` | Runs all the commands |
| Command | Description |
|---------------------|------------------------------------------|
| `help`, `tips` | Shows the help message |
| `build`, `b` | Builds the Blog |
| `worker`, `w` | Create or restart the worker |
| `sync`, `blog_sync` | Sync the Blog with the remote repository |
| `all`, `a` | Runs all the commands |
2 changes: 1 addition & 1 deletion runner.sh
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,7 @@ case "$1" in
usage
;;

blog_sync)
blog_sync | sync)
blog_sync "$2"
;;

Expand Down
7 changes: 5 additions & 2 deletions setup/functions.sh
Original file line number Diff line number Diff line change
Expand Up @@ -84,7 +84,7 @@ node_runner() {
# ========================================

build_admin() {
echo '⚙ Building blog API (Laravel)...'
echo '⚙ Building blog ADMIN/API (Laravel)...'

if [ "$1" == "install" ]; then
COMPOSER_COMMAND="install"
Expand All @@ -96,13 +96,16 @@ build_admin() {

if [ ! -f "$BLOG_ADMIN_DIR/.env" ]; then
echo ' ∟ .env file missing, copying from .env.example...'
cp "$BLOG_ADMIN_DIR/.env.example" "$BLOG_ADMIN_DIR/.env"
cp "$BLOG_ADMIN_DIR/.env.production" "$BLOG_ADMIN_DIR/.env"
composer $COMPOSER_COMMAND
php artisan key:generate
else
composer $COMPOSER_COMMAND
fi

echo ' ∟ Migrating database...'
php artisan migrate

echo ''
}

Expand Down

0 comments on commit 17b85a4

Please sign in to comment.