From 90f1cffa4e18ed4282ef1ae56f5d279a31b35de6 Mon Sep 17 00:00:00 2001 From: Utku Gultopu Date: Wed, 31 Mar 2021 05:39:09 -0400 Subject: [PATCH] refactor: define the message in one place (#1847) [skip ci] --- bin/postinstall.js | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/bin/postinstall.js b/bin/postinstall.js index 210597c..34c8194 100755 --- a/bin/postinstall.js +++ b/bin/postinstall.js @@ -4,6 +4,8 @@ function main() { if (process.env.SUPPRESS_SUPPORT || process.env.OPENCOLLECTIVE_HIDE || process.env.CI) { return; } + + const message = '\u001b[32mLove nodemon? You can now support the project via the open collective:\u001b[22m\u001b[39m\n > \u001b[96m\u001b[1mhttps://opencollective.com/nodemon/donate\u001b[0m\n'; try { const Configstore = require('configstore'); @@ -18,11 +20,11 @@ function main() { const last = conf.get('lastCheck'); if (!last || now - week > last) { - console.log('\u001b[32mLove nodemon? You can now support the project via the open collective:\u001b[22m\u001b[39m\n > \u001b[96m\u001b[1mhttps://opencollective.com/nodemon/donate\u001b[0m\n'); + console.log(message); conf.set('lastCheck', now); } } catch (e) { - console.log('\u001b[32mLove nodemon? You can now support the project via the open collective:\u001b[22m\u001b[39m\n > \u001b[96m\u001b[1mhttps://opencollective.com/nodemon/donate\u001b[0m\n'); + console.log(message); } }