bash-utils/awesome-tasks/.odoo/install

45 lines
1.0 KiB
Bash

#!/bin/bash
##
## Task odoo install v1.0
## Copyright (C) Thomas Di gregorio
## Licensed under MIT
##
## Copy a module or theme folder in the addons folder of an odoo instance (odoo-test by default).
##
## Usage:
## @script.name [ --in INSTANCE ] FOLDER
##
## 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.
## --in=INSTANCE Name the docker odoo instance to copy in, otherwise /odoo alias is used.
##
## Exemples:
## install web_responsive
## install theme_backent_v11
##
# write your default options here
source easyoptions || exit
verbose() { [[ -n "$verbose" ]] && echo $1; }
##### YOUR CODE HERE #####
path="/odoo/addons/"
[[ -n "$in" ]] && path="/opt/docker/$in/addons/"
if [ -f $1.package ]
then
for package in $(cat $1.package)
do
sudo cp -r $package $path
verbose "Copied '$package' in folder: $path"
done
else
verbose "No $1.package file found!"
fi