Mercurial > index.cgi > dotfiles
annotate .shared/b @ 274:02a3d7c46b2b
Better 'ds end' functionality, and ability to share a remote environment more easily
author | Steve Huston <huston@srhuston.net> |
---|---|
date | Fri, 26 Apr 2024 12:02:56 -0400 |
parents | 61b830d34016 |
children |
rev | line source |
---|---|
265
df0b24d4fabd
Think I'm ready to check this all in now; shared dotfiles that can be "sent"
Steve Huston <huston@srhuston.net>
parents:
diff
changeset
|
1 #!/bin/bash |
df0b24d4fabd
Think I'm ready to check this all in now; shared dotfiles that can be "sent"
Steve Huston <huston@srhuston.net>
parents:
diff
changeset
|
2 # Bootstrap file - pulls everything else through the web server and sets up an |
df0b24d4fabd
Think I'm ready to check this all in now; shared dotfiles that can be "sent"
Steve Huston <huston@srhuston.net>
parents:
diff
changeset
|
3 # environment. Load with: |
269
ae940a45bfff
Change in a comment but keeps consistency
Steve Huston <huston@princeton.edu>
parents:
265
diff
changeset
|
4 # export DOTSHARE_PORT=<port> ; eval "$(curl http://localhost:${DOTSHARE_PORT}/b)" |
265
df0b24d4fabd
Think I'm ready to check this all in now; shared dotfiles that can be "sent"
Steve Huston <huston@srhuston.net>
parents:
diff
changeset
|
5 |
df0b24d4fabd
Think I'm ready to check this all in now; shared dotfiles that can be "sent"
Steve Huston <huston@srhuston.net>
parents:
diff
changeset
|
6 # These are the files we'll pull over from the dotshare directory; this way |
df0b24d4fabd
Think I'm ready to check this all in now; shared dotfiles that can be "sent"
Steve Huston <huston@srhuston.net>
parents:
diff
changeset
|
7 # that directory can collect other things if needed, but we only pull what we |
df0b24d4fabd
Think I'm ready to check this all in now; shared dotfiles that can be "sent"
Steve Huston <huston@srhuston.net>
parents:
diff
changeset
|
8 # need to bootstrap (the vim plugins, for example, can be loaded the typical |
df0b24d4fabd
Think I'm ready to check this all in now; shared dotfiles that can be "sent"
Steve Huston <huston@srhuston.net>
parents:
diff
changeset
|
9 # way, or if we really need to a manual pull can get them all) |
273
61b830d34016
Get some basic git config stuff shared wider
Steve Huston <huston@princeton.edu>
parents:
269
diff
changeset
|
10 FILES="bash_prompt gitconfig screenrc shared_bashrc .vim/vimrc .vim/gvimrc .vim/autoload/plug.vim" |
265
df0b24d4fabd
Think I'm ready to check this all in now; shared dotfiles that can be "sent"
Steve Huston <huston@srhuston.net>
parents:
diff
changeset
|
11 |
df0b24d4fabd
Think I'm ready to check this all in now; shared dotfiles that can be "sent"
Steve Huston <huston@srhuston.net>
parents:
diff
changeset
|
12 # We need a temporary directory where we can put things. We should assume |
df0b24d4fabd
Think I'm ready to check this all in now; shared dotfiles that can be "sent"
Steve Huston <huston@srhuston.net>
parents:
diff
changeset
|
13 # $HOME exists and that's where we're going to make the temp directory. This |
df0b24d4fabd
Think I'm ready to check this all in now; shared dotfiles that can be "sent"
Steve Huston <huston@srhuston.net>
parents:
diff
changeset
|
14 # way when we logout, everything can be cleaned up. |
df0b24d4fabd
Think I'm ready to check this all in now; shared dotfiles that can be "sent"
Steve Huston <huston@srhuston.net>
parents:
diff
changeset
|
15 DOTHOME=`mktemp -d ${HOME}/.ds-tmp.XXXXXX` || exit 255 |
df0b24d4fabd
Think I'm ready to check this all in now; shared dotfiles that can be "sent"
Steve Huston <huston@srhuston.net>
parents:
diff
changeset
|
16 |
df0b24d4fabd
Think I'm ready to check this all in now; shared dotfiles that can be "sent"
Steve Huston <huston@srhuston.net>
parents:
diff
changeset
|
17 # Now make sure to clean this up when we leave |
df0b24d4fabd
Think I'm ready to check this all in now; shared dotfiles that can be "sent"
Steve Huston <huston@srhuston.net>
parents:
diff
changeset
|
18 trap "rm -rf $DOTHOME" 0 |
df0b24d4fabd
Think I'm ready to check this all in now; shared dotfiles that can be "sent"
Steve Huston <huston@srhuston.net>
parents:
diff
changeset
|
19 |
df0b24d4fabd
Think I'm ready to check this all in now; shared dotfiles that can be "sent"
Steve Huston <huston@srhuston.net>
parents:
diff
changeset
|
20 for F in $FILES ; do |
df0b24d4fabd
Think I'm ready to check this all in now; shared dotfiles that can be "sent"
Steve Huston <huston@srhuston.net>
parents:
diff
changeset
|
21 curl --create-dirs -so ${DOTHOME}/$F http://localhost:${DOTSHARE_PORT}/$F |
df0b24d4fabd
Think I'm ready to check this all in now; shared dotfiles that can be "sent"
Steve Huston <huston@srhuston.net>
parents:
diff
changeset
|
22 done |
df0b24d4fabd
Think I'm ready to check this all in now; shared dotfiles that can be "sent"
Steve Huston <huston@srhuston.net>
parents:
diff
changeset
|
23 |
274
02a3d7c46b2b
Better 'ds end' functionality, and ability to share a remote environment more easily
Steve Huston <huston@srhuston.net>
parents:
273
diff
changeset
|
24 cat > ${DOTHOME}/.env-setup << EOF |
02a3d7c46b2b
Better 'ds end' functionality, and ability to share a remote environment more easily
Steve Huston <huston@srhuston.net>
parents:
273
diff
changeset
|
25 export DOTHOME=${DOTHOME} |
265
df0b24d4fabd
Think I'm ready to check this all in now; shared dotfiles that can be "sent"
Steve Huston <huston@srhuston.net>
parents:
diff
changeset
|
26 source ${DOTHOME}/shared_bashrc |
274
02a3d7c46b2b
Better 'ds end' functionality, and ability to share a remote environment more easily
Steve Huston <huston@srhuston.net>
parents:
273
diff
changeset
|
27 EOF |
02a3d7c46b2b
Better 'ds end' functionality, and ability to share a remote environment more easily
Steve Huston <huston@srhuston.net>
parents:
273
diff
changeset
|
28 |
02a3d7c46b2b
Better 'ds end' functionality, and ability to share a remote environment more easily
Steve Huston <huston@srhuston.net>
parents:
273
diff
changeset
|
29 source ${DOTHOME}/.env-setup |