Add logs action to docker-project-manager
This commit is contained in:
@@ -9,9 +9,9 @@ pull_images=false
|
||||
# Parse command line arguments
|
||||
while [[ $# -gt 0 ]]; do
|
||||
case $1 in
|
||||
--up|--down|--restart)
|
||||
--up|--down|--restart|--logs)
|
||||
if [ -n "$action" ]; then
|
||||
echo "Error: Cannot specify multiple actions (--up, --down, --restart)"
|
||||
echo "Error: Cannot specify multiple actions (--up, --down, --restart, --logs)"
|
||||
exit 1
|
||||
fi
|
||||
action="${1#--}" # Remove leading --
|
||||
@@ -35,7 +35,7 @@ done
|
||||
|
||||
# Validate inputs
|
||||
if [ -z "$action" ]; then
|
||||
echo "Error: Must specify either --up, --down, or --restart"
|
||||
echo "Error: Must specify either --up, --down, --restart, or --logs"
|
||||
exit 1
|
||||
fi
|
||||
|
||||
@@ -77,4 +77,8 @@ for project_name in "${projects[@]}"; do
|
||||
docker compose up -d
|
||||
;;
|
||||
esac
|
||||
|
||||
if [ "$action" = "logs" ]; then
|
||||
docker compose logs --follow
|
||||
fi
|
||||
done
|
||||
Reference in New Issue
Block a user