Skip to content

Commit

Permalink
Fix emoji support in windows
Browse files Browse the repository at this point in the history
Issue: #55
  • Loading branch information
alxndrsn committed Feb 28, 2018
1 parent dd3ecbd commit f1fdef3
Show file tree
Hide file tree
Showing 2 changed files with 12 additions and 1 deletion.
3 changes: 2 additions & 1 deletion bin/medic-conf.js
Expand Up @@ -3,6 +3,7 @@
require('../src/cli/check-node-version');

const checkForUpdates = require('../src/lib/check-for-updates');
const emoji = require('../src/lib/emoji');
const error = require('../src/lib/log').error;
const fs = require('../src/lib/sync-fs');
const info = require('../src/lib/log').info;
Expand Down Expand Up @@ -33,7 +34,7 @@ switch(args[0]) {

//> instance URL handling:
case '--instance':
const password = readline.question('🔑 Password: ', { hideEchoBack:true });
const password = readline.question(`${emoji.key} Password: `, { hideEchoBack:true });
instanceUrl = `https://admin:${password}@${args[1]}.medicmobile.org`;
shift(2);
break;
Expand Down
10 changes: 10 additions & 0 deletions src/lib/emoji.js
@@ -0,0 +1,10 @@
const EMOJIS = {
key: '🔑',
};

// Don't support emojis in Windows
if(process.platform === 'win32') {
Object.keys(EMOJIS).forEach(key => EMOJIS[key] = `:${key}:`);
}

module.exports = EMOJIS;

0 comments on commit f1fdef3

Please sign in to comment.