Files
structure/get-composer-auth.sh
2021-04-22 20:44:57 +03:00

15 lines
345 B
Bash
Executable File

#!/bin/bash
FILE=${HOME}/.config/composer/auth.json
if [[ -f "${FILE}" ]]; then
if [[ ! -z "$(cat $FILE | grep github)" ]]; then
exit 0
fi
fi
echo "Get token: https://github.com/settings/tokens/new?scopes=repo&description=Composer"
# user="USER INPUT"
read -p "Enter token: " TOKEN
composer config -g github-oauth.github.com ${TOKEN}