- doing mkdir before `git init <dir>` is not necessary; git will create the directory if it doesn't exist - passing both `-C` and `--git-dir` is not needed for git invocations - reading the current working directory isn't necessary for specifying nested paths to operate in - use `git add .` instead of explicitly naming all paths; we generate a gitignore for binaries that we want to avoid adding - generate cross-platform gitignore for Go binary extensions - add helpers to simplify writing files, tests
35 lines
849 B
Bash
35 lines
849 B
Bash
#!/usr/bin/env bash
|
|
set -e
|
|
|
|
echo "Hello %[1]s!"
|
|
|
|
# Snippets to help get started:
|
|
|
|
# Determine if an executable is in the PATH
|
|
# if ! type -p ruby >/dev/null; then
|
|
# echo "Ruby not found on the system" >&2
|
|
# exit 1
|
|
# fi
|
|
|
|
# Pass arguments through to another command
|
|
# gh issue list "$@" -R cli/cli
|
|
|
|
# Using the gh api command to retrieve and format information
|
|
# QUERY='
|
|
# query($endCursor: String) {
|
|
# viewer {
|
|
# repositories(first: 100, after: $endCursor) {
|
|
# nodes {
|
|
# nameWithOwner
|
|
# stargazerCount
|
|
# }
|
|
# }
|
|
# }
|
|
# }
|
|
# '
|
|
# TEMPLATE='
|
|
# {{- range $repo := .data.viewer.repositories.nodes -}}
|
|
# {{- printf "name: %%s - stargazers: %%v\n" $repo.nameWithOwner $repo.stargazerCount -}}
|
|
# {{- end -}}
|
|
# '
|
|
# exec gh api graphql -f query="${QUERY}" --paginate --template="${TEMPLATE}"
|