From b97efc06775b1a1b04d92f65b0c320336f18b979 Mon Sep 17 00:00:00 2001 From: Joey Perrott Date: Tue, 11 Nov 2025 15:39:57 +0000 Subject: [PATCH] fix(ng-dev): use an environment variable to determine local builds Instead of trying to determine whether the version of ng-dev mismatches two strings that will be stamped, we now use a local environment variable to set the local build status. --- ng-dev/utils/version-check.ts | 2 +- tools/local-dev.sh | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/ng-dev/utils/version-check.ts b/ng-dev/utils/version-check.ts index 47e28a819..fd6bc697c 100644 --- a/ng-dev/utils/version-check.ts +++ b/ng-dev/utils/version-check.ts @@ -40,7 +40,7 @@ export async function ngDevVersionMiddleware() { export async function verifyNgDevToolIsUpToDate(workspacePath: string): Promise { // The placeholder will be replaced by the `pkg_npm` substitutions. const localVersion = `0.0.0-{SCM_HEAD_SHA}`; - if (localVersion === ('0.0.0-{{BUILD_SCM_COMMIT_SHA}}' as string)) { + if (!!process.env['LOCAL_NG_DEV_BUILD']) { Log.debug('Skipping ng-dev version check as this is a locally generated version.'); return true; } diff --git a/tools/local-dev.sh b/tools/local-dev.sh index 6a4e9240f..b30875347 100755 --- a/tools/local-dev.sh +++ b/tools/local-dev.sh @@ -19,4 +19,4 @@ bazelCommand=${BAZEL:-"pnpm bazel"} # Execute the built ng-dev command in the current working directory # and pass-through arguments unmodified. -${ngDevBinFile} ${@} +LOCAL_NG_DEV_BUILD=1 ${ngDevBinFile} ${@}