UNPKG

sfdx-git-delta

Version:

Generate the sfdx content in source format and destructive change from two git commits

34 lines 1.2 kB
'use strict'; import { parse } from 'node:path/posix'; import { DOT, PATH_SEP } from '../constant/fsConstants.js'; import { fillPackageWithParameter } from '../utils/packageHelper.js'; import ShareFolderHandler from './sharedFolderHandler.js'; const BOT_TYPE = 'Bot'; const BOT_EXTENSION = 'bot'; export default class BotHandler extends ShareFolderHandler { _getElementName() { const parsedPath = this._getParsedPath(); const elementName = new Set([ parsedPath.dir.split(PATH_SEP).pop(), parsedPath.name, ]); return [...elementName].join(DOT); } async handleAddition() { await super.handleAddition(); await this._addParentBot(); } async _addParentBot() { const botName = this.parentFolder.split(PATH_SEP).pop(); fillPackageWithParameter({ store: this.diffs.package, type: BOT_TYPE, member: botName, }); if (!this.config.generateDelta) return; const botPath = `${parse(this.line).dir}${PATH_SEP}${botName}.${BOT_EXTENSION}`; await this._copyWithMetaFile(botPath); } } //# sourceMappingURL=botHandler.js.map