Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
File renamed without changes.
File renamed without changes.
8 changes: 6 additions & 2 deletions lib/middleware/configMiddleware.ts
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,7 @@ import {
getConfigDefaultAccountIfExists,
configFileExists,
} from '@hubspot/local-dev-lib/config';
import { ENVIRONMENT_VARIABLES } from '@hubspot/local-dev-lib/constants/config';
import { getCwd } from '@hubspot/local-dev-lib/path';
import { validateAccount } from '../validation.js';
import { EXIT_CODES } from '../enums/exitCodes.js';
Expand Down Expand Up @@ -43,7 +44,7 @@ export function handleCustomConfigLocationMiddleware(
): void {
const { useEnv, config } = argv;
if (useEnv) {
process.env.USE_ENVIRONMENT_HUBSPOT_CONFIG = 'true';
process.env[ENVIRONMENT_VARIABLES.USE_ENVIRONMENT_HUBSPOT_CONFIG] = 'true';
} else if (config && typeof config === 'string') {
const absoluteConfigPath = path.isAbsolute(config)
? config
Expand Down Expand Up @@ -105,7 +106,10 @@ export async function validateConfigMiddleware(

// We don't run validation for auth because users should be able to run it when
// no accounts are configured, but we still want to exit if the config file is not found
if (!process.env.USE_ENVIRONMENT_HUBSPOT_CONFIG && !configFileExists()) {
if (
!process.env[ENVIRONMENT_VARIABLES.USE_ENVIRONMENT_HUBSPOT_CONFIG] &&
!configFileExists()
) {
console.error(
'Config file not found, run hs account auth to configure your account'
);
Expand Down
9 changes: 7 additions & 2 deletions lib/middleware/gitMiddleware.ts
Original file line number Diff line number Diff line change
Expand Up @@ -3,11 +3,16 @@ import {
getConfigFilePath,
globalConfigFileExists,
} from '@hubspot/local-dev-lib/config';
import { ENVIRONMENT_VARIABLES } from '@hubspot/local-dev-lib/constants/config';
import { checkAndWarnGitInclusion } from '../ui/git.js';
import { debugError } from '../errorHandlers/index.js';

export function checkAndWarnGitInclusionMiddleware(argv: Arguments): void {
// Skip this when no command is provided
if (argv._.length) {
// Skip this when no command is provided or if using environment config
if (
argv._.length &&
!process.env[ENVIRONMENT_VARIABLES.USE_ENVIRONMENT_HUBSPOT_CONFIG]
) {
// Skip if using global config
if (globalConfigFileExists()) {
return;
Expand Down
8 changes: 4 additions & 4 deletions package.json
Original file line number Diff line number Diff line change
@@ -1,12 +1,12 @@
{
"name": "@hubspot/cli",
"version": "7.11.1",
"version": "7.11.2",
"description": "The official CLI for developing on HubSpot",
"license": "Apache-2.0",
"repository": "https://github.com/HubSpot/hubspot-cli",
"type": "module",
"dependencies": {
"@hubspot/local-dev-lib": "4.0.3",
"@hubspot/local-dev-lib": "4.0.4",
"@hubspot/project-parsing-lib": "0.10.2",
"@hubspot/serverless-dev-runtime": "7.0.7",
"@hubspot/theme-preview-dev-server": "0.0.12",
Expand Down Expand Up @@ -111,8 +111,8 @@
"node": ">=18"
},
"bin": {
"hs": "./bin/hs",
"hscms": "./bin/hscms"
"hs": "./bin/hs.js",
"hscms": "./bin/hscms.js"
},
"publishConfig": {
"access": "public",
Expand Down