We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
1 parent c87a22f commit a819299Copy full SHA for a819299
bin/task
@@ -11,14 +11,17 @@ RED=$(printf '\033[31m')
11
RESET=$(printf '\033[0m')
12
13
while [ -d $CURRENT_DIR ] && [ $CURRENT_DIR != '/' ]; do
14
- cd $CURRENT_DIR
15
-
16
- if [ ! -f ./Taskfile ]
+ if [ -f ./Taskfile ]
17
then
18
- echo -e "${RED}ERROR: ${RESET}./Taskfile not found in this directory."
19
- exit 1
+ # Taskfile found, execute the given task
+ ./Taskfile $@
+ exit $?
+ else
20
+ # Taskfile not found, trying the parent directory
21
+ cd ../
22
+ CURRENT_DIR=$(pwd)
23
fi
- ./Taskfile $@
- exit $?
24
done
25
+
26
+echo -e "${RED}ERROR: ${RESET}./Taskfile not found in the current or parent directories."
27
+exit 1
0 commit comments