diff --git a/docker-project-manager.sh b/docker-project-manager.sh index eb9b9f6..e7e2ea8 100755 --- a/docker-project-manager.sh +++ b/docker-project-manager.sh @@ -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 \ No newline at end of file