Testing home directory scripts by setting $HOME to the location of the test directory
Posted
by intuited
on Super User
See other posts from Super User
or by intuited
Published on 2010-04-20T22:47:59Z
Indexed on
2010/04/20
22:53 UTC
Read the original article
Hit count: 506
I have an interdependent collection of scripts in my ~/bin directory as well as a developed ~/.vim directory and some other libraries and such in other subdirectories. I've been versioning all of this using git, and have realized that it would be potentially very easy and useful to do development and testing of new and existing scripts, vim plugins, etc. using a cloned repo, and then pull the working code into my actual home directory with a merge.
The easiest way to do this would seem to be to just change & export $HOME, eg
cd ~/testing; git clone ~ home
export HOME=~/testing/home
cd ~
screen -S testing-home
# start vim, write/revise plugins, edit scripts, etc.
# test revisions
However since I've never tried this before I'm concerned that some programs, environment variables, etc., may end up using my actual home directory instead of the exported one. Is this a viable strategy? Are there just a few outliers that I should be careful about? Is there a much better way to do this sort of thing?
© Super User or respective owner