project lib added

This commit is contained in:
Sameer Rahmani 2015-02-05 00:35:12 +03:30
parent 7bee610c67
commit 662caf1b04
1 changed files with 28 additions and 0 deletions

28
lib/projects.zsh Normal file
View File

@ -0,0 +1,28 @@
function find_project() {
project_name=$1
for i in $PROJECT_SOURCES
do
if [[ -a "$i/$project_name/.my.zsh/Makefile" ]]
then
echo "$i/$project_name/.my.zsh/"
fi
done
}
function project() {
project_name=$1
action=$2
make_file=$(find_project $1)
pushd > /dev/null
cd "$make_file/../"
echo "Executing '$action' hook of '$project_name'"
make -f $make_file/Makefile $action
popd > /dev/null
}