def write_script(self, script_name, contents, mode="<STR_LIT:t>", blockers=()):
self.delete_blockers(   <EOL>[os.path.join(self.script_dir,x) for x in blockers])<EOL>log.info("<STR_LIT>", script_name, self.script_dir)<EOL>target = os.path.join(self.script_dir, script_name)<EOL>self.add_output(target)<EOL>mask = current_umask()<EOL>if not self.dry_run:<EOL><INDENT>ensure_directory(target)<EOL>f = open(target,"<STR_LIT:w>"+mode)<EOL>f.write(contents)<EOL>f.close()<EOL>chmod(target, <NUM_LIT>-mask)<EOL><DEDENT>
Write an executable file to the scripts directory