From 8038129027b170ea8dbcec731d3fbba09191873f Mon Sep 17 00:00:00 2001 From: Valerie Date: Wed, 22 Dec 2021 08:55:48 -0500 Subject: [PATCH] ls color MORE --- src/commands/ls.ts | 13 ++++++++++++- 1 file changed, 12 insertions(+), 1 deletion(-) diff --git a/src/commands/ls.ts b/src/commands/ls.ts index 541d101..20b775c 100644 --- a/src/commands/ls.ts +++ b/src/commands/ls.ts @@ -14,7 +14,18 @@ export default function ls(flags: any) { } for(const [configKey, configVal] of Object.entries(instance.privateScope.config)) { - console.log(' ' + chalk.ansi256(240)(configKey + ': ' + configVal)); + + const valueString = (function() { + if(typeof configVal === 'number') { + return chalk.ansi256(172)(configVal) + } else if (typeof configVal === 'string'){ + return chalk.ansi256(39)('\'' + configVal + '\'') + } else { + return configVal; + } + })() + + console.log(' ' + chalk.ansi256(240)(configKey + ': ' + valueString)); } } } \ No newline at end of file