mirror of
https://github.com/opelly27/streetmerchant.git
synced 2026-05-20 02:57:34 +00:00
feat: bring back ascii banner, but make it configurable (#703)
This commit is contained in:
@@ -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
@@ -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
@@ -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.
|
||||||
*
|
*
|
||||||
|
|||||||
Reference in New Issue
Block a user