diff --git a/README.md b/README.md index 6f73a24..fecfa14 100644 --- a/README.md +++ b/README.md @@ -4,8 +4,13 @@ Convert Zip packages to repositories and if they exist update and tag them. ## Install +## Get needed access token + +Get a token from [https://git.vdm.dev/user/settings/applications](https://git.vdm.dev/user/settings/applications) + ```shell -$ sudo curl -L "https://git.vdm.dev/api/v1/repos/octoleo/octozipo/raw/src/octozipo" -o /usr/local/bin/octozipo +$ export SETUP_TOKEN="xxxxxxxxxxtokenxxxxxxxxxxxxxxxxxxxxxxxx" +$ sudo curl -L "https://git.vdm.dev/api/v1/repos/octoleo/octozipo/raw/src/octozipo?access_token=${SETUP_TOKEN}" -o /usr/local/bin/octozipo $ sudo chmod +x /usr/local/bin/octozipo ``` - Global **environment** file can be set at: `/home/$USER/.config/octozipo/.env` diff --git a/src/octozipo b/src/octozipo index 8cc5913..6bca905 100755 --- a/src/octozipo +++ b/src/octozipo @@ -3,7 +3,7 @@ # Program name PROGRAM_NAME="Octozipo" PROGRAM_CODE="octozipo" -PROGRAM_VERSION="2.0.0" +PROGRAM_VERSION="2.0.1" PROGRAM_V="2.0" # PROGRAM_URL="https://git.vdm.dev/octoleo/${PROGRAM_CODE}" @@ -434,7 +434,7 @@ function runUpdate() { sudo mv "/usr/local/bin/${PROGRAM_CODE}" "/usr/local/bin/${PROGRAM_CODE}.bak" fi # pull the latest version. Master is always the latest - if sudo curl --fail -L "https://git.vdm.dev/api/v1/repos/octoleo/${PROGRAM_CODE}/raw/src/${PROGRAM_CODE}?ref=${branch:-master}" -o "/usr/local/bin/${PROGRAM_CODE}" 2>/dev/null; then + if sudo curl --fail -L "https://git.vdm.dev/api/v1/repos/octoleo/${PROGRAM_CODE}/raw/src/${PROGRAM_CODE}?ref=${branch:-master}&access_token=${VDM_ACCESS_TOKEN}" -o "/usr/local/bin/${PROGRAM_CODE}" 2>/dev/null; then # give success message _echo "[success] Update was successful." # do we have a backup @@ -475,6 +475,9 @@ QUIET=false DEBUG=false GIT_DATE_FORMAT="%b %e %X %Y %z" +# load the access token +VDM_ACCESS_TOKEN="${SETUP_TOKEN:-}" + # help message ʕ•ᴥ•ʔ function show_help() { cat <