From 5c92b5c5426ade9d56f42b5f66fc2595a31c925c Mon Sep 17 00:00:00 2001 From: Christopher Noel Date: Mon, 12 Nov 2018 09:28:22 +1300 Subject: [PATCH 1/2] Fixes issue #37 where plugin fails to load when trying to call match on a non string. --- index.js | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/index.js b/index.js index e61add0..0356333 100644 --- a/index.js +++ b/index.js @@ -303,7 +303,7 @@ exports.decorateConfig = (config) => { // Current process icon const getIcon = (title) => { - const process = title.match(/(?:[\s]+|^)(gulp|php|node|npm|yarn|vim|nvim|python|mysql)(?:[\s]+|\d+$)/i); + const process = title.toString().match(/(?:[\s]+|^)(gulp|php|node|npm|yarn|vim|nvim|python|mysql)(?:[\s]+|$)/i); return process ? process[0].trim().toLowerCase() : 'shell'; }; From fd01b5555ac1f07fe778c58f54432d69b274d833 Mon Sep 17 00:00:00 2001 From: Christopher Noel Date: Mon, 12 Nov 2018 09:33:39 +1300 Subject: [PATCH 2/2] Noticed the regex on master is slightly different to the release I was testing on. Fixed the regex to match the master branch. --- index.js | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/index.js b/index.js index 0356333..7b575f0 100644 --- a/index.js +++ b/index.js @@ -303,7 +303,7 @@ exports.decorateConfig = (config) => { // Current process icon const getIcon = (title) => { - const process = title.toString().match(/(?:[\s]+|^)(gulp|php|node|npm|yarn|vim|nvim|python|mysql)(?:[\s]+|$)/i); + const process = title.toString().match(/(?:[\s]+|^)(gulp|php|node|npm|yarn|vim|nvim|python|mysql)(?:[\s]+|\d+$)/i); return process ? process[0].trim().toLowerCase() : 'shell'; };