Skip to content

Commit

Permalink
Fix #32 add --asset option
Browse files Browse the repository at this point in the history
  • Loading branch information
NicoHood committed Jul 9, 2021
1 parent 7c67bb1 commit cbf022c
Show file tree
Hide file tree
Showing 2 changed files with 9 additions and 2 deletions.
1 change: 1 addition & 0 deletions Readme.md
Original file line number Diff line number Diff line change
Expand Up @@ -100,6 +100,7 @@ Optional arguments:
-u, --local-user <keyid> Use the given GPG key (same as --signingkey).
-o, --output <path> Safe all release assets to the specified <path>.
-p, --pre-release Flag as Github pre-release.
-a, --asset Add additional assets, such as precompiled software.
-f, --force Force the recreation of Git tag and release assets.
-i, --interactive Run in interactive mode, step-by-step.
--<option> Temporary set a 'gpgit.<option>' from config below.
Expand Down
10 changes: 8 additions & 2 deletions gpgit.sh
Original file line number Diff line number Diff line change
Expand Up @@ -72,6 +72,7 @@ ${BOLD}Optional arguments:${ALL_OFF}
-u, --local-user <keyid> Use the given GPG key (same as --signingkey).
-o, --output <path> Safe all release assets to the specified <path>.
-p, --pre-release Flag as Github pre-release.
-a, --asset Add additional assets, such as precompiled software.
-f, --force Force the recreation of Git tag and release assets.
-i, --interactive Run in interactive mode, step-by-step.
--<option> Temporary set a 'gpgit.<option>' from config below.
Expand Down Expand Up @@ -241,9 +242,9 @@ if [[ -x /usr/local/opt/gnu-getopt/bin/getopt ]]; then
fi

# Parse input params an ovrwrite possible default or config loaded options
GETOPT_PARAMS_SHORT="hvcm:C:k:u:s:S:o:O:pnfdi"
GETOPT_PARAMS_SHORT="hvcm:C:k:u:s:S:o:O:pa:nfdi"
GETOPT_ARGS="$(getopt -o "${GETOPT_PARAMS_SHORT}" \
-l "help,version,message:,directory:,signingkey:,local-user:,gpg-sign:,output:,pre-release,no-github,force,interactive,changelog:,token:,compression:,hash:,keyserver:,github:,githubrepo:,project:,remote:,debug,color:"\
-l "help,version,message:,directory:,signingkey:,local-user:,gpg-sign:,output:,pre-release,asset:,no-github,force,interactive,changelog:,token:,compression:,hash:,keyserver:,github:,githubrepo:,project:,remote:,debug,color:"\
-n "gpgit" -- "${@}")" || die "${USAGE_SHORT}"
eval set -- "${GETOPT_ARGS}"

Expand Down Expand Up @@ -278,6 +279,11 @@ while true ; do
-p|--prerelease)
PRERELEASE="true"
;;
-a|--asset)
[[ -f "${2}" ]] || die "Asset '${2}' not a valid file."
GITHUB_ASSET["$(basename "${2}")"]="${2}"
shift
;;
# DEPRECATED: use '--github false' or git config 'gpgit.github false'
-n|--no-github)
INTERACTIVE=false warning "Parameter '--no-github' is deprecated. Please use '--github false' instead."
Expand Down

0 comments on commit cbf022c

Please sign in to comment.