From b65f57e4d5987ba1ac2dd2fe43fe681cbb8a6d99 Mon Sep 17 00:00:00 2001 From: Guillermo Rauch Date: Sat, 28 May 2016 11:22:14 -0700 Subject: [PATCH] now-alias: pass only strings (minimist converts to `Number`) --- bin/now-alias | 12 ++++++++---- 1 file changed, 8 insertions(+), 4 deletions(-) diff --git a/bin/now-alias b/bin/now-alias index 9ec1da1..b4c7d0b 100755 --- a/bin/now-alias +++ b/bin/now-alias @@ -103,22 +103,26 @@ async function run (token) { switch (subcommand) { case 'list': case 'ls': - await alias.ls(argv._[0]); + await alias.ls(null != argv._[0] ? String(argv._[0]) : null); break; case 'remove': case 'rm': - await alias.rm(argv._[0]); + await alias.rm(String(argv._[0])); break; case 'add': case 'set': - await alias.set(argv._[0], argv._[1]); + if (2 !== argv._.length) { + error('Invalid number of arguments'); + return; + } + await alias.set(String(argv._[0]), String(argv._[1])); break; default: if (2 === argv._.length) { - await alias.set(argv._[0], argv._[1]); + await alias.set(String(argv._[0]), String(argv._[1])); } else if (argv._.length >= 3) { error('Invalid number of arguments'); help();