Skip to content
Snippets Groups Projects
Commit 03eebf201ccf authored by Vincent Hatakeyama's avatar Vincent Hatakeyama
Browse files

generate list of modules during copy (and clean it up)

parent 670e42c61ba4
No related branches found
No related tags found
No related merge requests found
......@@ -8,9 +8,14 @@
# TODO add a way to bypass the value, maybe with a key in the setup.cfg file
here=$(dirname $0)
project_home=$(cd $here && cd .. && echo $PWD)
odoo_modules="$(python -B -c "import ConfigParser ; c = ConfigParser.SafeConfigParser() ; c.read('${project_home}/setup.cfg') ; print (c.has_option('odoo_scripts', 'modules') and ' '.join(c.get('odoo_scripts', 'modules').split()) or '')")"
if type "python3" > /dev/null;
then
odoo_modules="$(python3 -B -c "import configparser ; c = configparser.SafeConfigParser() ; c.read('${project_home}/setup.cfg') ; print (c.has_option('odoo_scripts', 'modules') and ' '.join(c.get('odoo_scripts', 'modules').split()) or '')")"
else
odoo_modules="$(python2 -B -c "import ConfigParser ; c = ConfigParser.SafeConfigParser() ; c.read('${project_home}/setup.cfg') ; print (c.has_option('odoo_scripts', 'modules') and ' '.join(c.get('odoo_scripts', 'modules').split()) or '')")"
fi
# Delete odoo modules temp directory
if [[ -n $odoo_modules ]];
then
rm -rf $project_home/odoo_modules
......@@ -12,7 +17,8 @@
# Delete odoo modules temp directory
if [[ -n $odoo_modules ]];
then
rm -rf $project_home/odoo_modules
rm -f $project_home/odoo_modules_list
fi
......@@ -8,8 +8,13 @@
# TODO add a way to bypass the value, maybe with a key in the setup.cfg file
here=$(dirname $0)
project_home=$(cd $here && cd .. && echo $PWD)
odoo_modules="$(python -B -c "import ConfigParser ; c = ConfigParser.SafeConfigParser() ; c.read('${project_home}/setup.cfg') ; print (c.has_option('odoo_scripts', 'modules') and ' '.join(c.get('odoo_scripts', 'modules').split()) or '')")"
if type "python3" > /dev/null;
then
odoo_modules="$(python3 -B -c "import configparser ; c = configparser.SafeConfigParser() ; c.read('${project_home}/setup.cfg') ; print (c.has_option('odoo_scripts', 'modules') and ' '.join(c.get('odoo_scripts', 'modules').split()) or '')")"
else
odoo_modules="$(python2 -B -c "import ConfigParser ; c = ConfigParser.SafeConfigParser() ; c.read('${project_home}/setup.cfg') ; print (c.has_option('odoo_scripts', 'modules') and ' '.join(c.get('odoo_scripts', 'modules').split()) or '')")"
fi
# Copy modules when specified
if [[ -n "$odoo_modules" ]];
then
......@@ -12,7 +17,8 @@
# Copy modules when specified
if [[ -n "$odoo_modules" ]];
then
python -c "print(','.join(module_path.split('/')[-1] for module_path in '$(eval echo $odoo_modules)'.split()))" > $project_home/odoo_modules_list
mkdir -p $project_home/odoo_modules
rsync --delete -C --exclude='.hg*' --exclude='.git*' --links --exclude='*.pyc' -r --times $(eval echo $odoo_modules) $project_home/odoo_modules
fi
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment