Skip to content

Commit d00c179

Browse files
committed
Merge pull request #74 from igorshubovych/windows-list-fix
Fix --list commands on Windows
2 parents c10646b + f13bfa2 commit d00c179

File tree

2 files changed

+3
-2
lines changed

2 files changed

+3
-2
lines changed

lib/cache.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -72,7 +72,7 @@ function tryLoad(pages, index, done) {
7272
}
7373

7474
function isPage(file) {
75-
return file.match(/.*\.md$/);
75+
return path.extname(file) == '.md';
7676
}
7777

7878
function onPlatform(os) {

lib/tldr.js

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,7 @@
11
var _ = require('lodash');
22
var fs = require('fs');
33
var ms = require('ms');
4+
var path = require('path');
45
var cache = require('./cache');
56
var platform = require('./platform');
67
var messages = require('./messages');
@@ -122,5 +123,5 @@ function checkStale() {
122123
}
123124

124125
function pageName(file) {
125-
return file.match(/.*\/(.*)\.md$/)[1];
126+
return path.basename(file, '.md');
126127
}

0 commit comments

Comments
 (0)