Skip to content

Commit 123b7bd

Browse files
Sync from internal - version 7.11.2 (#1574)
1 parent 94bc801 commit 123b7bd

File tree

5 files changed

+17
-8
lines changed

5 files changed

+17
-8
lines changed
File renamed without changes.
File renamed without changes.

lib/middleware/configMiddleware.ts

Lines changed: 6 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -7,6 +7,7 @@ import {
77
getConfigDefaultAccountIfExists,
88
configFileExists,
99
} from '@hubspot/local-dev-lib/config';
10+
import { ENVIRONMENT_VARIABLES } from '@hubspot/local-dev-lib/constants/config';
1011
import { getCwd } from '@hubspot/local-dev-lib/path';
1112
import { validateAccount } from '../validation.js';
1213
import { EXIT_CODES } from '../enums/exitCodes.js';
@@ -43,7 +44,7 @@ export function handleCustomConfigLocationMiddleware(
4344
): void {
4445
const { useEnv, config } = argv;
4546
if (useEnv) {
46-
process.env.USE_ENVIRONMENT_HUBSPOT_CONFIG = 'true';
47+
process.env[ENVIRONMENT_VARIABLES.USE_ENVIRONMENT_HUBSPOT_CONFIG] = 'true';
4748
} else if (config && typeof config === 'string') {
4849
const absoluteConfigPath = path.isAbsolute(config)
4950
? config
@@ -105,7 +106,10 @@ export async function validateConfigMiddleware(
105106

106107
// We don't run validation for auth because users should be able to run it when
107108
// no accounts are configured, but we still want to exit if the config file is not found
108-
if (!process.env.USE_ENVIRONMENT_HUBSPOT_CONFIG && !configFileExists()) {
109+
if (
110+
!process.env[ENVIRONMENT_VARIABLES.USE_ENVIRONMENT_HUBSPOT_CONFIG] &&
111+
!configFileExists()
112+
) {
109113
console.error(
110114
'Config file not found, run hs account auth to configure your account'
111115
);

lib/middleware/gitMiddleware.ts

Lines changed: 7 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -3,11 +3,16 @@ import {
33
getConfigFilePath,
44
globalConfigFileExists,
55
} from '@hubspot/local-dev-lib/config';
6+
import { ENVIRONMENT_VARIABLES } from '@hubspot/local-dev-lib/constants/config';
67
import { checkAndWarnGitInclusion } from '../ui/git.js';
78
import { debugError } from '../errorHandlers/index.js';
9+
810
export function checkAndWarnGitInclusionMiddleware(argv: Arguments): void {
9-
// Skip this when no command is provided
10-
if (argv._.length) {
11+
// Skip this when no command is provided or if using environment config
12+
if (
13+
argv._.length &&
14+
!process.env[ENVIRONMENT_VARIABLES.USE_ENVIRONMENT_HUBSPOT_CONFIG]
15+
) {
1116
// Skip if using global config
1217
if (globalConfigFileExists()) {
1318
return;

package.json

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,12 +1,12 @@
11
{
22
"name": "@hubspot/cli",
3-
"version": "7.11.1",
3+
"version": "7.11.2",
44
"description": "The official CLI for developing on HubSpot",
55
"license": "Apache-2.0",
66
"repository": "https://github.com/HubSpot/hubspot-cli",
77
"type": "module",
88
"dependencies": {
9-
"@hubspot/local-dev-lib": "4.0.3",
9+
"@hubspot/local-dev-lib": "4.0.4",
1010
"@hubspot/project-parsing-lib": "0.10.2",
1111
"@hubspot/serverless-dev-runtime": "7.0.7",
1212
"@hubspot/theme-preview-dev-server": "0.0.12",
@@ -111,8 +111,8 @@
111111
"node": ">=18"
112112
},
113113
"bin": {
114-
"hs": "./bin/hs",
115-
"hscms": "./bin/hscms"
114+
"hs": "./bin/hs.js",
115+
"hscms": "./bin/hscms.js"
116116
},
117117
"publishConfig": {
118118
"access": "public",

0 commit comments

Comments
 (0)