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 1
1
#! /bin/bash
2
2
3
3
CRED=~ /.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
5
10
6
11
set -euo pipefail
7
12
USER=$( gh api user -q .login)
Original file line number Diff line number Diff line change 1
1
#! /bin/bash
2
- PREVIEW_VERSION=" 1.1.0 "
2
+ PREVIEW_VERSION=" 1.1.1 "
3
3
4
4
set -eo pipefail
5
5
echo " 🐇 Hello! I'm the Docs Build Rabbit"
@@ -128,8 +128,9 @@ while [[ $# -gt 0 ]]; do
128
128
esac
129
129
done
130
130
131
+ DOCS_SITE=$( realpath $0 /../..)
132
+
131
133
if [ -n " $UPDATE " ]; then
132
- DOCS_SITE=$( realpath $0 /../..)
133
134
cd $DOCS_SITE
134
135
135
136
echo " 🐇 Let's try to update preview, by updating your docs-site checkout"
@@ -155,6 +156,17 @@ if [ -n "$INIT" ]; then
155
156
brew install gh jq yq
156
157
gh auth token || gh auth login
157
158
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
+
158
170
echo " 🐇 initialised preview script"
159
171
exit 0
160
172
fi
You can’t perform that action at this time.
0 commit comments