forked from mudhorn/dotfiles
Merge pull request #5 from digitalsparky/master
Adding some doco and such
This commit is contained in:
commit
cc3981295d
13
README.md
13
README.md
|
@ -6,8 +6,19 @@ git clone https://github.com/flipsidecreations/dotfiles.git
|
||||||
|
|
||||||
cd dotfiles
|
cd dotfiles
|
||||||
```
|
```
|
||||||
### Run intstall
|
### Run install
|
||||||
```
|
```
|
||||||
./install.sh
|
./install.sh
|
||||||
```
|
```
|
||||||
|
|
||||||
|
# Uninstallation
|
||||||
|
|
||||||
|
### Change to dotfiles folder
|
||||||
|
```
|
||||||
|
cd ~/dotfiles
|
||||||
|
```
|
||||||
|
|
||||||
|
### Run uninstaller
|
||||||
|
```
|
||||||
|
./uninstall.sh
|
||||||
|
```
|
||||||
|
|
13
install.sh
13
install.sh
|
@ -1,15 +1,20 @@
|
||||||
#!/bin/bash
|
#!/bin/bash
|
||||||
|
|
||||||
|
# Find all dot files then if the original file exists, create a backup
|
||||||
|
# Once backed up to {file}.dtbak symlink the new dotfile in place
|
||||||
for file in $(find . -maxdepth 1 -name ".*" -type f -printf "%f\n" ); do
|
for file in $(find . -maxdepth 1 -name ".*" -type f -printf "%f\n" ); do
|
||||||
if [ -e ~/$file ]; then
|
if [ -e ~/$file ]; then
|
||||||
mv -f ~/$file{,.dtbak}
|
mv -f ~/$file{,.dtbak}
|
||||||
fi
|
fi
|
||||||
ln -s $PWD/$file ~/$file
|
ln -s $PWD/$file ~/$file
|
||||||
done
|
done
|
||||||
if hash vim-addon 2>/dev/null; then
|
|
||||||
|
# Check if vim-addon installed, if not, install it automatically
|
||||||
|
if hash vim-addon 2>/dev/null; then
|
||||||
echo "vim-addon (vim-scripts) installed"
|
echo "vim-addon (vim-scripts) installed"
|
||||||
else
|
else
|
||||||
echo "vim-addon (vim-scripts) not installed, running 'sudo apt update; sudo apt install bc'"
|
echo "vim-addon (vim-scripts) not installed, installing"
|
||||||
sudo apt update; sudo apt install vim-scripts
|
sudo apt update && sudo apt -y install vim-scripts
|
||||||
fi
|
fi
|
||||||
|
|
||||||
echo "Installed"
|
echo "Installed"
|
||||||
|
|
|
@ -1,4 +1,7 @@
|
||||||
#!/bin/bash
|
#!/bin/bash
|
||||||
|
|
||||||
|
# Loop through all the dotfiles, if the file is a symlink then remove it
|
||||||
|
# Then if the backup file exists, restore it to it's original location
|
||||||
for file in $(find . -maxdepth 1 -name ".*" -type f -printf "%f\n" ); do
|
for file in $(find . -maxdepth 1 -name ".*" -type f -printf "%f\n" ); do
|
||||||
if [ -h ~/$file ]; then
|
if [ -h ~/$file ]; then
|
||||||
rm -f ~/$file
|
rm -f ~/$file
|
||||||
|
@ -7,4 +10,5 @@ for file in $(find . -maxdepth 1 -name ".*" -type f -printf "%f\n" ); do
|
||||||
mv -f ~/$file{.dtbak,}
|
mv -f ~/$file{.dtbak,}
|
||||||
fi
|
fi
|
||||||
done
|
done
|
||||||
|
|
||||||
echo "Uninstalled"
|
echo "Uninstalled"
|
||||||
|
|
Loading…
Reference in a new issue