rewrite compile script