Comments (4)
Not the best bash scripting, but I got around the issue like this for now:
echo $DOTFILE | egrep -q '(^rbenv/$|pyenv/$|nodenv/$)' && continue
mkdir -p $(pyenv root)
mkdir -p $(rbenv root)
mkdir -p $(nodenv root)
for FOLDER in rbenv pyenv nodenv; do
if [ -d "$FOLDER" ]; then
for DOTFILE in $FOLDER/*; do
DIRFILE="$DOTFILESDIR/$DOTFILE"
HOMEFILE="$HOME/.$DOTFILE"
if [ -L "$HOMEFILE" ] && ! [ -d $DOTFILE ]
then
ln -sfv "$DIRFILE" "$HOMEFILE"
elif ! [ -d $DOTFILE ]
then
rm -v "$HOMEFILE"
ln -sv "$DIRFILE" "$HOMEFILE"
else
echo "ignoring $DOTFILE because it is a directory"
fi
done
fi
done
from dotfiles.
will attempt to rm -rv the ~/.rbenv folder if the script is run a second time.
Yep but as it's a symlink that's quick enough for us not to care. If it's a preexisting directory it'll kill it.
from dotfiles.
Ah, I see. Perhaps then you can add to the .gitignore:
rbenv/*
!rbenv/default-gems
I ran into the situation where I had the setup script run the first time but I didn't have the rbenv folder in my dotfiles. When I tried to later add the rbenv
folder to my dotfiles, it attempted to delete the existing rbenv installation as it wasn't a symlink but an actual file.
Definitely a fringe case though.
from dotfiles.
from dotfiles.
Related Issues (5)
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from dotfiles.