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

45 lines
1.0 KiB
Plaintext
Raw Normal View History

2018-05-21 20:34:41 +02:00
#!/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.
2018-07-03 00:11:18 +02:00
## --in=INSTANCE Name the docker odoo instance to copy in, otherwise /odoo alias is used.
2018-05-21 20:34:41 +02:00
##
## Exemples:
## install web_responsive
2018-07-03 00:11:18 +02:00
## install theme_backent_v11
2018-05-21 20:34:41 +02:00
##
2018-07-03 00:11:18 +02:00
# write your default options here
2018-05-21 20:34:41 +02:00
source easyoptions || exit
2018-07-03 00:11:18 +02:00
verbose() { [[ -n "$verbose" ]] && echo $1; }
2018-05-21 20:34:41 +02:00
##### YOUR CODE HERE #####
2018-07-03 00:11:18 +02:00
path="/odoo/addons/"
[[ -n "$in" ]] && path="/opt/docker/$in/addons/"
2018-05-21 20:34:41 +02:00
2018-07-03 00:11:18 +02:00
if [ -f $1.package ]
then
for package in $(cat $1.package)
do
sudo cp -r $package $path
verbose "Copied '$package' in folder: $path"
done
2018-05-21 20:34:41 +02:00
else
2018-07-03 00:11:18 +02:00
verbose "No $1.package file found!"
fi