Skip to content

Commit

Permalink
Support extensions with multiple parts (i.e. en.md)
Browse files Browse the repository at this point in the history
  • Loading branch information
tech4him1 committed Feb 20, 2018
1 parent f294d39 commit f6293b0
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 4 deletions.
3 changes: 1 addition & 2 deletions src/backends/github/implementation.js
Original file line number Diff line number Diff line change
@@ -1,6 +1,5 @@
import trimStart from 'lodash/trimStart';
import semaphore from "semaphore";
import { fileExtension } from 'Lib/pathHelper'
import AuthenticationPage from "./AuthenticationPage";
import API from "./API";

Expand Down Expand Up @@ -53,7 +52,7 @@ export default class GitHub {

entriesByFolder(collection, extension) {
return this.api.listFiles(collection.get("folder"))
.then(files => files.filter(file => fileExtension(file.name) === extension))
.then(files => files.filter(file => file.name.endsWith('.' + extension)))
.then(this.fetchFiles);
}

Expand Down
3 changes: 1 addition & 2 deletions src/backends/test-repo/implementation.js
Original file line number Diff line number Diff line change
@@ -1,6 +1,5 @@
import { remove, attempt, isError } from 'lodash';
import uuid from 'uuid/v4';
import { fileExtension } from 'Lib/pathHelper'
import AuthenticationPage from './AuthenticationPage';

window.repoFiles = window.repoFiles || {};
Expand Down Expand Up @@ -45,7 +44,7 @@ export default class TestRepo {
const folder = collection.get('folder');
if (folder) {
for (const path in window.repoFiles[folder]) {
if (fileExtension(path) !== extension) {
if (!path.endsWith('.' + extension)) {
continue;
}

Expand Down

0 comments on commit f6293b0

Please sign in to comment.