Files
Odoo-Build/scripts/lib
T
2021-04-12 12:07:15 +02:00

41 lines
906 B
Bash
Executable File

#!/bin/bash
PATH="$PATH:./odoo"
GIT_TAG=1
GIT_BRANCH=$(git branch --show-current)
function get-module-version() {
if test -z "$1"
then
echo "\$1 is empty"
else
# get version of module
VERSION=$(grep 'version' "$1/__manifest__.py" | sed "s;';\";g" | sed "s/,//g" )
VERSION=$(echo "{ $VERSION }" | jq .version | sed 's/"//g' | sed 's/null//g')
# set default version
[ -z "$VERSION" ] && VERSION=0.0
# check if oca version or enterprise version
if echo "$VERSION" | grep -e "^[0-9]\."
then
VERSION="$GIT_BRANCH.$VERSION.$GIT_TAG"
fi
echo $VERSION
fi
}
function activate-venv() {
source "venv$GIT_BRANCH/bin/activate"
}
function locale() {
export LC_ALL=en_US.UTF-8
export LANG=en_US.UTF-8
}
function load-odoo-env() {
export $(cat .env.$1 | sed 's/#.*//g' | xargs)
}