#!/usr/bin/zsh ## copydb-current-branch --- Create a copy of a database for the current branch ## Commentary: # Use `copydb' to create a copy of the database named after the # current branch. This requires the current working directory to be a # git repository. The name of the database is created by substituting # all occurrences of `-' with `_'. The database copied from is always # called `aeos_babel'. The database copied to is called # `aeos_'. # This program is just a wrapper for `copydb', so all information # related to it is also relevant, please read its comments for more # info. # Usage is: # copydb-current-branch ## Code: base="aeos_master" branch=$(git branch --no-color | grep '*' | sed -e 's/* //' -e 's/-/_/g') nbranch="aeos_${branch}" echo Copying "$base" to "$nbranch" copydb "$base" "$nbranch"