From 735445ef485ab85f9d53ca60f23b95b6b3bb9dac Mon Sep 17 00:00:00 2001 From: Dan Milne Date: Fri, 31 Jan 2025 12:38:34 +1100 Subject: [PATCH] Add a docker rails console script --- bin/docker-rails-console | 20 ++++++++++++++++++++ 1 file changed, 20 insertions(+) create mode 100644 bin/docker-rails-console diff --git a/bin/docker-rails-console b/bin/docker-rails-console new file mode 100644 index 0000000..8e1feaf --- /dev/null +++ b/bin/docker-rails-console @@ -0,0 +1,20 @@ +#!/bin/bash + +# Get the container name from first argument, default to 'web' if not provided +container_name=${1:-web} + +# Check if we're in a directory with either compose.yml or compose.yaml +if [[ ! -f "compose.yml" ]] && [[ ! -f "compose.yaml" ]]; then + echo "No compose.yml or compose.yaml found in current directory" + exit 1 +fi + +# Connect to the rails console with specified container +docker compose exec -it "$container_name" bundle exec rails console + +# @PICOPACKAGE_START +# --- +# filename: docker-rails-console +# version: 1.0 +# content_checksum: sha256:c3a98dedbafbc310008382042630a5a4152fb12f02b497c57c7198fc6bca8fbc +# @PICOPACKAGE_END