From b9832670ebc1fec88759afe3c60e1b5e45b495fd Mon Sep 17 00:00:00 2001 From: gabriel garcia seco Date: Sat, 4 Apr 2020 11:13:01 +0200 Subject: [PATCH 1/2] Add feature time --- CHANGELOG.md | 4 ++++ LICENSE | 2 +- package-lock.json | 2 +- package.json | 8 ++++---- src/cli.ts | 34 +++++++++++++++++++++++++++------- src/holded.ts | 11 +++++++---- src/puppetter.ts | 12 ++++++------ 7 files changed, 50 insertions(+), 23 deletions(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index 81cc618..a1dcafb 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -13,6 +13,10 @@ and this project adheres to [Semantic Versioning](http://semver.org/). ### Removed ### BREAKING CHANGES +## [1.0.0-beta.4] - 2020-04-04 +### Added +- Option --time for the commands so you can put the time you want in them + ## [1.0.0-beta.3] - 2020-04-01 ### Added - Option --debug so you can the puppeteer running in case you need to debug diff --git a/LICENSE b/LICENSE index 0c86a8a..3113439 100644 --- a/LICENSE +++ b/LICENSE @@ -1,6 +1,6 @@ MIT License -Copyright (c) 2019 Khalid Zoabi +Copyright (c) 2020 Gabriel García Seco Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Software"), to deal diff --git a/package-lock.json b/package-lock.json index 873d19a..241921b 100644 --- a/package-lock.json +++ b/package-lock.json @@ -1,6 +1,6 @@ { "name": "holded-bot", - "version": "1.0.0-beta.3", + "version": "1.0.0-beta.4", "lockfileVersion": 1, "requires": true, "dependencies": { diff --git a/package.json b/package.json index 62116e7..eeb86ad 100644 --- a/package.json +++ b/package.json @@ -1,12 +1,12 @@ { "name": "holded-bot", - "version": "1.0.0-beta.3", - "description": "Holded bot from terminal", + "version": "1.0.0-beta.4", + "description": "Holded bot so you can fill your time from terminal", "author": "Gabriel García Seco ", "keywords": [ - "typescript", + "holded", "cli", - "starter" + "lazydev" ], "license": "MIT", "main": "./dist/index.js", diff --git a/src/cli.ts b/src/cli.ts index 8a075ed..8df7f92 100644 --- a/src/cli.ts +++ b/src/cli.ts @@ -1,14 +1,20 @@ #!/usr/bin/env node +const packageJSON = require('../package.json'); // eslint-disable-line import program from 'commander'; import input from '@inquirer/input'; import password from '@inquirer/password'; import keytar from 'keytar'; import { startWork, stopWork } from './holded'; import { Routes } from './routes'; -const packageJSON = require('../package.json'); // eslint-disable-line -function executeCli({ email, company, password }) { +interface ExecuteCliArgs { + email: string; + company: string; + password: string; +} + +function executeCli({ email, company, password }: ExecuteCliArgs): void { const routes = Routes({ business: company }); program.version(packageJSON.version); @@ -18,21 +24,35 @@ function executeCli({ email, company, password }) { program .command('start') .description('writes into the holded the time') - .action(function () { - startWork({ email, password }, routes, { debug: program.debug }); + .option('-t, --time