diff --git a/package.json b/package.json index caa0206..dc33a58 100644 --- a/package.json +++ b/package.json @@ -1,6 +1,6 @@ { "name": "@codifycli/plugin-core", - "version": "1.2.1", + "version": "1.2.2", "description": "TypeScript library for building Codify plugins to manage system resources (applications, CLI tools, settings) through infrastructure-as-code", "main": "dist/index.js", "typings": "dist/index.d.ts", diff --git a/src/messages/sender.ts b/src/messages/sender.ts index 0a8ab03..fc624b4 100644 --- a/src/messages/sender.ts +++ b/src/messages/sender.ts @@ -27,17 +27,18 @@ class CodifyCliSenderImpl { }) } - async sendApplyNote(message: string, resourceType?: string): Promise { + sendApplyNote(message: string, resourceType?: string): void { if (!process.send || !process.connected) { return; } - await this.sendAndWaitForResponse({ + process.send({ cmd: MessageCmd.APPLY_NOTE_REQUEST, data: { message, ...(resourceType && { resourceType }), - } + }, + requestId: nanoid(8), }); } diff --git a/src/utils/file-utils.ts b/src/utils/file-utils.ts index dda9e2f..b602446 100644 --- a/src/utils/file-utils.ts +++ b/src/utils/file-utils.ts @@ -35,7 +35,7 @@ export class FileUtils { ); await fs.appendFile(Utils.getPrimaryShellRc(), lineToInsert) - await CodifyCliSender.sendApplyNote(ApplyNotes.sourceShellRc()); + CodifyCliSender.sendApplyNote(ApplyNotes.sourceShellRc()); function addLeadingSpacer(line: string): string { return line.startsWith('\n') @@ -60,7 +60,7 @@ export class FileUtils { ${lines.join('\n')}`) await fs.appendFile(shellRc, formattedLines) - await CodifyCliSender.sendApplyNote(ApplyNotes.sourceShellRc()); + CodifyCliSender.sendApplyNote(ApplyNotes.sourceShellRc()); } /** @@ -85,7 +85,7 @@ ${lines.join('\n')}`) await fs.appendFile(shellRc, `\nexport PATH=${value}:$PATH;`, { encoding: 'utf8' }); } - await CodifyCliSender.sendApplyNote(ApplyNotes.sourceShellRc()); + CodifyCliSender.sendApplyNote(ApplyNotes.sourceShellRc()); } static async removeFromFile(filePath: string, search: string): Promise {