File tree Expand file tree Collapse file tree 6 files changed +31
-7
lines changed
Expand file tree Collapse file tree 6 files changed +31
-7
lines changed Original file line number Diff line number Diff line change 11FROM node:8.2.1-alpine
22
3- ENV GTT_VERSION 1.5.5
3+ ENV GTT_VERSION 1.6.0
44
55RUN yarn global add --prefix /usr/local "gitlab-time-tracker@$GTT_VERSION"
66
Original file line number Diff line number Diff line change 11#!/usr/bin/env node
22
3- const version = '1.5.5 ' ;
3+ const version = '1.6.0 ' ;
44const program = require ( 'commander' ) ;
55
66program
Original file line number Diff line number Diff line change @@ -45,7 +45,20 @@ class fileConfig extends config {
4545 */
4646 parseLocal ( ) {
4747 try {
48- return yaml . sync ( this . local , { } ) ;
48+ let local = Object . assign ( { extend : true } , yaml . sync ( this . local , { } ) ) ;
49+
50+ if ( local . extend === true ) {
51+ local = Object . assign ( this . parseGlobal ( ) , local ) ;
52+ } else if ( local . extend ) {
53+ try {
54+ local = Object . assign ( yaml . sync ( local . extend , { } ) , local ) ;
55+ } catch ( e ) {
56+ console . log ( `Error parsing configuration: "${ local . extend } "` ) ;
57+ process . exit ( 1 ) ;
58+ }
59+ }
60+
61+ return local ;
4962 } catch ( e ) {
5063 console . log ( `Error parsing configuration: "${ this . local } "` ) ;
5164 process . exit ( 1 ) ;
Original file line number Diff line number Diff line change 11{
22 "name" : " gitlab-time-tracker" ,
3- "version" : " 1.5.5 " ,
3+ "version" : " 1.6.0 " ,
44 "description" : " A command line interface for GitLabs time tracking feature." ,
55 "bugs" : {
66 "url" : " https://github.com/kriskbx/gitlab-time-tracker/issues"
Original file line number Diff line number Diff line change @@ -141,9 +141,9 @@ gtt config
141141gtt config --local
142142```
143143
144- If a local configuration file is present it's used instead of the global one.
145- So you can use gtt on a per project basis. Make sure to add .gtt.yml to your
146- gitignore file if using a local configuration.
144+ If a local configuration file is present it will extend of the global one and overwrites global settings .
145+ If you don't want to extend the global configuration file, set the ` extend ` option in your local config to ` false ` .
146+ So you can use gtt easily on a per project basis. Make sure to add .gtt.yml to your gitignore file if using a local configuration.
147147
148148### II) time tracking
149149
@@ -576,6 +576,12 @@ _parallel: 20
576576# Change rows per page (max. 100)
577577# defaults to 100
578578_perPage : 100
579+
580+ # Only works if using a local configuration file!
581+ # Extend the global configuration if set to true, pass a string to extend
582+ # the configuration file stored at the given path
583+ # defaults to true
584+ extend : true
579585` ` `
580586
581587### Time format
Original file line number Diff line number Diff line change 11# gtt
22
3+ ### upgrading from < 1.5.* to 1.6.*
4+
5+ Starting with version ` 1.6 ` the local configuration file will extend the global configuration by default. If you
6+ don't want this behaviour, make sure to use ` extend: false ` in your local config.
7+
38### upgrading from 0.*
49
510I built gtt originally in PHP because I'm a PHP dev and I chose the language I'm most familiar
You can’t perform that action at this time.
0 commit comments