more reorg

This commit is contained in:
2019-12-08 16:20:23 -08:00
parent 1762d6246f
commit a64d42bde0
8 changed files with 39 additions and 27 deletions

4
bash.d/10-paths.sh Normal file
View File

@@ -0,0 +1,4 @@
#!/bin/bash
export PATH="./node_modules/.bin;$PATH"
export PATH="$HOME/.cargo/bin;$PATH"

View File

@@ -2,10 +2,5 @@
PROMPT_SUBMODULE="${SUBMODULES}/romkatv-gitstatus"
if ls -A "$PROMPT_SUBMODULE"; then
git submodule init
git submodule update
fi
# shellcheck disable=SC1090
source "$PROMPT_SUBMODULE/gitstatus.prompt.sh"

View File

@@ -0,0 +1,6 @@
{
"version": 1,
"cli": {
"analytics": false
}
}

View File

@@ -1,34 +1,41 @@
#!/bin/bash
OLD_PWD=$PWD
timestamp=$(date '+%m%d%Y%H%M')
function finish {
cd "$OLD_PWD" || exit;
}
trap finish EXIT
# From aaronjensen/dotfiles
DOTFILES=$( cd "$(dirname "${BASH_SOURCE[0]}")" && pwd || return)
cd "$(dirname "$0")"
F=$( pwd |sed -e "s#$HOME/\?##" )
cd "$DOTFILES/dotfiles" || exit;
for P in *
do
# skip setup
if [ "$P" = "setup.sh" ]; then continue; fi
if [ "$P" = "README.md" ]; then continue; fi
find . -maxdepth 1 -type f -printf "%f\0" | while IFS= read -r -d $'\0' P; do
target="${HOME}/${P}"
backup="${HOME}/${P}.orig.${timestamp}"
# ensure permissions
chmod -R o-rwx,g-rwx "$P"
# skip existing links
if [ -h "$target" ]; then continue; fi
# skip existing links
if [ -h "$HOME/.$P" ]; then continue; fi
# move existing dir out of the way
if [ -e "$target" ]; then
if [ -e "$backup" ]; then
echo "want to override $target but backup exists"
continue;
fi
# move existing dir out of the way
if [ -e "$HOME/.$P" ]; then
if [ -e "$HOME/__$P" ]; then
echo "want to override $HOME/.$P but backup exists"
continue;
echo -n "Backup ${P}"
mv -v "$target" "$backup"
fi
echo -n "Backup "
mv -v "$HOME/.$P" "$HOME/__$P"
fi
# create link
ln -v -s "$PWD/$P" "$target"
# create link
echo -n "Link "
ln -v -s "$F/$P" "$HOME/.$P"
# ensure permissions
chmod -R o-rwx,g-rwx "$target"
done