Skip to content

Commit

Permalink
Each.sh relative path
Browse files Browse the repository at this point in the history
  • Loading branch information
mruz committed Apr 1, 2014
1 parent 5661028 commit 8bdb905
Showing 1 changed file with 4 additions and 2 deletions.
6 changes: 4 additions & 2 deletions private/Each.sh
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,8 @@
# @category CLI
# @version 2.0

PATH="$( cd "$( dirname "${BASH_SOURCE[0]}" )" && pwd )"

if [ $1 ]
then
# Explode the first param by delimiter /
Expand All @@ -15,7 +17,7 @@ then

# Run TASK ACTION, it should return IDS eg. 1 5 7 13
# Generated by echo implode(' ', array(1, 5, 7, 13));
IDS=(`php index.php $TASK $ACTION`)
IDS=(`/usr/bin/php $PATH/index.php $TASK $ACTION`)
fi

if [ $2 ]
Expand All @@ -31,7 +33,7 @@ then
# Foreach IDS run TASK2 ACTION2 ID
for ID in "${IDS[@]}"
do
OUTPUT=`php index.php $TASK2 $ACTION2 $ID`
OUTPUT=`/usr/bin/php $PATH/index.php $TASK2 $ACTION2 $ID`

# If debug is specified display OUTPUT
if [ "$3" == "debug" ]
Expand Down

0 comments on commit 8bdb905

Please sign in to comment.