Skip to content

Commit

Permalink
Merge pull request #48 from OskarAhl/oskar/update_render_js
Browse files Browse the repository at this point in the history
oskar/update_render_js
  • Loading branch information
negarn committed May 15, 2019
2 parents 4d7bf3b + acac1f7 commit 394e85c
Showing 1 changed file with 2 additions and 10 deletions.
12 changes: 2 additions & 10 deletions scripts/render.js
Original file line number Diff line number Diff line change
Expand Up @@ -37,7 +37,6 @@ const common = require('./common');
const js_translation = require('./js_translation');
const Gettext = require('./gettext');
const compileManifests = require('./render_manifest').compileManifests;
const build_config = require('../build/config/constants').config;

program
.version('0.2.2')
Expand All @@ -50,10 +49,8 @@ program
.option('-j, --js-translations', 'Update js translation files in src/javascript/_autogenerated/')
.parse(process.argv);

program.section = build_config.section;

const is_translation = (program.translations || program.jsTranslations);
if (is_translation && (program.dev || program.path || program.section)) {
if (is_translation && (program.dev || program.path)) {
outputHelp('-t or -j cannot be used alongside other parameters');
}

Expand Down Expand Up @@ -294,13 +291,8 @@ async function compile(page) {
}

const getFilteredPages = () => {
const section_pages =
program.section === build_config.default_section
? common.pages
: common.pages.filter(p => (p.section) === program.section);

const path_regex = new RegExp(program.path, 'i');
return section_pages.filter(p => path_regex.test(p.save_as));
return common.pages.filter(p => path_regex.test(p.save_as));
};

(async () => {
Expand Down

0 comments on commit 394e85c

Please sign in to comment.