Commit 3d4bd07c authored by Aral Balkan's avatar Aral Balkan

better/log-in command now displays login status when called without an...

better/log-in command now displays login status when called without an argument but when logged in. Closes #3.
parent d88b93d7
Pipeline #483 skipped
......@@ -34,9 +34,17 @@ set -e
# Ensure arguments
#
if [ -z $1 ]; then
echo "\nUsage: better/log-in <privateToken>\n"
echo "You can get your private token from https://source.ind.ie/profile/account\n"
exit 1
# Check if logged in.
privateTokenFile=~/better.fyi/.private/config/source.ind.ie-private-token
if [ -f $privateTokenFile ]; then
privateToken=$(cat $privateTokenFile)
echo "\n ✓ Already logged in with private token ${privateToken}.\n"
else
echo "\nUsage: better/log-in <privateToken>\n"
echo "You can get your private token from https://source.ind.ie/profile/account\n"
fi
exit 0
fi
privateToken=$1
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment