Skip to content

Commit

Permalink
Suppress beta warning when operating in Pages' CI environment
Browse files Browse the repository at this point in the history
  • Loading branch information
GregBrimble committed May 9, 2022
1 parent 68ddad5 commit 2fd2577
Show file tree
Hide file tree
Showing 2 changed files with 11 additions and 2 deletions.
5 changes: 5 additions & 0 deletions .changeset/weak-mangos-admire.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
---
"wrangler": patch
---

fix: Suppress beta warning when operating in Pages' CI environment
8 changes: 6 additions & 2 deletions packages/wrangler/src/pages.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -82,6 +82,8 @@ const PAGES_CONFIG_CACHE_FILENAME = "pages.json";
export const pagesBetaWarning =
"🚧 'wrangler pages <command>' is a beta command. Please report any issues to https://github.com/cloudflare/wrangler2/issues/new/choose";

const isInPagesCI = !!process.env.CF_PAGES;

const CLEANUP_CALLBACKS: (() => void)[] = [];
const CLEANUP = () => {
CLEANUP_CALLBACKS.forEach((callback) => callback());
Expand Down Expand Up @@ -1581,8 +1583,10 @@ export const pages: BuilderCallback<unknown, unknown> = (yargs) => {
watch,
plugin,
}) => {
// Beta message for `wrangler pages <commands>` usage
logger.log(pagesBetaWarning);
if (!isInPagesCI) {
// Beta message for `wrangler pages <commands>` usage
logger.log(pagesBetaWarning);
}

await buildFunctions({
outfile,
Expand Down

0 comments on commit 2fd2577

Please sign in to comment.