diff --git a/berk.js b/berk.js index 2253cf9..e358c6b 100644 --- a/berk.js +++ b/berk.js @@ -5,16 +5,40 @@ process.stdout.write("\u001b[3J\u001b[2J\u001b[1J\u001b[3J"); console.clear(); +const config = require("./berk.json"); + const terminalImage = require('terminal-image'); const chalk = require('chalk'); const got = require('got'); const ww = require('word-wrap'); +const inquirer = require('inquirer'); +const open = require('open'); + console.log("") -got('https://avatars3.githubusercontent.com/u/17373485?s=600&v=4', { responseType: 'buffer' }) +got(config.avatar, { responseType: 'buffer' }) .then((image) => terminalImage.buffer(image.body, { width: '26%' })) .then((image) => image.split("\n").forEach((line) => console.log(" " + line))) .then(() => { - console.log(ww(chalk`Hello, this is {bold.blue Berk ALTIOK!}`, { width: 200, trim: true })); + console.log(ww(eval(`chalk\`${config.title}\``), { width: 200, trim: true })) + // config.about.forEach(text => console.log(ww(eval(`chalk\`${text}\``), { width: 200, trim: true }))) + }) + .then(() => { + console.log("\n") + inquirer.prompt([ + { + type: 'list', + message: 'For other things...', + name: 'open', + choices: [ + { name: chalk.bold.hex('#888888')(`💻 GitHub`), value: 'https://github.com/berkaltiok' }, + { name: chalk.bold.hex('#1DA1F2')(`🐦 Twitter`), value: 'https://twitter.com/berkpw' }, + { name: chalk.bold.hex('#D7CBFD')(`💼 Portfolio`), value: 'https://berkaltiok.github.io' }, + { name: chalk.bold.hex('#f04a45')('👋 Nope. Bye.'), value: false } + ] + } + ]) + .then((link) => { open(link.open); process.exit(); }) + .catch(() => {}); }) - .catch((e) => console.log(e)); + .catch((e) => console.log(e)); \ No newline at end of file diff --git a/berk.json b/berk.json index ce78c7b..576a79a 100644 --- a/berk.json +++ b/berk.json @@ -1,3 +1,10 @@ { - "title": "Hello, this is {bold.blue Berk ALTIOK!}" + "avatar": "https://avatars3.githubusercontent.com/u/17373485", + "title": "Hello, this is {bold.hex('#3b9aff') Berk Altıok!}", + "about": [ + "Test 123", + "Test 123", + "Test 123", + "Test 123" + ] } \ No newline at end of file diff --git a/package-lock.json b/package-lock.json index 7aa0aec..b595ec2 100644 --- a/package-lock.json +++ b/package-lock.json @@ -1,6 +1,6 @@ { "name": "berk", - "version": "0.0.5", + "version": "0.0.6", "lockfileVersion": 1, "requires": true, "dependencies": { diff --git a/package.json b/package.json index 87dbb09..2b13aea 100644 --- a/package.json +++ b/package.json @@ -1,6 +1,6 @@ { "name": "berk", - "version": "0.0.5", + "version": "0.0.6", "description": "Berk ALTIOK About", "main": "berk.js", "bin": {