Last active
January 25, 2024 23:09
-
-
Save rudimusmaximus/cbb877cb5797b00d7fbb9ddc88e7f8b9 to your computer and use it in GitHub Desktop.
Installs a bare repo into .cfg folder in home. The repo has my dot files for bash customizations. See repo for notes.
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
#!/bin/bash | |
echo "rudimusmaximus says, hi there. Creating bare repo clone of configDotFiles.git into $HOME/.cfg" | |
git clone --bare https://github.com/rudimusmaximus/configDotFiles.git $HOME/.cfg | |
function config { | |
/usr/bin/git --git-dir=$HOME/.cfg/ --work-tree=$HOME $@ | |
} | |
mkdir -p .cfg-backup | |
config checkout | |
if [ $? = 0 ]; then | |
echo "Checked out config from bare clone of configDotFiles in $HOME/.cfg"; | |
else | |
echo "Ok. Moving offending files." | |
echo "Pre-existing dot files were moved to the .cfg-backup directory. Running config checkout again."; | |
config checkout 2>&1 | egrep "\s+\." | awk {'print $1'} | xargs -I{} mv {} .cfg-backup/{} | |
fi; | |
config checkout | |
echo "Checked out config from bare clone of configDotFiles in $HOME/.cfg"; | |
config config status.showUntrackedFiles no | |
echo "Turned off showing untracked files" | |
echo "Stop tracking .extra file" | |
config update-index --assume-unchanged .extra | |
echo "The .extra file is now downloaded but will not be tracked for future changes." | |
echo "Finished." | |
echo "We're using the curl-and-pipe method to run the install, so there is no script file to delete after execution. The script runs in memory and terminates when it's done, leaving no trace on the disk." | |
echo "Enjoy!" |
Updated install script on configDotFiles repo to be
curl -sSf https://gist.githubusercontent.com/rudimusmaximus/cbb877cb5797b00d7fbb9ddc88e7f8b9/raw | bash
updated so self deletes at end
updated again, no need for self delete. see echo at end of script.
special handling for .extra file (stop tracking for user to make private local machine changes)
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Note: set up on Chromebook penguin container, but had to skip the config config line that silences untracked files. I suspect git version variation, but working fine so far.