sfdx-hardis
Version:
Swiss-army-knife Toolbox for Salesforce. Allows you to define a complete CD/CD Pipeline. Orchestrate base commands and assist users with interactive wizards
22 lines • 989 B
JavaScript
const hook = async (options) => {
// Skip hooks from other commands than hardis commands
const commandId = options?.id || '';
if (!commandId.startsWith('hardis')) {
return;
}
// Dynamically import libraries to avoid loading it if not needed
const { isCI } = await import('../../common/utils/index.js');
const { WebSocketClient } = await import('../../common/websocketClient.js');
// Initialize WebSocketClient to communicate with VS Code SFDX Hardis extension
if (!isCI) {
const context = { command: commandId, id: process.pid };
const websocketArgIndex = options?.argv?.indexOf('--websocket');
if (websocketArgIndex || websocketArgIndex === 0) {
context.websocketHostPort = options.argv[websocketArgIndex + 1];
}
globalThis.webSocketClient = new WebSocketClient(context);
await WebSocketClient.isInitialized();
}
};
export default hook;
//# sourceMappingURL=start-ws-client.js.map