UNPKG

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

34 lines 1.29 kB
// The use of this method is deprecated: use NotifProvider.sendNotification :) const hook = async (options) => { // Skip hooks from other commands than hardis commands const commandId = options?.Command?.id || ''; if (!commandId.startsWith('hardis')) { return; } // Dynamic import to save perfs when other CLI commands are called const c = (await import('chalk')).default; const { elapseEnd, uxLog } = await import('../../common/utils/index.js'); if (globalThis.hardisLogFileStream) { globalThis.hardisLogFileStream.end(); globalThis.hardisLogFileStream = null; } // Close WebSocketClient if existing if (globalThis.webSocketClient) { try { globalThis.webSocketClient.dispose(); } catch (e) { if (options?.Command?.flags?.debug) { uxLog(this, c.yellow('Unable to close websocketClient.js') + '\n' + e.message); } } globalThis.webSocketClient = null; } const aiCounter = globalThis?.aiCallsNumber || 0; if (aiCounter > 0) { uxLog(this, c.grey(c.italic(`AI prompts API calls: ${aiCounter}`))); } elapseEnd(`${options?.Command?.id} execution time`); }; export default hook; //# sourceMappingURL=notify.js.map