Add scripts

This commit is contained in:
Correl Roush 2018-02-22 09:56:10 -05:00
parent d699950ad3
commit 0bb22304e0
6 changed files with 31 additions and 0 deletions

2
bin/docker-clean-containers Executable file
View file

@ -0,0 +1,2 @@
#!/bin/bash
docker rm $(docker ps -a -q)

2
bin/docker-clean-images Executable file
View file

@ -0,0 +1,2 @@
#!/bin/bash
docker rmi $(docker images -q --filter "dangling=true")

3
bin/git-blameconflict Executable file
View file

@ -0,0 +1,3 @@
#!/bin/bash
for f in $(git status --porcelain|grep '^UU'|awk '{print $2}'); do echo "$f"; git --no-pager blame -L '/^<<<</,/^>>>>/' -- $f; echo; done;

View file

@ -4,3 +4,4 @@ set +e
_recipe brew
_recipe git
_recipe zsh
_recipe bin

5
recipes/bin Normal file
View file

@ -0,0 +1,5 @@
#!/bin/bash
set +e
_recipe path
_run "Add dotfiles/bin to PATH" _path_high ${HOME}/dotfiles/bin

18
recipes/path Normal file
View file

@ -0,0 +1,18 @@
#!/bin/bash
set +e
function _path_low {
PATH="$1:$PATH"
test -r ~/.bash_profile && echo "export PATH='$1'":'"$PATH"' >>~/.bash_profile
echo "export PATH='$1'":'"$PATH"' >>~/.profile
}
function _path_high {
PATH="$PATH:$1"
test -r ~/.bash_profile && echo 'export PATH="$PATH"':"'$PATH'" >>~/.bash_profile
echo "export PATH='$1'":'"$PATH"' >>~/.profile
}
function _path {
_path_low $@
}