Mercurial > index.cgi > dotfiles
comparison .shared/b @ 265:df0b24d4fabd
Think I'm ready to check this all in now; shared dotfiles that can be "sent"
through an SSH connection to be used and cleaned up when finished.
| author | Steve Huston <huston@srhuston.net> |
|---|---|
| date | Wed, 24 Apr 2024 16:15:40 -0400 |
| parents | |
| children | ae940a45bfff |
comparison
equal
deleted
inserted
replaced
| 264:bb69763716a7 | 265:df0b24d4fabd |
|---|---|
| 1 #!/bin/bash | |
| 2 # Bootstrap file - pulls everything else through the web server and sets up an | |
| 3 # environment. Load with: | |
| 4 # P=<port> eval "$(curl http://localhost:<port>/b)" | |
| 5 | |
| 6 # These are the files we'll pull over from the dotshare directory; this way | |
| 7 # that directory can collect other things if needed, but we only pull what we | |
| 8 # need to bootstrap (the vim plugins, for example, can be loaded the typical | |
| 9 # way, or if we really need to a manual pull can get them all) | |
| 10 FILES="bash_prompt screenrc shared_bashrc .vim/vimrc .vim/gvimrc .vim/autoload/plug.vim" | |
| 11 | |
| 12 # We need a temporary directory where we can put things. We should assume | |
| 13 # $HOME exists and that's where we're going to make the temp directory. This | |
| 14 # way when we logout, everything can be cleaned up. | |
| 15 DOTHOME=`mktemp -d ${HOME}/.ds-tmp.XXXXXX` || exit 255 | |
| 16 | |
| 17 # Now make sure to clean this up when we leave | |
| 18 trap "rm -rf $DOTHOME" 0 | |
| 19 | |
| 20 for F in $FILES ; do | |
| 21 curl --create-dirs -so ${DOTHOME}/$F http://localhost:${DOTSHARE_PORT}/$F | |
| 22 done | |
| 23 | |
| 24 export DOTHOME | |
| 25 source ${DOTHOME}/shared_bashrc |
