Skip to content

Conversation

@eyecatchup
Copy link
Contributor

This PR closes #99, which reports that the cli process fails to exit when applying a template. This is true when running in programmatic mode.

The root cause is that the last commit (#aa0dda7, #83) removed the ux.exit(0) call after the 'Template applied successfully.' log message within the runProgrammatic function — well, in fact, the line was commented out rather than deleted.

For reference, runInteractive ends with

      log.warn(BSL_LICENSE_HEADLINE)
      log.info(BSL_LICENSE_TEXT)
      log.info(BSL_LICENSE_CTA)

      ux.stdout('Template applied successfully.')
      ux.exit(0)

Whereas runProgrammatic ends with

    ux.stdout('Template applied successfully.')

    // Hide BSL license info if running programatically for now
    // log.warn(BSL_LICENSE_HEADLINE)
    // log.info(BSL_LICENSE_TEXT)
    // log.info(BSL_LICENSE_CTA)
    // ux.exit(0)

Before the change, runProgrammatic ended with

    ux.info('Template applied successfully.')
    ux.exit(0)

It seems more than likely that commenting out ux.exit(0) was unintentional while updating the console logs. Maybe @bryantgillespie, who did that change, could take a quick look and potentially merge this and release a fixed version to restore the proper exit behavior in CI environments. 🤞

@bryantgillespie bryantgillespie self-requested a review October 27, 2025 17:07
Copy link
Collaborator

@bryantgillespie bryantgillespie left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Great catch! Thanks for this one

@bryantgillespie bryantgillespie merged commit 192cad8 into directus-labs:main Oct 27, 2025
@eyecatchup eyecatchup deleted the bugfix/exit-on-programmatic-apply branch October 27, 2025 17:21
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Applying template does not exit the cli

2 participants