@hubspot/local-dev-lib 0.5.0-experimental.4 → 0.5.0-experimental.6
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/config/index.d.ts +1 -0
- package/config/index.js +13 -2
- package/config/utils.js +1 -0
- package/package.json +1 -1
package/config/index.d.ts
CHANGED
|
@@ -4,6 +4,7 @@ import { CmsPublishMode } from '../types/Files';
|
|
|
4
4
|
import { Environment } from '../types/Config';
|
|
5
5
|
export declare function localConfigFileExists(): boolean;
|
|
6
6
|
export declare function globalConfigFileExists(): boolean;
|
|
7
|
+
export declare function configFileExists(): boolean;
|
|
7
8
|
export declare function getConfigFilePath(): string;
|
|
8
9
|
export declare function getConfig(): HubSpotConfig;
|
|
9
10
|
export declare function isConfigValid(): boolean;
|
package/config/index.js
CHANGED
|
@@ -3,7 +3,7 @@ var __importDefault = (this && this.__importDefault) || function (mod) {
|
|
|
3
3
|
return (mod && mod.__esModule) ? mod : { "default": mod };
|
|
4
4
|
};
|
|
5
5
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
6
|
-
exports.removeLocalStateFlag = exports.addLocalStateFlag = exports.hasLocalStateFlag = exports.isConfigFlagEnabled = exports.updateDefaultCmsPublishMode = exports.updateAutoOpenBrowser = exports.updateAllowAutoUpdates = exports.updateAllowUsageTracking = exports.updateHttpTimeout = exports.removeAccountFromConfig = exports.renameConfigAccount = exports.setConfigAccountAsDefault = exports.updateConfigAccount = exports.addConfigAccount = exports.getConfigAccountEnvironment = exports.getAllConfigAccounts = exports.getConfigDefaultAccountIfExists = exports.getConfigDefaultAccount = exports.getConfigAccountIfExists = exports.getConfigAccountByName = exports.getConfigAccountById = exports.deleteConfigFile = exports.createEmptyConfigFile = exports.isConfigValid = exports.getConfig = exports.getConfigFilePath = exports.globalConfigFileExists = exports.localConfigFileExists = void 0;
|
|
6
|
+
exports.removeLocalStateFlag = exports.addLocalStateFlag = exports.hasLocalStateFlag = exports.isConfigFlagEnabled = exports.updateDefaultCmsPublishMode = exports.updateAutoOpenBrowser = exports.updateAllowAutoUpdates = exports.updateAllowUsageTracking = exports.updateHttpTimeout = exports.removeAccountFromConfig = exports.renameConfigAccount = exports.setConfigAccountAsDefault = exports.updateConfigAccount = exports.addConfigAccount = exports.getConfigAccountEnvironment = exports.getAllConfigAccounts = exports.getConfigDefaultAccountIfExists = exports.getConfigDefaultAccount = exports.getConfigAccountIfExists = exports.getConfigAccountByName = exports.getConfigAccountById = exports.deleteConfigFile = exports.createEmptyConfigFile = exports.isConfigValid = exports.getConfig = exports.getConfigFilePath = exports.configFileExists = exports.globalConfigFileExists = exports.localConfigFileExists = void 0;
|
|
7
7
|
const fs_extra_1 = __importDefault(require("fs-extra"));
|
|
8
8
|
const config_1 = require("../constants/config");
|
|
9
9
|
const logger_1 = require("../lib/logger");
|
|
@@ -15,13 +15,24 @@ const environment_1 = require("../lib/environment");
|
|
|
15
15
|
const HubSpotConfigError_1 = require("../models/HubSpotConfigError");
|
|
16
16
|
const config_2 = require("../constants/config");
|
|
17
17
|
function localConfigFileExists() {
|
|
18
|
-
|
|
18
|
+
const localConfigFilePath = (0, utils_1.getLocalConfigFilePath)();
|
|
19
|
+
console.log('localConfigFilePath', localConfigFilePath);
|
|
20
|
+
return Boolean(localConfigFilePath);
|
|
19
21
|
}
|
|
20
22
|
exports.localConfigFileExists = localConfigFileExists;
|
|
21
23
|
function globalConfigFileExists() {
|
|
22
24
|
return fs_extra_1.default.existsSync((0, utils_1.getGlobalConfigFilePath)());
|
|
23
25
|
}
|
|
24
26
|
exports.globalConfigFileExists = globalConfigFileExists;
|
|
27
|
+
function configFileExists() {
|
|
28
|
+
try {
|
|
29
|
+
return fs_extra_1.default.existsSync(getConfigFilePath());
|
|
30
|
+
}
|
|
31
|
+
catch (error) {
|
|
32
|
+
return false;
|
|
33
|
+
}
|
|
34
|
+
}
|
|
35
|
+
exports.configFileExists = configFileExists;
|
|
25
36
|
function getConfigDefaultFilePath() {
|
|
26
37
|
const globalConfigFilePath = (0, utils_1.getGlobalConfigFilePath)();
|
|
27
38
|
if (fs_extra_1.default.existsSync(globalConfigFilePath)) {
|
package/config/utils.js
CHANGED
|
@@ -21,6 +21,7 @@ function getGlobalConfigFilePath() {
|
|
|
21
21
|
}
|
|
22
22
|
exports.getGlobalConfigFilePath = getGlobalConfigFilePath;
|
|
23
23
|
function getLocalConfigFilePath() {
|
|
24
|
+
console.log('Search for', config_1.DEFAULT_HUBSPOT_CONFIG_YAML_FILE_NAME);
|
|
24
25
|
return (0, findup_sync_1.default)([
|
|
25
26
|
config_1.DEFAULT_HUBSPOT_CONFIG_YAML_FILE_NAME,
|
|
26
27
|
config_1.DEFAULT_HUBSPOT_CONFIG_YAML_FILE_NAME.replace('.yml', '.yaml'),
|
package/package.json
CHANGED