Files
ghost-docker/tinybird/handleLogin.sh
James Loh 946dff3b76 Simplify TB token experience
- Unfortunately the TB CLI doesn't just output the token and instead
  tries to copy it to the clipboard
- Since we're running inside a container we can't do that, so need to
  just update the docs to get it from the UI
2025-06-26 16:33:12 +10:00

24 lines
573 B
Bash
Executable File

#!/usr/bin/env bash
# If arguments are provided, run tb command with those arguments
if [[ $# -gt 0 ]]; then
# Check if logged in first
if [[ ! -f "/home/tinybird/.tinyb" ]]; then
echo "Not logged in to Tinybird. Please run 'docker compose run --rm tinybird-login' first"
exit 1
fi
# Run the tb command with provided arguments
exec tb "$@"
fi
# Default behavior: login
# Check if already logged in
if [[ -f "/home/tinybird/.tinyb" ]]
then
echo "Tinybird already logged in"
exit 0
fi
# Login to Tinybird
tb login --method code