Add add/delete submodule scripts and remove them from gitignore

This commit is contained in:
Kevin MacMartin 2014-10-26 08:38:22 -04:00
parent a3fd39afe6
commit 35a433f2a4
3 changed files with 14 additions and 4 deletions

4
.gitignore vendored
View file

@ -1,6 +1,2 @@
add-submodule
delete-submodule
add-pager-submodule
delete-pager-submodule
vim/bundle.user/*
vim/vimrc.user

7
add-submodule Executable file
View file

@ -0,0 +1,7 @@
#!/usr/bin/env bash
[[ -z $1 ]] && exit 1
[[ -z $2 ]] && exit 1
git submodule add $1 vim/bundle/${2}
git submodule update --init --recursive

7
delete-submodule Executable file
View file

@ -0,0 +1,7 @@
#!/usr/bin/env bash
[[ -z $1 ]] && exit 1
[[ -d "vim/bundle/${1}" ]] && git submodule deinit -f $2 "vim/bundle/${1}" || echo "Couldn't run 'git submodule deinit $2 vim/bundle/${1}', $1 does not exist"
[[ -d "vim/bundle/${1}" ]] && git rm "vim/bundle/${1}" || echo "Couldn't run 'git rm vim/bundle/${1}', vim/bundle/${1} does not exist"
[[ -d "${PWD}/.git/modules/vim/bundle/${1}" ]] && rm -rf "${PWD}/.git/modules/vim/bundle/${1}" || echo "Couldn't run 'rm -rf ${PWD}/.git/modules/vim/bundle/${1}', ${PWD}/.git/modules/vim/bundle/${1} does not exist"