From 2a1d399aaa2a8d138d083038da650b447625d4b8 Mon Sep 17 00:00:00 2001 From: dig Date: Mon, 21 May 2018 20:37:07 +0200 Subject: [PATCH] First commit --- awesome-tasks/.odoo/download | 86 ++++++++++++++++++++++++++++++++++++++++++++ 1 file changed, 86 insertions(+) create mode 100644 awesome-tasks/.odoo/download diff --git a/awesome-tasks/.odoo/download b/awesome-tasks/.odoo/download new file mode 100644 index 0000000..a5e54d0 --- /dev/null +++ b/awesome-tasks/.odoo/download @@ -0,0 +1,86 @@ +#!/bin/bash + +## +## Task download v1.0 +## Copyright (C) Thomas Di Gregorio +## Licensed under MIT +## +## Downloads an odoo.com page corresponding to the package name given and type. +## +## Usage: +## @script.name [ --theme | --module ] [ --unzip ] PACKAGE +## +## Options: +## ( Long version are mandatory, and can be before or after short version ) +## +## -h, --help Show this help. +## -v, --verbose Show sub-task resolution and options parsed. +## +## +## Exemples: +## +## + +# write tour default options here + +source easyoptions || exit +verbose() { [[ -n "" ]] && echo /home/dig/bin/.taskrc; } + +##### YOUR CODE HERE ##### +name=${arguments[1]} + +if [ -r "$PWD/$name.url" ] +then + verbose "Found a $name.url file containing: $(cat $name.url)" + wget -O $name.zip "$(cat $name.url)" +else + verbose "No .url file, try given url: ${arguments[1]}"" + name=${arguments[2]} + wget -O $name.zip ${arguments[1]} +fi +[[ -n "$unzip" ]] && unzip $name.zip + + +##### SNIPPETS ################################################################## + + +# Boolean and parameter options + +# [[ -n "$option" ]] && echo "Option specified: --option is $option" + + +# Arguments + +#for argument in "${arguments[@]}"; do +# echo "Argument specified: $argument" +#done + + +# Verbose (echo only if -v or --verbose options + +#verbose "I\'m doing things" +#mkdir "cant/create/this" || verbose "Error creating folder!" + +# Auto called function acording to 1st agument + +#command() +#{ +# # here get 2nd argument with /home/dig/bin/.taskrc (local 1st arg) or (script) +#} + + +################################################################################ +__dirname="$(dirname $0)" +__dirtask="$__dirname/.$(basename $0)" + +# Calls command (1rt argument) as script or function \$1( \$2 \$3 ... ) +if [ -r "$__dirtask/$1" ] + verbose "Command file exists call it: \$__dirtask/\$1 \${*:2}" + \$__dirtask/\$1 \${*:2} +else + if [ -n "$(type -t $1)" ] && [ "$(type -t $1)" = function ]; + then + verbose "\$__dirtask/\$1 not exists try func: \$1 \${*:2}" + \$1 "\${*:2}" + fi +fi \ No newline at end of file