Skip to content

Commit

Permalink
Merge pull request #3 from dhutchison/configuration-updates
Browse files Browse the repository at this point in the history
Configuration updates
  • Loading branch information
dhutchison committed Feb 7, 2021
2 parents b0aa81d + ce0e0f9 commit 02dcf4f
Show file tree
Hide file tree
Showing 4 changed files with 781 additions and 1,516 deletions.
31 changes: 31 additions & 0 deletions README.md
Expand Up @@ -42,6 +42,9 @@ WORKSPACE_ID=<id of the Toggle workspace>
```

If the program is called with a `DOT_ENV_CONFIG` environment variable set, then an alternative location can be specified for this configuration file.


## Example Usage

An example of running this for a single day:
Expand All @@ -58,6 +61,20 @@ Counted break time: 00:00:00
Counted total time: 03:43:31
```

Running for a single day, using a configuration file in an alternative location:
```
$ DOT_ENV_CONFIG=~/.toggl-summary-cli.env npx @devwithimagination/toggl-summary-cli -d 2020-09-18
Report loaded, total booked time: 02:49:13
Unbooked time since last entry: 00:22:04
Unbooked time since last entry: 00:11:02
Unbooked time since last entry: 00:15:05
==== Totals for 2020-09-18 to 2020-09-18 ====
Counted booked time: 02:49:11
Counted unbooked time: 00:54:20
Counted break time: 00:00:00
Counted total time: 03:43:31
```

Running for a week:
```
$ npx @devwithimagination/toggl-summary-cli -d 2020-09-14 -w
Expand Down Expand Up @@ -114,6 +131,20 @@ Counted break time: 00:00:00
Counted total time: 03:43:31
```

### Advanced Usage - To create a Day One Entry

I use [Day One](https://dayoneapp.com) as my journaling application of choice. This utility script was primarily created to produce the starter for a template for daily or weekly entries relating to work.

To create a daily entry, for the current day, I run:
```
$ dayone2 --tags work -- new $'End of Day Work Summary\n\n' "$(DOT_ENV_CONFIG=~/.toggl-summary-cli.env npx @devwithimagination/toggl-summary-cli | tail -n +2)"
```

To create a weekly entry, for the current week, I run:
```
$ dayone2 --tags work -- new $'End of Week Work Summary\n\n' "$(DOT_ENV_CONFIG=~/.toggl-summary-cli.env npx @devwithimagination/toggl-summary-cli -d $(date -v -Mon +%Y-%m-%d) -w | tail -n +2)"
```

## Testing

This project uses [jest][jest] with [ts-jest][ts-jest] for testing. Running `npm test` will run the test suites and output coverage reports into the `coverage` directory.
Expand Down

0 comments on commit 02dcf4f

Please sign in to comment.