Skip to content

Commit

Permalink
Merge pull request #19 from adarshaacharya/feature/author-name
Browse files Browse the repository at this point in the history
feat: add --author name argument
  • Loading branch information
adarshaacharya authored Jan 11, 2023
2 parents 1e0a950 + 9a71160 commit 833aefd
Show file tree
Hide file tree
Showing 4 changed files with 17 additions and 2,371 deletions.
20 changes: 13 additions & 7 deletions bin/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -7,20 +7,24 @@ const chalk = require('chalk');
const ora = require('ora');
const logUpdate = require('log-update');
const updateNotifier = require('update-notifier');
const meow = require('meow');
const pkg = require('../package.json');
const { showOutput } = require('../utils/output');
const boxen = require('boxen');

updateNotifier({ pkg }).notify();

const spinner = ora();
const url = `english.hamropatro.com`;

const checkArgs = () => {
meow(`
Usage
$ aaja
`);
const checkArgs = (args) => {
if (args[0] === '--author') {
logUpdate((boxen(`
Created by : Aadarsha Acharya
GitHub : https://github.com/adarshaacharya
Twitter : https://twitter.com/adarsha_ach
`)));
process.exit(0);
}
};

const checkConnection = () => {
Expand All @@ -44,7 +48,9 @@ const showError = () => {

const main = () => {
const aaja = {};
checkArgs();
const userArgv = process.argv.slice(2);
checkArgs(userArgv);

checkConnection();

got(`https://${url}`)
Expand Down
5 changes: 3 additions & 2 deletions package-lock.json

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "aaja",
"version": "1.0.3",
"version": "1.0.4",
"description": "CLI tool to get details about today's nepali date, tithi, public events and current time.",
"main": "bin/index.js",
"bin": {
Expand Down
Loading

0 comments on commit 833aefd

Please sign in to comment.