Skip to content

Commit

Permalink
fix: use lib import instead
Browse files Browse the repository at this point in the history
  • Loading branch information
mdonnalley committed Nov 8, 2023
1 parent 56ce9ad commit 0a5aeaf
Show file tree
Hide file tree
Showing 2 changed files with 13 additions and 3 deletions.
7 changes: 7 additions & 0 deletions messages/config.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
# error.invalidBooleanConfigValue

The config value can only be set to true or false

# org-metadata-rest-deploy

Whether deployments use the Metadata REST API (true) or SOAP API (false, default value).
9 changes: 6 additions & 3 deletions src/configMeta.ts
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,10 @@

import type { ConfigValue } from '@salesforce/core';

import { Messages } from '@salesforce/core/lib/messages';
Messages.importMessagesDirectory(__dirname);
const messages = Messages.loadMessages('@salesforce/plugin-deploy-retrieve', 'config');

export enum ConfigVars {
/**
* Allow users to use the REST api for deployments.
Expand All @@ -17,12 +21,11 @@ export enum ConfigVars {
export default [
{
key: ConfigVars.ORG_METADATA_REST_DEPLOY,
// @salesforce/core's Messages class is not used here because it's an expensive import to be used in an init hook
description: 'Whether deployments use the Metadata REST API (true) or SOAP API (false, default value).',
description: messages.getMessage(ConfigVars.ORG_METADATA_REST_DEPLOY),
hidden: true,
input: {
validator: (value: ConfigValue): boolean => typeof value === 'string' && ['true', 'false'].includes(value),
failedMessage: 'The config value can only be set to true or false',
failedMessage: messages.getMessage('error.invalidBooleanConfigValue'),
},
},
];

0 comments on commit 0a5aeaf

Please sign in to comment.