forked from divad12/khan-dotfiles
-
Notifications
You must be signed in to change notification settings - Fork 17
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
This setups up phabricator Issue: https://khanacademy.atlassian.net/browse/INFRA-6649 Test plan: Remove ~/.arcrc, run setup-arc.sh and verify everything still works.
- Loading branch information
Eric Brown
authored
Jul 30, 2021
1 parent
1c7e1ea
commit 694e26b
Showing
1 changed file
with
41 additions
and
0 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,41 @@ | ||
#!/bin/bash | ||
|
||
# Bail on any errors | ||
set -e | ||
|
||
# Install in $HOME by default, but can set an alternate destination via $1. | ||
ROOT=${1-$HOME} | ||
mkdir -p "$ROOT" | ||
|
||
# the directory all repositories will be cloned to | ||
REPOS_DIR="$ROOT/khan" | ||
|
||
# derived path location constants | ||
DEVTOOLS_DIR="$REPOS_DIR/devtools" | ||
|
||
# Load shared setup functions. | ||
. "$DEVTOOLS_DIR"/khan-dotfiles/shared-functions.sh | ||
|
||
trap exit_warning EXIT # from shared-functions.sh | ||
|
||
# Set up .arcrc: we can't update this through the standard process | ||
# because it has secrets embedded in it, but our arcanist fork will | ||
# do the updates for us. | ||
setup_arc() { | ||
if [ ! -f "$HOME/.arcrc" ]; then | ||
echo "Time to set up arc to talk to Phabricator!" | ||
echo "First, go make sure you're logged in and your" | ||
echo "account is set up (use Google OAuth to create" | ||
echo "an account, if you haven't). Click here to start:" | ||
echo " --> https://phabricator.khanacademy.org <--" | ||
echo -n "Press enter when you're logged in: " | ||
read | ||
# This is added to PATh by dotfiles, but those may not be sourced yet. | ||
PATH="$DEVTOOLS_DIR/arcanist/khan-bin:$PATH" | ||
arc install-certificate -- https://phabricator.khanacademy.org | ||
fi | ||
} | ||
|
||
setup_arc # pre-req: clone_repos | ||
|
||
trap - EXIT |