From a27afbaa53b04a240c3273a4eb051aedb99b4f84 Mon Sep 17 00:00:00 2001 From: guillermo Date: Wed, 4 Sep 2024 15:04:45 +0200 Subject: [PATCH] feat: refs #7562 Fixes --- myt-version.js | 13 ++++++++++--- 1 file changed, 10 insertions(+), 3 deletions(-) diff --git a/myt-version.js b/myt-version.js index 8e2677f..45b7765 100644 --- a/myt-version.js +++ b/myt-version.js @@ -127,12 +127,19 @@ class Version extends Command { [opts.code, newVersion] ); await fs.mkdir(newVersionDir); + + let content; + if (opts.deprecate) { + this.emit('deprecate'); + content = await deprecate(); + } else + content = '-- Place your SQL code here\n' + await fs.writeFile( `${newVersionDir}/00-firstScript.sql`, - opts.deprecate - ? this.emit('deprecate') && await deprecate() - : '-- Place your SQL code here\n' + content ); + this.emit('versionCreated', versionFolder); await conn.query('COMMIT');