Coder Social home page Coder Social logo

abandon.onetime-cli's Introduction

onetime-cli

travis

A command line interface to manage harvest and target-process in one place.

Install

You need to set up your MyGet authentication and then install the package with npm install -g @neworbit/onetime-cli

Usage

Type the following to get usage information:

onetime -h

To expert using onetime see the tutorial on our wiki

Features

  • Aliases: You can define named aliases to make starting regular times easier.
  • Project settings: You can define a .onetime file in the root of your project and specify which project to be used when starting time from that directory.
  • Finish time: Finishing a time will stop the timer on harvest and (if any) will log the time on target process. You can choose a time to finish or bulk finish all times of a specific day (default to today).
  • Restart a time: Restart one of your older timers with exact same details to avoid adding details over and over again.

Contributing

Found a bug or have an idea? Open a new issue and let's discuss it :)

  1. Fork it!
  2. Create your feature branch: git checkout -b my-new-feature
  3. Commit your changes: git commit -am 'Add some feature'
  4. Push to the branch: git push origin my-new-feature
  5. Submit a pull request :D

Run the cli on development mode

npm install
npm link

License

Developed and maintained by Mo Valipour.

See license info here.

abandon.onetime-cli's People

Contributors

davidgruar avatar hisuwh avatar jameskmonger avatar mvalipour avatar petevb avatar thyde1 avatar woahitsjc avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Forkers

thyde1

abandon.onetime-cli's Issues

Node 10: prompting for a TP ID not working

  • Start a timer with onetime t start
  • Enter a valid TP ID
  • The list of Harvest projects is displayed
  • As soon as you press a key the process exits.

The problem seems to be somewhere here:
https://github.com/NewOrbit/onetime-cli/blob/f644d6e868167702f7732d47f6bc6501bb870dca/src/commands/time/_base.js#L52-L60

It seems this.async() is not behaving as it did in previous versions of Node, and thus inquirer is not waiting for the callback to complete before asking the next question.

Here is the implementation of this.async(), from node_modules\inquirer\lib\utils\utils.js:

utils.runAsync = function( func, cb ) {
  var async = false;
  var isValid = func.apply({
    async: function() {
      async = true;
      return _.once(cb);
    }
  }, Array.prototype.slice.call(arguments, 2) );

  if ( !async ) {
    cb(isValid);
  }
};

Workaround

Pass the TP ID as a command line argument, e.g. onetime t start --tp 12345

Pressing enter without search result gives error

When searching for project/task, if you type in a term that returns no results and press enter, you get the following error:

TypeError: Cannot read property 'name' of undefined
    at Prompt.render (C:\Users\JamesMonger\.nvmw\v5.12.0\node_modules\onetime-cli\src\inquirer-extensions\searchable-list.js:113:47)
    at Prompt.onSubmit (C:\Users\JamesMonger\.nvmw\v5.12.0\node_modules\onetime-cli\src\inquirer-extensions\searchable-list.js:142:16)
    at AnonymousObserver.Rx.AnonymousObserver.AnonymousObserver.next (C:\Users\JamesMonger\.nvmw\v5.12.0\node_modules\onetime-cli\node_modules\rx\dist\rx.js:1778:12)
    at AnonymousObserver.Rx.internals.AbstractObserver.AbstractObserver.onNext (C:\Users\JamesMonger\.nvmw\v5.12.0\node_modules\onetime-cli\node_modules\rx\dist\rx.js:1710:35)
    at AnonymousObserver.tryCatcher (C:\Users\JamesMonger\.nvmw\v5.12.0\node_modules\onetime-cli\node_modules\rx\dist\rx.js:567:29)
    at AutoDetachObserverPrototype.next (C:\Users\JamesMonger\.nvmw\v5.12.0\node_modules\onetime-cli\node_modules\rx\dist\rx.js:5274:51)
    at AutoDetachObserver.Rx.internals.AbstractObserver.AbstractObserver.onNext (C:\Users\JamesMonger\.nvmw\v5.12.0\node_modules\onetime-cli\node_modules\rx\dist\rx.js:1710:35)
    at AnonymousObserver._onNext (C:\Users\JamesMonger\.nvmw\v5.12.0\node_modules\onetime-cli\node_modules\rx\dist\rx.js:5079:13)
    at AnonymousObserver.Rx.AnonymousObserver.AnonymousObserver.next (C:\Users\JamesMonger\.nvmw\v5.12.0\node_modules\onetime-cli\node_modules\rx\dist\rx.js:1778:12)
    at AnonymousObserver.Rx.internals.AbstractObserver.AbstractObserver.onNext (C:\Users\JamesMonger\.nvmw\v5.12.0\node_modules\onetime-cli\node_modules\rx\dist\rx.js:1710:35)

"This Bug is not associated with a user-story. -- ignored" - yet it still marks it as finished

If you have bug time configured to user-story but there is not a user story assigned to the bug you get the following error message:
"This Bug is not associated with a user-story. -- ignored"

However it continues to mark the item as finished (so not actually ignored).
It should do nothing with this item allowing you to rectify the bug and then subsequently run finish again.

Time entry not created on TP when creating a non-active task

I'd expect that when doing onetime t start, specify how many hours I've worked on a task and then answer "No" to the "Are you still doing this?" question it would automatically log that to Target Process as well as creating the entry in Harvest (which it does). It's essentially creating a finished task so why would we have to finish it again to log it?

Example entry:

image

Putting a space after the TP id causes error

When prompted for a TP id, putting an ID with a space after it (e.g. "28386 ") causes the following error:

>> Please enter a valid number.

This is because number in utils/validation.js passes the whole string into validator.isInt, which requires an exact integer.

Timer finish doesn't update accurately

From Skype / @Jameskmonger :

Found an issue with onetime. Numbers used below are arbitrary as an example

Start a Harvest timer linked to a TP task. Wait for the timer to hit 1 minute and type "onetime t finish". When onetime asks you which timer to finish, wait on that page for 1 minute. Scroll down to the timer (should say 1 minute but on Harvest it will now be 2 minutes) and finish it.

2 minutes will be logged on Harvest while 1 minute will be logged on TP.

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.