From f57a22a7ec09506b1ac12c3cdcab31c87254d1fe Mon Sep 17 00:00:00 2001 From: AYOKINYA Date: Fri, 25 Oct 2024 14:26:18 +0900 Subject: [PATCH 1/2] fix: Update TAR.package to TAR.packager in Modularizer.js The package function in TAR.js was renamed to packager for ES6 strict mode compatibility (#5680), but the reference in Modularizer.js was not updated accordingly. --- lib/API/Modules/Modularizer.js | 2 +- lib/API/Modules/TAR.js | 4 ++-- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/lib/API/Modules/Modularizer.js b/lib/API/Modules/Modularizer.js index 614e6e71b..1a1b91129 100644 --- a/lib/API/Modules/Modularizer.js +++ b/lib/API/Modules/Modularizer.js @@ -87,7 +87,7 @@ Modularizer.package = function(CLI, module_path, cb) { var fullpath = process.cwd() if (module_path) fullpath = require('path').resolve(module_path) - TAR.package(fullpath, process.cwd(), cb) + TAR.packager(fullpath, process.cwd(), cb) } /** diff --git a/lib/API/Modules/TAR.js b/lib/API/Modules/TAR.js index 1cd223f88..078be3343 100644 --- a/lib/API/Modules/TAR.js +++ b/lib/API/Modules/TAR.js @@ -283,8 +283,8 @@ function packager(module_path, target_path, cb) { var tar = exec(cmd, (err, sto, ste) => { if (err) { - console.log(sto.toString().trim()) - console.log(ste.toString().trim()) + console.error(sto.toString().trim()) + console.error(ste.toString().trim()) } }) From 194200aea956b0776651d33f5f857cdb23d032c0 Mon Sep 17 00:00:00 2001 From: AYOKINYA Date: Fri, 25 Oct 2024 14:27:40 +0900 Subject: [PATCH 2/2] feat: Add tarball support to module:update command Implement tarball handling in module:update to match functionality of module:install --- lib/binaries/CLI.js | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/lib/binaries/CLI.js b/lib/binaries/CLI.js index a8fb94035..2ae73b479 100644 --- a/lib/binaries/CLI.js +++ b/lib/binaries/CLI.js @@ -504,9 +504,11 @@ commander.command('install ') }); commander.command('module:update ') + .option('--tarball', 'is local tarball') .description('update a module and run it forever') - .action(function(plugin_name) { - pm2.install(plugin_name); + .action(function(plugin_name, opts) { + require('util')._extend(commander, opts); + pm2.install(plugin_name, commander); });