#!/bin/bash

# MacOS runs .command scripts from user home directory by default
# Force this script to start work from the location of the script
cd "$(dirname "$0")"

# Convention: process folders have the same name as their EBML files
process=${PWD##*/}

# Due to quirky assumptions in 0.X.X stanhope, move to its directory to call it
cd ..
./stanhope -p "$process" && open "./$process/$process.pdf"
./stanhope -w  & exit 0