1
1
Fork 0
mirror of https://github.com/tonydamage/nux-env.git synced 2025-12-11 13:24:28 +01:00

Added support for scripts and git-all script.

Signed-off-by: Tony Tkacik <tonydamage@gmail.com>
This commit is contained in:
Tony Tkáčik 2015-04-21 11:02:35 +02:00
parent 8bfdb1fb9e
commit e83ba8a88c
4 changed files with 57 additions and 0 deletions

4
bashrc
View file

@ -114,6 +114,10 @@ fi
if [ -d ~/bin ]; then
PATH="$PATH:~/bin"
fi
# FIXME: Should autodetect folder based on location
if [ -d ~/Environment/bin ]; then
PATH="$PATH:~/Environment/bin"
fi
if [ -d ~/.local/bin ]; then
PATH="$PATH:~/.local/bin"
fi

5
bin/analysis-java-find-uses Executable file
View file

@ -0,0 +1,5 @@
#!/bin/sh
location=.
file_pattern="*.java"
find $location -iname "$file_pattern" | xargs grep -l "$1" | sort -u

48
bin/git-all Executable file
View file

@ -0,0 +1,48 @@
#!/bin/sh
base_folder=`pwd`
update_branch="master"
method=$1
shift
echo $current_folder;
## pull
pull() {
if [ "$1" = "$update_branch" ]; then
echo " Pulling latest changes"
git pull
else
echo " Skipping pull."
fi
}
## commit
commit() {
echo "Doing Git Commit" $1 $2;
git commit -a -s -m "$2";
}
## execute
execute() {
shift;
eval "$*";
}
##
shell() {
shift;
bash -i;
}
for git_repository in $(find $base_folder -iname ".git" -type d); do
repo_base=$(dirname "$git_repository")
cd "$repo_base"
echo Repository: $(basename $repo_base)
echo " Path:" $(pwd)
current_branch=$(git branch | grep "*" | cut -d" " -f2)
echo " Branch: $current_branch"
echo " Action: " $method
$method $current_branch "$*"
done
cd $base_folder