Skip to content

Commit 32c32c9

Browse files
committed
fix($core): build error when VuePress runs in non-TTY device (close: #1037)
1 parent bec093d commit 32c32c9

File tree

1 file changed

+7
-2
lines changed

1 file changed

+7
-2
lines changed

Diff for: lib/prepare/util.js

+7-2
Original file line numberDiff line numberDiff line change
@@ -75,6 +75,11 @@ exports.encodePath = function (userpath) {
7575
return userpath.split('/').map(item => encodeURIComponent(item)).join('/')
7676
}
7777

78-
exports.getGitLastUpdatedTimeStamp = function (filepath) {
79-
return parseInt(spawn.sync('git', ['log', '-1', '--format=%ct', filepath]).stdout.toString('utf-8')) * 1000
78+
exports.getGitLastUpdatedTimeStamp = function (filePath) {
79+
let lastUpdated
80+
try {
81+
lastUpdated = parseInt(spawn.sync('git', ['log', '-1', '--format=%ct', filePath]).stdout.toString('utf-8')) * 1000
82+
} catch (e) { /* do not handle for now */ }
83+
return lastUpdated
8084
}
85+

0 commit comments

Comments
 (0)