Last active
February 26, 2022 08:38
-
-
Save Hayao0819/701147aa7e38307f7049ba3b07b6082f to your computer and use it in GitHub Desktop.
Gistをファイルストレージとして使用します
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| #!/usr/bin/env bash | |
| #-- Load library --# | |
| source /dev/stdin < <(curl -sL https://raw.githubusercontent.com/Hayao0819/FasBashLib/8635525f6a8079786dfa039342ad818be942d606/fasbashlib.sh) | |
| GITHUB_TOKEN="" | |
| Command="" | |
| #-- Functions --# | |
| HelpDoc () { | |
| echo "GitHub Gist にファイルをアップロードしたりダウンロードしたりします" | |
| echo | |
| echo "Usage: gistrge [Options] [Command] [Path]" | |
| echo | |
| echo "Options:" | |
| echo " -t | --token GitHubトークンを指定します。環境変数の値は無視されます。" | |
| echo " -h | --help このメッセージを表示します。" | |
| echo | |
| echo "Environment Variables:" | |
| echo " GITHUB_TOKEN GitHubトークンを指定します。" | |
| } | |
| #-- Parse opts --# | |
| parseopts SHORT="fhdn:" LONG="help,architecture,disk,name:" -- "${@}" || exit 1 | |
| eval set -- "${OPTRET[@]}" | |
| unset OPTRET | |
| while true; do | |
| case "${1}" in | |
| -t | --token) | |
| GITHUB_TOKEN="${2}" | |
| shift 2 | |
| ;; | |
| -h | --help) | |
| HelpDoc | |
| exit 0 | |
| ;; | |
| --) | |
| shift 1 | |
| break | |
| ;; | |
| *) | |
| MsgError "Argument exception error '${1}'" | |
| MsgError "Please report this error to the developer." 1 | |
| ;; | |
| esac | |
| done |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment