this repo has no description
0
fork

Configure Feed

Select the types of activity you want to include in your feed.

zsh: source zapier config from its own folder

+55 -58
+55 -58
zsh/zshenv
··· 32 32 alias aic="aicommits --type conventional" 33 33 alias dots="cd $DOTFILES_DIR && nvim" 34 34 35 + ZAPIER_ZSHENV="${HOME}/code/zapier/team-staff-engineering/seth/zshenv" 36 + 35 37 # if machine name is asteroid.. 36 - if [[ $(hostname) == "asteroid" ]]; then 37 - alias mro="glab mr view -w" 38 - alias mktkt=$HOME/dotfiles/scripts/zapier/make-ticket.sh 39 - alias mkmr=$HOME/dotfiles/scripts/zapier/make-mr.sh 40 - alias mkuser=$HOME/dotfiles/scripts/zapier/make-test-user.sh 41 - alias zghorg="ghorg --config ~/code/zapier/ghorg-conf.yaml clone zapier" 42 - alias cdz="cd ~/code/zapier" 38 + if [[ $(hostname) == "asteroid" && -f "${ZAPIER_ZSHENV}" ]]; then 39 + source "${ZAPIER_ZSHENV}" 43 40 fi 44 41 45 42 # Accepts a target markdown file and opens it with firefox. ··· 47 44 # Expects the [markdown viewer](https://github.com/simov/markdown-viewer) 48 45 # FF extension to be installed. 49 46 function mdp { 50 - local file="${1}" 47 + local file="${1}" 51 48 52 - # If it isn't already an absolute path, make it one 53 - if [[ ! "$file" == "/"* ]]; then 54 - file="${PWD}/${file}" 55 - fi 49 + # If it isn't already an absolute path, make it one 50 + if [[ ! "$file" == "/"* ]]; then 51 + file="${PWD}/${file}" 52 + fi 56 53 57 - # If it isn't a markdown file, bail 58 - if [[ ! "$file" == *".md" ]]; then 59 - echo "Must provide a markdown file" 60 - exit 1 61 - fi 54 + # If it isn't a markdown file, bail 55 + if [[ ! "$file" == *".md" ]]; then 56 + echo "Must provide a markdown file" 57 + exit 1 58 + fi 62 59 63 - firefox "${file}" 60 + firefox "${file}" 64 61 } 65 62 66 63 function rand { 67 - count=$1 68 - if [ -z "$count" ]; then 69 - count=8 70 - fi 71 - date +%s | shasum | head -c$1 64 + count=$1 65 + if [ -z "$count" ]; then 66 + count=8 67 + fi 68 + date +%s | shasum | head -c$1 72 69 } 73 70 74 71 function gittmp { 75 - repo_uri=$1 76 - if [ -z "$1" ]; then 77 - echo "must provide a repo to clone" 78 - return 1 79 - fi 72 + repo_uri=$1 73 + if [ -z "$1" ]; then 74 + echo "must provide a repo to clone" 75 + return 1 76 + fi 80 77 81 - newdir=$(mktemp -d) 82 - git clone $1 $newdir 78 + newdir=$(mktemp -d) 79 + git clone $1 $newdir 83 80 84 - session_name="gittmp-$(rand 4)" 85 - tmux new -A -s $session_name -c $newdir -d 86 - tmux switch -t $session_name 81 + session_name="gittmp-$(rand 4)" 82 + tmux new -A -s $session_name -c $newdir -d 83 + tmux switch -t $session_name 87 84 } 88 85 89 86 # Opens for today's note in ~/obsidian/brain/Daily/ 90 87 # Gets timestamp formatted like YYYY-MM-DD.md 91 88 function dn { 92 - vault="brain" 93 - if [[ $(hostname) == "asteroid" ]]; then 94 - vault="zapier" 95 - fi 89 + vault="brain" 90 + if [[ $(hostname) == "asteroid" ]]; then 91 + vault="zapier" 92 + fi 96 93 97 - daily_notes="$HOME/.obsidian/${vault}/Daily/" 98 - todays_note="$(date +%Y-%m-%d).md" 94 + daily_notes="$HOME/.obsidian/${vault}/Daily/" 95 + todays_note="$(date +%Y-%m-%d).md" 99 96 100 - cd $daily_notes 101 - nvim -c "Goyo" -c $'normal Go\eo***\eo\eo' -c "startinsert" $todays_note 97 + cd $daily_notes 98 + nvim -c "Goyo" -c $'normal Go\eo***\eo\eo' -c "startinsert" $todays_note 102 99 } 103 100 104 101 function gbrowse() { 105 - branch=$(git branch --show-current) 106 - if [ -z "$branch" ]; then 107 - branch=$(git rev-parse HEAD) 108 - fi 102 + branch=$(git branch --show-current) 103 + if [ -z "$branch" ]; then 104 + branch=$(git rev-parse HEAD) 105 + fi 109 106 110 - origin=$(git remote get-url origin) 111 - if [[ "$origin" =~ .*gitlab\.com.* ]]; then 112 - # Assume it's on gitlab 113 - # gitlab's cli doesn't have a `browse` command, so do this instead 114 - baseurl=$origin 115 - if [[ "$origin" =~ ^git@gitlab.* ]]; then 116 - baseurl=$(echo $origin | sed 's/git@/https:\/\//' | sed 's/\.com:/\.com\//' | sed 's/\.git$//') 117 - fi 118 - open "$baseurl/-/blob/$branch/$1" 119 - else 120 - # Assume it's on github 121 - gh browse --branch="$branch" $1 122 - fi 107 + origin=$(git remote get-url origin) 108 + if [[ "$origin" =~ .*gitlab\.com.* ]]; then 109 + # Assume it's on gitlab 110 + # gitlab's cli doesn't have a `browse` command, so do this instead 111 + baseurl=$origin 112 + if [[ "$origin" =~ ^git@gitlab.* ]]; then 113 + baseurl=$(echo $origin | sed 's/git@/https:\/\//' | sed 's/\.com:/\.com\//' | sed 's/\.git$//') 114 + fi 115 + open "$baseurl/-/blob/$branch/$1" 116 + else 117 + # Assume it's on github 118 + gh browse --branch="$branch" $1 119 + fi 123 120 } 124 121 125 122 export HOMEBREW_BUNDLE_FILE="$HOME/dotfiles/Brewfile"