Cleaned up login output a bit, it should now catch and display (most) errors

This commit is contained in:
2025-11-19 18:49:19 +11:00
parent bc68c03f34
commit cfcef7fa21
2 changed files with 3 additions and 2 deletions

View File

@@ -1,7 +1,7 @@
# Maintainer: Zergling_man, from fedora.email
pkgname=swat-codegen
pkgver=1.1.1
pkgver=1.1.2
pkgrel=1
pkgdesc="A simple CLI interface to RCPDv3, the rank code management service for the game SWAT: Aftermath"
arch=('any')

View File

@@ -16,7 +16,8 @@ function migrate
function login
{
[ -n "$2" ] || { echo "Please provide a username and password, in that order, when calling this"; exit; }
curl $account_server_root_url/login --json '{"username":"'"$1"'","password":"'"$2"'"}' > ~/.config/rcpd.cfg
res="`curl -s $account_server_root_url/login --json '{"username":"'"$1"'","password":"'"$2"'"}'`"
jq <<< "$res" 2>/dev/null || echo $res > ~/.config/rcpd.cfg
}
function get_token