#!/bin/bash add-git-folder() { if [[ -z "$1" ]]; then echo '$1/branch is empty.' exit fi if [[ -z "$2" ]]; then echo '$2/url is empty.' exit fi if [[ -z "$3" ]]; then echo '$3/path is empty.' exit fi # Add to .gitmodules git submodule add -f -b "$1" "$2" "$3" # Ensure branch is Odoo version git -C "$3" switch "$1" # Remove from working tree rm -rf .git/modules/"$2" || true git rm --cached "$2" || true # Save version save-git-folder }