File tree Expand file tree Collapse file tree 2 files changed +20
-3
lines changed Expand file tree Collapse file tree 2 files changed +20
-3
lines changed Original file line number Diff line number Diff line change 11#! /bin/bash
22
33CRED=~ /.git-credentials
4- cp $CRED $CRED .backup # if it exists
4+
5+ if [ -f $CRED ]; then
6+ BACKUP=$CRED .backup
7+ mv $CRED $BACKUP
8+ echo " Backed up credentials to $BACKUP "
9+ fi
510
611set -euo pipefail
712USER=$( gh api user -q .login)
Original file line number Diff line number Diff line change 11#! /bin/bash
2- PREVIEW_VERSION=" 1.1.0 "
2+ PREVIEW_VERSION=" 1.1.1 "
33
44set -eo pipefail
55echo " 🐇 Hello! I'm the Docs Build Rabbit"
@@ -128,8 +128,9 @@ while [[ $# -gt 0 ]]; do
128128 esac
129129done
130130
131+ DOCS_SITE=$( realpath $0 /../..)
132+
131133if [ -n " $UPDATE " ]; then
132- DOCS_SITE=$( realpath $0 /../..)
133134 cd $DOCS_SITE
134135
135136 echo " 🐇 Let's try to update preview, by updating your docs-site checkout"
@@ -155,6 +156,17 @@ if [ -n "$INIT" ]; then
155156 brew install gh jq yq
156157 gh auth token || gh auth login
157158
159+ if [ ! -f ~ /.git-credentials ]; then
160+ scripts/add-credentials
161+ else
162+ echo " Git credentials found, let's assume they are good."
163+ echo " If you get errors cloning private repos, then try running:"
164+ echo
165+ echo " cd $DOCS_SITE "
166+ echo " scripts/add-credentials"
167+ echo
168+ fi
169+
158170 echo " 🐇 initialised preview script"
159171 exit 0
160172fi
You can’t perform that action at this time.
0 commit comments