Skip to content

Commit 2bc939c

Browse files
committed
configurable framedir to keep compatibility with 1.7
1 parent 87ef5d6 commit 2bc939c

File tree

3 files changed

+9
-2
lines changed

3 files changed

+9
-2
lines changed

documentation.md

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -656,6 +656,9 @@ _checkToken: false
656656
# Skip parsing the issue/merge_request description for time records
657657
_skipDescriptionParsing: false
658658

659+
# directory for the track record files. defaults to ~/.local/share/.gtt/frames/, %LOCALAPPDATA%\.gtt\Data\frames or equivalent
660+
#frameDir: /some/absolute/directory/
661+
659662
# settings for invoice output
660663
invoiceSettings:
661664
from:

src/include/config.js

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -46,6 +46,7 @@ const defaults = {
4646
_skipDescriptionParsing: false,
4747
throttleMaxRequestsPerInterval: 10,
4848
throttleInterval: 1000,
49+
frameDir: undefined,
4950
};
5051

5152
/**

src/include/file-config.js

Lines changed: 5 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -22,6 +22,7 @@ class fileConfig extends config {
2222
this.assertGlobalConfig();
2323
this.workDir = workDir;
2424
this.data = Object.assign(this.data, this.localExists() ? this.parseLocal() : this.parseGlobal());
25+
if (!fs.existsSync(this.frameDir)) shell.mkdir('-p', this.frameDir);
2526
this._dump = {};
2627
this.cache = {
2728
delete: this._cacheDelete,
@@ -94,7 +95,6 @@ class fileConfig extends config {
9495

9596

9697
if (!fs.existsSync(this.globalDir)) shell.mkdir('-p', this.globalDir);
97-
if (!fs.existsSync(this.frameDir)) shell.mkdir('-p', this.frameDir);
9898
if (!fs.existsSync(this.cacheDir)) shell.mkdir('-p', this.cacheDir);
9999
if (!fs.existsSync(this.global)) fs.appendFileSync(this.global, '');
100100
}
@@ -139,7 +139,10 @@ class fileConfig extends config {
139139
}
140140

141141
get frameDir() {
142-
return Fs.join(this.globalDir, 'frames/files');
142+
if(this.data.frameDir) {
143+
return this.data.frameDir;
144+
}
145+
return Fs.join(this.globalDir, 'frames');
143146
}
144147

145148
get cacheDir() {

0 commit comments

Comments
 (0)