Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

view: Error on missing build files #1608

Closed
wants to merge 1 commit into from

Conversation

victorlin
Copy link
Member

@victorlin victorlin commented Dec 5, 2022

Description of proposed changes

When running from Auspice's root directory, this replaces an unhandled scandir error with a more meaningful message.

When running from an external project, this prevents falling back to running from build files in Auspice's root directory, which is often unintentional.

Related issue(s)

Prevents issues such as #1520 (comment) from arising.

Testing

  • Checks pass
  • (to be done by a Nextstrain team member) Create preview PRs on downstream repositories.
  • Homepage of auspice.us deployment on preview PR looks correct
  • rm -rf dist/ && npm run start from Auspice root shows the new error message (checked locally)
  • rm -rf dist/ && npm run start from auspice.us project root shows the new error message (checked locally)
  • npm run build && npm run start from Auspice root works fine (checked locally)
  • npm run build && npm run start from auspice.us project root works fine (checked locally)

@victorlin victorlin self-assigned this Dec 5, 2022
@nextstrain-bot nextstrain-bot temporarily deployed to auspice-victorlin-cli-v-8ywayl December 5, 2022 19:55 Inactive
When running from Auspice's root directory, this replaces an unhandled
scandir error with a more meaningful message.

When running from an external project, this prevents falling back to
running from build files in Auspice's root directory, which is often
unintentional.
@victorlin victorlin force-pushed the victorlin/cli-view-error-on-missing-build branch from d9bbe78 to bdfe751 Compare December 5, 2022 20:12
@nextstrain-bot nextstrain-bot temporarily deployed to auspice-victorlin-cli-v-8ywayl December 5, 2022 20:12 Inactive
@victorlin victorlin mentioned this pull request Dec 5, 2022
6 tasks
@victorlin victorlin marked this pull request as ready for review December 5, 2022 20:58
@victorlin victorlin requested a review from a team December 5, 2022 20:58
@victorlin victorlin mentioned this pull request Dec 5, 2022
2 tasks
) {
console.log(chalk.redBright(`ERROR: Auspice build files not found under ${cwd}. Did you run \`auspice build\` in this directory?`));
Copy link
Member Author

@victorlin victorlin Dec 5, 2022

Choose a reason for hiding this comment

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

bdfe751:

When running from an external project, this prevents falling back to running from build files in Auspice's root directory, which is often unintentional.

As mentioned in #1606 (comment), this behavior is actually intentional for anyone using npm install --global auspice. Thinking more on this now.

@victorlin
Copy link
Member Author

Closing in favor of #1611, specifically b26aeeb.

@victorlin victorlin closed this Dec 6, 2022
@victorlin victorlin deleted the victorlin/cli-view-error-on-missing-build branch December 6, 2022 01:19
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.

2 participants