We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
offset is out of bounds
via un-ts/prettier#182 (comment)
#!/usr/bin/env bash set -euo pipefail stage_path="$(dirname "$(realpath -s "$0")")/../../globals.stage" # git on vercel https://vercel.com/docs/concepts/deployments/build-step#build-image # check if program does not exist https://stackoverflow.com/a/26759734 # check if in github repo https://stackoverflow.com/a/16925062 if [[ ! -x "$(command -v git)" ]] || [[ $(git rev-parse --is-inside-work-tree 2> /dev/null) != "true" ]]; then # check if file does not exist https://linuxize.com/post/bash-check-if-file-exists/ if [[ ! -f "globals.stage" ]]; then if [[ ! -x "$(command -v git)" ]]; then echo '[stage]: git is not installed.' >&2 exit 1 else echo '[stage]: not a git repository.' >&2 exit 1 fi else stage=$(cat "globals.stage") # trim newlines https://stackoverflow.com/a/12973694 # trim whitespace https://stackoverflow.com/a/13092379 stage=$(echo "$stage" | xargs) echo "$stage" exit 0 fi fi # current git branch https://stackoverflow.com/a/1593487 branch_name=$(git symbolic-ref -q HEAD) branch_name=${branch_name##refs/heads/} branch_name=${branch_name:-HEAD} # bash kebab-case https://stackoverflow.com/a/56080830 branch_name=$(echo "$branch_name" \ | sed 's/\([^A-Z]\)\([A-Z0-9]\)/\1-\2/g' \ | sed 's/\([A-Z0-9]\)\([A-Z0-9]\)\([^A-Z]\)/\1-\2\3/g' \ | tr '[:upper:]' '[:lower:]') monorepo_path="$("$(dirname "$(realpath -s "$0")")/../functions/monorepo_path")" # extract json key https://unix.stackexchange.com/questions/480481/grep-the-name-from-package-json-file#comment1308267_691616 base_branch="$(grep -o '"baseBranch"\s*:\s*"[^"]*' "$monorepo_path/turbo.json" | grep -o '[^"]*$')" base_branch="${base_branch##*/}" # if statement https://www.tutorialkart.com/bash-shell-scripting/bash-else-if/ if [[ "$branch_name" == "production" ]]; then echo '[stage]: "production" is not a valid branch name' >&2 exit 1 fi if [[ "$branch_name" == "$base_branch" ]]; then branch_name="production" fi # noclobber https://stackoverflow.com/a/56138414 set -o noclobber echo "$branch_name" >| "$stage_path" echo "$branch_name"
The text was updated successfully, but these errors were encountered:
reproduction https://github.com/rx-ts/sh-syntax/pull/44/files#diff-a31f0dbc97df11df29d1556b0531382502abedf5fd2465e0ad76a8d89f690f05R6019
Sorry, something went wrong.
test: add test cases for #45 and #46
d7b0fbb
close in favor of d7b0fbb
Successfully merging a pull request may close this issue.
via un-ts/prettier#182 (comment)
The text was updated successfully, but these errors were encountered: