Skip to content

Commit 6270b73

Browse files
committed
Fixed the repo url msg in cache update
The pagesRepository url was being used to show the message when a page was not found in the repo. Therefore restored it. Also fixed some test urls for config
1 parent 8395b4e commit 6270b73

File tree

3 files changed

+6
-5
lines changed

3 files changed

+6
-5
lines changed

config.json

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,5 @@
11
{
2+
"pagesRepository": "https://github.com/tldr-pages/tldr",
23
"repository": "http://tldr-pages.github.io/assets/tldr.zip",
34
"themes": {
45
"simple": {

lib/messages.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -8,6 +8,6 @@ Please run tldr --update`;
88

99
notFound() {
1010
return `Page not found.
11-
Feel free to send a pull request to: https://github.com/` + config.get().pagesRepository;
11+
Feel free to send a pull request to: ` + config.get().pagesRepository;
1212
}
1313
};

test/config.spec.js

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -9,13 +9,13 @@ describe('Config', () => {
99
const DEFAULT =
1010
`
1111
{
12-
"repository": "tldr-pages/tldr"
12+
"repository": "http://tldr-pages.github.io/assets/tldr.zip"
1313
}`;
1414

1515
const CUSTOM =
1616
`
1717
{
18-
"repository": "myfork/tldr"
18+
"repository": "http://myrepo/assets/tldr.zip"
1919
}`;
2020

2121
const CUSTOM_INVALID =
@@ -45,13 +45,13 @@ describe('Config', () => {
4545
it('should load the default config', () => {
4646
fs.readFileSync.onCall(0).returns(DEFAULT);
4747
fs.readFileSync.onCall(1).throws('Not found');
48-
config.get().repository.should.eql('tldr-pages/tldr');
48+
config.get().repository.should.eql('http://tldr-pages.github.io/assets/tldr.zip');
4949
});
5050

5151
it('should override the defaults with content from .tldrrc', () => {
5252
fs.readFileSync.onCall(0).returns(DEFAULT);
5353
fs.readFileSync.onCall(1).returns(CUSTOM);
54-
config.get().repository.should.eql('myfork/tldr');
54+
config.get().repository.should.eql('http://myrepo/assets/tldr.zip');
5555
});
5656

5757
it('should validate the custom config format', () => {

0 commit comments

Comments
 (0)