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