[tea-rbw] Bug fixes
This commit is contained in:
@@ -4,7 +4,7 @@ pkgs.writeShellScriptBin "tea" ''
|
||||
set -euo pipefail
|
||||
|
||||
# Check if tea config directory exists and has authentication
|
||||
TEA_CONFIG_DIR="$HOME/.tea"
|
||||
TEA_CONFIG_DIR="''${XDG_CONFIG_HOME:-$HOME/.config}/tea"
|
||||
TEA_CONFIG_FILE="$TEA_CONFIG_DIR/config.yml"
|
||||
|
||||
# Function to setup tea authentication with rbw
|
||||
@@ -37,7 +37,7 @@ pkgs.writeShellScriptBin "tea" ''
|
||||
mkdir -p "$TEA_CONFIG_DIR"
|
||||
|
||||
# Setup tea login
|
||||
if ! ${pkgs.tea}/bin/tea login add --name "default" --url "$gitea_url" --token "$token" --insecure-skip-verify=false; then
|
||||
if ! ${pkgs.tea}/bin/tea login add --name "default" --url "$gitea_url" --token "$token"; then
|
||||
echo "Error: Failed to setup tea authentication"
|
||||
exit 1
|
||||
fi
|
||||
@@ -46,7 +46,10 @@ pkgs.writeShellScriptBin "tea" ''
|
||||
}
|
||||
|
||||
# Check if tea is already configured
|
||||
if [[ ! -f "$TEA_CONFIG_FILE" ]] || ! ${pkgs.tea}/bin/tea whoami &>/dev/null; then
|
||||
if [[ ! -f "$TEA_CONFIG_FILE" ]]; then
|
||||
setup_tea_auth
|
||||
elif ! ${pkgs.tea}/bin/tea whoami &>/dev/null; then
|
||||
echo "Tea config exists but authentication failed. Re-running setup..."
|
||||
setup_tea_auth
|
||||
fi
|
||||
|
||||
|
||||
Reference in New Issue
Block a user