Add logic to create `directory` in generated script.