#!/bin/bash

## wrapper for schema, then add_staff
## for use in NEP

if ! [ $IMPNA == 'nep' ]; then
    echo 'This script works for NEP only.'
    exit
fi

if [ -z $1 ]; then
    echo 'I need a editor handle.'
    exit
fi

if [[ "$1" =~ ^p[a-z][a-z][0-9]+$ ]]; then
    echo 'Do not use the leading p.'
    exit
fi

if ! [[ "$1" =~ ^[a-z][a-z][0-9]+$ ]]; then
    echo "I can't take your staffid $1."
    exit
fi

## add stafid
~/ernad/bin/schemas -e $1

## call skeleton
~/ernad/bin/staff -s $1
