Bugzilla – Attachment 157257 Details for
Bug 35079
Add option to gulp tasks po:update and po:create to control if POT should be built
Home
|
New
|
Browse
|
Search
|
[?]
|
Reports
|
Help
|
New Account
|
Log In
[x]
|
Forgot Password
Login:
[x]
[patch]
Bug 35079: Replace --force-extract by --generate-pot={always,auto,never}
Bug-35079-Replace---force-extract-by---generate-po.patch (text/plain), 2.52 KB, created by
Julian Maurice
on 2023-10-17 15:17:28 UTC
(
hide
)
Description:
Bug 35079: Replace --force-extract by --generate-pot={always,auto,never}
Filename:
MIME Type:
Creator:
Julian Maurice
Created:
2023-10-17 15:17:28 UTC
Size:
2.52 KB
patch
obsolete
>From 06e5ec12f7dac6518498daea78d3247b8dea41c0 Mon Sep 17 00:00:00 2001 >From: Julian Maurice <julian.maurice@biblibre.com> >Date: Tue, 17 Oct 2023 17:13:55 +0200 >Subject: [PATCH] Bug 35079: Replace --force-extract by > --generate-pot={always,auto,never} > >This restores the original behaviour of always building the POT file >in order to not break existing workflows >Option --force-extract is deleted in favor of a new option >--generate-pot that can have 3 values: > >* always: always build the POT file. This is the default value >* auto: build the POT file only if it does not exist >* never: never build the POT file >--- > gulpfile.js | 14 +++++++++++--- > 1 file changed, 11 insertions(+), 3 deletions(-) > >diff --git a/gulpfile.js b/gulpfile.js >index bd23d2310a..dba0598203 100644 >--- a/gulpfile.js >+++ b/gulpfile.js >@@ -19,7 +19,7 @@ const exec = require('gulp-exec'); > const merge = require('merge-stream'); > const through2 = require('through2'); > const Vinyl = require('vinyl'); >-const args = require('minimist')(process.argv.slice(2)); >+const args = require('minimist')(process.argv.slice(2), { default: { 'generate-pot': 'always' } }); > const rename = require('gulp-rename'); > > const STAFF_CSS_BASE = "koha-tmpl/intranet-tmpl/prog/css"; >@@ -262,7 +262,11 @@ function po_create_type (type) { > > // Generate .pot only if it doesn't exist or --force-extract is given > const extract = () => stream.finished(poTasks[type].extract()); >- const p = args['force-extract'] ? extract() : access(pot).catch(extract); >+ const p = >+ args['generate-pot'] === 'always' ? extract() : >+ args['generate-pot'] === 'auto' ? access(pot).catch(extract) : >+ args['generate-pot'] === 'never' ? Promise.resolve(0) : >+ Promise.reject(new Error('Invalid value for option --generate-pot: ' + args['generate-pot'])) > > return p.then(function () { > const languages = getLanguages(); >@@ -299,7 +303,11 @@ function po_update_type (type) { > > // Generate .pot only if it doesn't exist or --force-extract is given > const extract = () => stream.finished(poTasks[type].extract()); >- const p = args['force-extract'] ? extract() : access(pot).catch(extract); >+ const p = >+ args['generate-pot'] === 'always' ? extract() : >+ args['generate-pot'] === 'auto' ? access(pot).catch(extract) : >+ args['generate-pot'] === 'never' ? Promise.resolve(0) : >+ Promise.reject(new Error('Invalid value for option --generate-pot: ' + args['generate-pot'])) > > return p.then(function () { > const languages = getLanguages(); >-- >2.30.2
You cannot view the attachment while viewing its details because your browser does not support IFRAMEs.
View the attachment on a separate page
.
View Attachment As Diff
View Attachment As Raw
Actions:
View
|
Diff
|
Splinter Review
Attachments on
bug 35079
:
157253
|
157257
|
157304
|
157305