Skip to content

Commit

Permalink
fix($core): build error when VuePress runs in non-TTY device (close: #…
Browse files Browse the repository at this point in the history
  • Loading branch information
ulivz committed Nov 25, 2018
1 parent bec093d commit 32c32c9
Showing 1 changed file with 7 additions and 2 deletions.
9 changes: 7 additions & 2 deletions lib/prepare/util.js
Original file line number Diff line number Diff line change
Expand Up @@ -75,6 +75,11 @@ exports.encodePath = function (userpath) {
return userpath.split('/').map(item => encodeURIComponent(item)).join('/')
}

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

0 comments on commit 32c32c9

Please sign in to comment.