#! /bin/sh
#
# post-install <domainHome> <packageHome>

domainHome=$1; shift 1
packageHome=$1; shift 1
libPath="${packageHome}/lib/ssm.d"

if [ -d ${libPath} ]; then
    # clean out compiled (.pyc) files
    rm -f ${libPath}/*.pyc
fi

# compile files
st="import compileall
compileall.compile_dir(\"${libPath}\", force=1)"
echo "${st}" | python -
