Files
Igor Lins e Silva bb28ac7139 update packages
2022-11-09 11:54:27 -03:00

21 lines
348 B
Bash
Executable File

#!/usr/bin/env bash
if [ $# -eq 0 ]; then
echo 'Please inform the app name. ex: "./run.sh indexer"'
exit 1
fi
echo -e "\n-->> Starting $1..."
(
set -x
pm2 start --only "$@" --update-env --silent
)
echo -e "\n-->> Saving pm2 state..."
(
set -x
pm2 save
)
echo -e "\n-->> Reading $1 logs..."
(
set -x
pm2 logs --raw --lines 10 "$@"
)