Skip to content
This repository has been archived by the owner on Oct 1, 2021. It is now read-only.

Commit

Permalink
feat(parser): support '.user.styl' files
Browse files Browse the repository at this point in the history
  • Loading branch information
VChet committed Nov 14, 2020
1 parent a197043 commit f7dd9aa
Showing 1 changed file with 3 additions and 2 deletions.
5 changes: 3 additions & 2 deletions api/styles.js
Original file line number Diff line number Diff line change
Expand Up @@ -28,11 +28,12 @@ async function retrieveRepositoryData(link) {
axios.get(`https://api.github.com/repos${pathname}`, config),
axios.get(`https://api.github.com/repos${pathname}/contents`, config)
]);
const usercss = contents.data.find(file => file.name.includes("user.css"));
const stylePattern = /\.user\.(css|styl)$/;
const usercss = contents.data.find(file => stylePattern.test(file.name));
if (!usercss) {
return {
status: 400,
error: "Repository does not contain usercss file"
error: "Repository does not contain UserCSS file"
};
}

Expand Down

0 comments on commit f7dd9aa

Please sign in to comment.