Skip to content

Commit a54692d

Browse files
committed
directory based quick tasks
1 parent 71dc00c commit a54692d

4 files changed

Lines changed: 19 additions & 2 deletions

File tree

README.md

Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -120,6 +120,17 @@ The builtin events are:
120120
* **fail** *(exit code)* - when a command fails to execute (broadcasted by *execute* and *check*
121121
functions)
122122

123+
## Quick Tasks
124+
125+
Quick Tasks are tasks defined in a directory and will work only in that directory only. To use them, create a file `.soda-tasks` in any directory and call the tasks without using namespaces:
126+
127+
task my-task
128+
my_task() {
129+
echo "My Task"
130+
}
131+
132+
$ soda my-task
133+
123134
## Bash Completion
124135

125136
SODA supports bash completion by importing all namespaces and searching for defined parameters

config/soda/conventions.conf

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -24,4 +24,5 @@
2424
SODA_NAMESPACE_DELIMITER=.
2525
SODA_TASK_BASH_COMPLETION_SUFFIX=_bash_completion
2626
SODA_DEFAULT_RESOURCE_DIR=resources
27-
SODA_TASK_OPTIONAL_PREFIX=do_
27+
SODA_TASK_OPTIONAL_PREFIX=do_
28+
SODA_QUICK_TASKS_FILE=.soda-tasks

scripts/core.sh

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -22,7 +22,7 @@
2222
# TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE
2323
# SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
2424

25-
SODA_VERSION="1.0.0"
25+
SODA_VERSION="1.1.0"
2626

2727
# Stores the usage for exposed commands
2828
TASKS_USAGE=" TASKS:"

soda

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -77,6 +77,11 @@ done
7777
import soda
7878
import common
7979

80+
# loading quick tasks file
81+
if [[ -f "${SODA_QUICK_TASKS_FILE}" ]]; then
82+
. "$(pwd)/${SODA_QUICK_TASKS_FILE}"
83+
fi
84+
8085
[[ "${#SODA_TASK_PARAMETERS}" = "0" ]] && usage
8186

8287
task_name=${SODA_TASK_PARAMETERS[0]}

0 commit comments

Comments
 (0)