@keymanapp/kmc 18.0.135-alpha → 18.0.136-alpha
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"getLastGitCommitDate.d.ts","sourceRoot":"","sources":["../../../src/util/getLastGitCommitDate.ts"],"names":[],"mappings":"AAGA,eAAO,MAAM,qBAAqB,QAAoD,CAAC;AAEvF;;;;GAIG;AACH,wBAAgB,oBAAoB,CAAC,IAAI,EAAE,MAAM,GAAG,MAAM,
|
|
1
|
+
{"version":3,"file":"getLastGitCommitDate.d.ts","sourceRoot":"","sources":["../../../src/util/getLastGitCommitDate.ts"],"names":[],"mappings":"AAGA,eAAO,MAAM,qBAAqB,QAAoD,CAAC;AAEvF;;;;GAIG;AACH,wBAAgB,oBAAoB,CAAC,IAAI,EAAE,MAAM,GAAG,MAAM,CAuCzD"}
|
|
@@ -7,21 +7,48 @@ export const expectedGitDateFormat = /^\d\d\d\d-\d\d-\d\dT\d\d:\d\d:\d\d(\.\d\d\
|
|
|
7
7
|
* @returns string, in RFC3339, 'YYYY-MM-DDThh:nn:ss.SSSZ'
|
|
8
8
|
*/
|
|
9
9
|
export function getLastGitCommitDate(path) {
|
|
10
|
-
//
|
|
11
|
-
let result =
|
|
12
|
-
|
|
13
|
-
|
|
10
|
+
// git log -1 --no-merges --format=%at
|
|
11
|
+
let result = callGitLog([
|
|
12
|
+
'log', // git log
|
|
13
|
+
'-1', // one commit only
|
|
14
|
+
'--no-merges', // we're only interested in 'real' commits
|
|
15
|
+
'--format=%at', // emit only the commit date as a UNIX timestamp
|
|
16
|
+
'--',
|
|
17
|
+
path
|
|
18
|
+
]);
|
|
19
|
+
if (typeof result != 'string') {
|
|
20
|
+
return null;
|
|
21
|
+
}
|
|
22
|
+
if (result == '') {
|
|
23
|
+
// #12626: no history was found, but not an error. We may have only a merge
|
|
24
|
+
// commit in history for that file, allow merges in the log
|
|
25
|
+
result = callGitLog([
|
|
14
26
|
'log', // git log
|
|
15
27
|
'-1', // one commit only
|
|
16
|
-
'--no-merges', // we're only interested in 'real' commits
|
|
17
28
|
'--format=%at', // emit only the commit date as a UNIX timestamp
|
|
18
29
|
'--',
|
|
19
30
|
path
|
|
20
|
-
]
|
|
31
|
+
]);
|
|
32
|
+
if (typeof result != 'string') {
|
|
33
|
+
return null;
|
|
34
|
+
}
|
|
35
|
+
}
|
|
36
|
+
const sec = Number.parseInt(result);
|
|
37
|
+
if (Number.isNaN(sec)) {
|
|
38
|
+
// We received invalid data, perhaps a git error string so just ignore
|
|
39
|
+
return null;
|
|
40
|
+
}
|
|
41
|
+
// We receive a timestamp in seconds but we need milliseconds
|
|
42
|
+
return new Date(sec * 1000).toISOString();
|
|
43
|
+
}
|
|
44
|
+
function callGitLog(params) {
|
|
45
|
+
try {
|
|
46
|
+
const result = execFileSync('git', params, {
|
|
21
47
|
encoding: 'utf-8', // force a string result rather than Buffer
|
|
22
48
|
windowsHide: true, // on windows, we may need this to suppress a console window popup
|
|
23
49
|
stdio: ['pipe', 'pipe', 'pipe'] // all output via pipe, so we don't get git errors on console
|
|
24
50
|
});
|
|
51
|
+
return result.trim();
|
|
25
52
|
}
|
|
26
53
|
catch (e) {
|
|
27
54
|
// If git is not available, or the file is not in-repo, then it is probably
|
|
@@ -32,8 +59,5 @@ export function getLastGitCommitDate(path) {
|
|
|
32
59
|
// seems low.
|
|
33
60
|
return null;
|
|
34
61
|
}
|
|
35
|
-
// We receive a timestamp in seconds but we need milliseconds
|
|
36
|
-
const msec = Number.parseInt(result.trim()) * 1000;
|
|
37
|
-
return new Date(msec).toISOString();
|
|
38
62
|
}
|
|
39
63
|
//# sourceMappingURL=getLastGitCommitDate.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"getLastGitCommitDate.js","sourceRoot":"","sources":["../../../src/util/getLastGitCommitDate.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,YAAY,EAAE,MAAM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AC,GAAG,GAAG,IAAI,CAAC,CAAC,WAAW,EAAE,CAAC;AAC5C,CAAC;AAED,SAAS,UAAU,CAAC,MAAgB;IAClC,IAAI,CAAC;QACH,MAAM,MAAM,GAAG,YAAY,CAAC,KAAK,EAAE,MAAM,EAAE;YACzC,QAAQ,EAAE,OAAO,EAAqB,2CAA2C;YACjF,WAAW,EAAE,IAAI,EAAqB,kEAAkE;YACxG,KAAK,EAAE,CAAC,MAAM,EAAE,MAAM,EAAE,MAAM,CAAC,CAAO,6DAA6D;SACpG,CAAC,CAAC;QACH,OAAO,MAAM,CAAC,IAAI,EAAE,CAAC;IACvB,CAAC;IAAC,OAAO,CAAC,EAAE,CAAC;QACX,2EAA2E;QAC3E,wEAAwE;QACxE,wEAAwE;QACxE,yEAAyE;QACzE,uEAAuE;QACvE,aAAa;QACb,OAAO,IAAI,CAAC;IACd,CAAC;AACH,CAAC"}
|
package/package.json
CHANGED
|
@@ -34,16 +34,16 @@
|
|
|
34
34
|
"kmlmp": "build/src/kmlmp.js"
|
|
35
35
|
},
|
|
36
36
|
"dependencies": {
|
|
37
|
-
"@keymanapp/common-types": "18.0.
|
|
38
|
-
"@keymanapp/developer-utils": "18.0.
|
|
39
|
-
"@keymanapp/keyman-version": "18.0.
|
|
40
|
-
"@keymanapp/kmc-analyze": "18.0.
|
|
41
|
-
"@keymanapp/kmc-keyboard-info": "18.0.
|
|
42
|
-
"@keymanapp/kmc-kmn": "18.0.
|
|
43
|
-
"@keymanapp/kmc-ldml": "18.0.
|
|
44
|
-
"@keymanapp/kmc-model": "18.0.
|
|
45
|
-
"@keymanapp/kmc-model-info": "18.0.
|
|
46
|
-
"@keymanapp/kmc-package": "18.0.
|
|
37
|
+
"@keymanapp/common-types": "18.0.136-alpha",
|
|
38
|
+
"@keymanapp/developer-utils": "18.0.136-alpha",
|
|
39
|
+
"@keymanapp/keyman-version": "18.0.136-alpha",
|
|
40
|
+
"@keymanapp/kmc-analyze": "18.0.136-alpha",
|
|
41
|
+
"@keymanapp/kmc-keyboard-info": "18.0.136-alpha",
|
|
42
|
+
"@keymanapp/kmc-kmn": "18.0.136-alpha",
|
|
43
|
+
"@keymanapp/kmc-ldml": "18.0.136-alpha",
|
|
44
|
+
"@keymanapp/kmc-model": "18.0.136-alpha",
|
|
45
|
+
"@keymanapp/kmc-model-info": "18.0.136-alpha",
|
|
46
|
+
"@keymanapp/kmc-package": "18.0.136-alpha",
|
|
47
47
|
"@sentry/node": "^7.57.0",
|
|
48
48
|
"chalk": "^2.4.2",
|
|
49
49
|
"commander": "^10.0.0",
|
|
@@ -82,5 +82,5 @@
|
|
|
82
82
|
"type": "git",
|
|
83
83
|
"url": "git+https://github.com/keymanapp/keyman.git"
|
|
84
84
|
},
|
|
85
|
-
"version": "18.0.
|
|
85
|
+
"version": "18.0.136-alpha"
|
|
86
86
|
}
|