Skip to content

Commit

Permalink
Meta tweaks
Browse files Browse the repository at this point in the history
  • Loading branch information
sindresorhus committed May 10, 2017
1 parent fa07d96 commit b6b2613
Show file tree
Hide file tree
Showing 4 changed files with 10 additions and 7 deletions.
2 changes: 1 addition & 1 deletion .editorconfig
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,6 @@ charset = utf-8
trim_trailing_whitespace = true
insert_final_newline = true

[{package.json,*.yml}]
[*.yml]
indent_style = space
indent_size = 2
11 changes: 7 additions & 4 deletions cli.js
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@ const mem = require('mem');
const clipboardy = require('clipboardy');
const skinTone = require('skin-tone');
const Conf = require('conf');
const emoj = require('./');
const emoj = require('.');

// Limit it to 7 results so not to overwhelm the user
// This also reduces the chance of showing unrelated emojis
Expand All @@ -34,8 +34,8 @@ const cli = meow(`
🦄 🎠 🐴 🐎 ❤ ✨ 🌈
Options
--copy -c Copy the first emoji to the clipboard
--skin-tone -s Set and persist the default emoji skin tone (0 to 5)
--copy -c Copy the first emoji to the clipboard
--skin-tone -s Set and persist the default emoji skin tone (0 to 5)
Run it without arguments to enter the live search
Use the up/down keys during live search to change the skin tone
Expand All @@ -58,11 +58,14 @@ let skinNumber = config.get('skinNumber');
if (cli.input.length > 0) {
fetch(cli.input[0]).then(val => {
val = val.map(x => skinTone(x, skinNumber));

console.log(val.join(' '));

if (cli.flags.copy) {
clipboardy.writeSync(val[0]);
}
});

return;
}

Expand All @@ -85,7 +88,7 @@ dns.lookup('emoji.getdango.com', err => {
process.stdin.on('keypress', (ch, key) => {
key = key || {};

// Filter out all Ansi sequences except the Up/Down keys which change the skin tone
// Filter out all ansi sequences except the up/down keys which change the skin tone
if (hasAnsi(key.sequence) && ((key.name !== 'up' && key.name !== 'down') || query.length <= 1)) {
return;
}
Expand Down
2 changes: 1 addition & 1 deletion readme.md
Original file line number Diff line number Diff line change
Expand Up @@ -32,7 +32,7 @@ $ emoj --help
🦄 🎠 🐴 🐎 ❤ ✨ 🌈
Options
--copy -c Copy the first emoji to the clipboard
--copy -c Copy the first emoji to the clipboard
--skin-tone -s Set and persist the default emoji skin tone (0 to 5)
Run it without arguments to enter the live search
Expand Down
2 changes: 1 addition & 1 deletion test.js
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
import test from 'ava';
import m from './';
import m from '.';

test(async t => {
const [unicornEmoji] = await m('unicorn');
Expand Down

0 comments on commit b6b2613

Please sign in to comment.