#!/usr/bin/env bash set -e set -x from=flectra to=${1-odoo} [[ "$to" = "flectra" ]] && from=odoo [[ ! -d views ]] && echo "No views folder here in $(pwd)" 1>&2 && exit 1 [[ ! "$to" =~ ^odoo|flectra$ ]] && echo "To must be odoo or flectra" 1>&2 && exit 2 for f in views/${from}*.xml; do tofile=$(echo $f | sed "s/\/$from/\/$to/") [[ -f "$tofile" ]] && echo "$tofile exists - continue" 1>&2 && continue sed "s/\(<\/*\)$from>/\1$to>/" $f > $tofile done cp ../__manifest__.py.$to ../__manifest__.py