Skip to content

Commit

Permalink
Support extensions with multiple parts for gitlab (i.e. en.md)
Browse files Browse the repository at this point in the history
  • Loading branch information
Nicolas Martel committed Jul 7, 2018
1 parent e5b8af9 commit bba97b2
Showing 1 changed file with 8 additions and 3 deletions.
11 changes: 8 additions & 3 deletions src/backends/gitlab/implementation.js
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,6 @@ import trimStart from 'lodash/trimStart';
import semaphore from "semaphore";
import AuthenticationPage from "./AuthenticationPage";
import API from "./API";
import { fileExtension } from 'Lib/pathHelper';
import { CURSOR_COMPATIBILITY_SYMBOL } from 'ValueObjects/Cursor';
import { EDITORIAL_WORKFLOW } from "Constants/publishModes";

Expand Down Expand Up @@ -66,7 +65,9 @@ export default class GitLab {
entriesByFolder(collection, extension) {
return this.api.listFiles(collection.get("folder"))
.then(({ files, cursor }) =>
this.fetchFiles(files.filter(file => fileExtension(file.name) === extension))
this.fetchFiles(
files.filter(file => file.name.endsWith('.' + extension))
)
.then(fetchedFiles => {
const returnedFiles = fetchedFiles;
returnedFiles[CURSOR_COMPATIBILITY_SYMBOL] = cursor;
Expand All @@ -77,7 +78,11 @@ export default class GitLab {

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

entriesByFiles(collection) {
Expand Down

0 comments on commit bba97b2

Please sign in to comment.