feat: bring back ascii banner, but make it configurable (#703)

This commit is contained in:
Nathan Grebowiec
2020-11-06 15:39:34 -06:00
committed by GitHub
parent 19fd6895e7
commit 0a680e977b
3 changed files with 23 additions and 4 deletions
+2
View File
@@ -2,6 +2,8 @@
# Read https://github.com/jef/streetmerchant#customization for help on customizing this file # Read https://github.com/jef/streetmerchant#customization for help on customizing this file
############################################################################################# #############################################################################################
ASCII_BANNER=
ASCII_COLOR=
BROWSER_TRUSTED= BROWSER_TRUSTED=
COUNTRY= COUNTRY=
DESKTOP_NOTIFICATIONS= DESKTOP_NOTIFICATIONS=
+19 -2
View File
@@ -3,5 +3,22 @@ import {readFileSync} from 'fs';
const version = readFileSync('version.txt', 'utf8'); const version = readFileSync('version.txt', 'utf8');
export const banner = chalk.gray.bold(`STREETMERCHANT export const banner = {
${version}`); asciiVersion: `
██████ ▄▄▄█████▓ ██▀███ ▓█████ ▓█████▄▄▄█████▓ ███▄ ▄███▓▓█████ ██▀███ ▄████▄ ██░ ██ ▄▄▄ ███▄ █ ▄▄▄█████▓
▒██ ▒ ▓ ██▒ ▓▒▓██ ▒ ██▒▓█ ▀ ▓█ ▀▓ ██▒ ▓▒▓██▒▀█▀ ██▒▓█ ▀ ▓██ ▒ ██▒▒██▀ ▀█ ▓██░ ██▒▒████▄ ██ ▀█ █ ▓ ██▒ ▓▒
░ ▓██▄ ▒ ▓██░ ▒░▓██ ░▄█ ▒▒███ ▒███ ▒ ▓██░ ▒░▓██ ▓██░▒███ ▓██ ░▄█ ▒▒▓█ ▄ ▒██▀▀██░▒██ ▀█▄ ▓██ ▀█ ██▒▒ ▓██░ ▒░
▒ ██▒░ ▓██▓ ░ ▒██▀▀█▄ ▒▓█ ▄ ▒▓█ ▄░ ▓██▓ ░ ▒██ ▒██ ▒▓█ ▄ ▒██▀▀█▄ ▒▓▓▄ ▄██▒░▓█ ░██ ░██▄▄▄▄██ ▓██▒ ▐▌██▒░ ▓██▓ ░
▒██████▒▒ ▒██▒ ░ ░██▓ ▒██▒░▒████▒░▒████▒ ▒██▒ ░ ▒██▒ ░██▒░▒████▒░██▓ ▒██▒▒ ▓███▀ ░░▓█▒░██▓ ▓█ ▓██▒▒██░ ▓██░ ▒██▒ ░
▒ ▒▓▒ ▒ ░ ▒ ░░ ░ ▒▓ ░▒▓░░░ ▒░ ░░░ ▒░ ░ ▒ ░░ ░ ▒░ ░ ░░░ ▒░ ░░ ▒▓ ░▒▓░░ ░▒ ▒ ░ ▒ ░░▒░▒ ▒▒ ▓▒█░░ ▒░ ▒ ▒ ▒ ░░
░ ░▒ ░ ░ ░ ░▒ ░ ▒░ ░ ░ ░ ░ ░ ░ ░ ░ ░ ░ ░ ░ ░ ░▒ ░ ▒░ ░ ▒ ▒ ░▒░ ░ ▒ ▒▒ ░░ ░░ ░ ▒░ ░
░ ░ ░ ░ ░░ ░ ░ ░ ░ ░ ░ ░ ░░ ░ ░ ░ ░░ ░ ░ ▒ ░ ░ ░ ░
░ ░ ░ ░ ░ ░ ░ ░ ░ ░ ░ ░ ░ ░ ░ ░ ░ ░
${version}`,
render(ascii: boolean, hexColor: string) {
return chalk.hex(hexColor).bold(ascii ? this.asciiVersion : this.stringVersion);
},
stringVersion: `STREETMERCHANT
${version}`
};
+2 -2
View File
@@ -1,12 +1,12 @@
import {banner} from './banner'; import {banner} from './banner';
console.info(banner);
import {config as config_} from 'dotenv'; import {config as config_} from 'dotenv';
import path from 'path'; import path from 'path';
config_({path: path.resolve(__dirname, '../.env')}); config_({path: path.resolve(__dirname, '../.env')});
console.info(banner.render(envOrBoolean(process.env.ASCII_BANNER, false), envOrString(process.env.BANNER_COLOR, '#808080')));
/** /**
* Returns environment variable, given array, or default array. * Returns environment variable, given array, or default array.
* *