Skip to content

Commit

Permalink
fix: env output in pm2-describe
Browse files Browse the repository at this point in the history
  • Loading branch information
fritx committed May 30, 2024
1 parent 5e0eb40 commit 49c2824
Showing 1 changed file with 4 additions and 1 deletion.
5 changes: 4 additions & 1 deletion lib/API/UX/pm2-describe.js
Original file line number Diff line number Diff line change
Expand Up @@ -176,7 +176,10 @@ module.exports = function(proc) {
Object.keys(diff_env).forEach(function(key) {
var obj = {}
if (_env[key]) {
obj[key] = _env[key].slice(0, process.stdout.columns - 60)
// 1. fix env value is not a String and slice is undeinfed
// 2. fix process.stdout.columns is undefined and causes empty string output
// 3. columns defaults to 300 - same as specified in pm2-ls
obj[key] = String(_env[key]).slice(0, (process.stdout.columns || 300) - 60)
UxHelpers.safe_push(table_env, obj)
}
})
Expand Down

0 comments on commit 49c2824

Please sign in to comment.