updated publish script to ensure that the file specified exists