connector-wordpress/gulpfile.cjs

50 lines
1.4 KiB
JavaScript
Raw Normal View History

2021-12-09 19:46:19 +01:00
/* eslint-disable no-undef */
const { dest, src } = require('gulp')
2021-01-08 14:08:40 +01:00
2021-12-09 19:46:19 +01:00
const replace = require('gulp-replace')
2021-01-08 14:08:40 +01:00
2021-12-09 19:46:19 +01:00
const PACKAGE = require('./package.json')
2021-01-08 14:08:40 +01:00
2021-12-09 19:46:19 +01:00
const FOLDER_BUILD = './build'
2021-01-08 14:08:40 +01:00
function injectMetadata() {
2021-12-09 19:46:19 +01:00
return src(
[
2021-12-14 17:54:47 +01:00
FOLDER_BUILD + '/front/block-events-loader.js',
2021-12-14 17:51:13 +01:00
FOLDER_BUILD + '/' + PACKAGE.name + '.php',
2024-04-05 23:26:11 +02:00
FOLDER_BUILD + '/includes/Constants.php',
2021-12-14 17:51:13 +01:00
FOLDER_BUILD + '/readme.txt',
2021-12-09 19:46:19 +01:00
],
2023-11-11 20:28:16 +01:00
{ base: './' },
2021-12-09 19:46:19 +01:00
)
2021-01-08 14:08:40 +01:00
.pipe(replace('<wordpress-author-name>', PACKAGE.author.name))
.pipe(replace('<wordpress-author-url>', PACKAGE.author.url))
.pipe(replace('<wordpress-description>', PACKAGE.description))
2021-03-28 22:28:32 +02:00
.pipe(replace('<wordpress-donation-link>', PACKAGE.funding.url))
2021-01-08 14:08:40 +01:00
.pipe(replace('<wordpress-license>', PACKAGE.license))
2021-12-09 19:46:19 +01:00
.pipe(
replace(
'<wordpress-minimum-version>',
2023-11-11 20:28:16 +01:00
PACKAGE.additionalDetails.wordpressMinimumVersion,
),
2021-12-09 19:46:19 +01:00
)
2021-01-08 14:08:40 +01:00
.pipe(replace('<wordpress-name>', PACKAGE.name))
.pipe(replace('<wordpress-nice-name>', PACKAGE.additionalDetails.niceName))
2021-12-09 19:46:19 +01:00
.pipe(
replace(
'<wordpress-php-minimum-version>',
2023-11-11 20:28:16 +01:00
PACKAGE.additionalDetails.phpMinimumVersion,
),
2021-12-09 19:46:19 +01:00
)
.pipe(
replace(
'<wordpress-tested-up-to-version>',
2023-11-11 20:28:16 +01:00
PACKAGE.additionalDetails.wordpressTestedUpToVersion,
),
2021-12-09 19:46:19 +01:00
)
2021-01-08 14:08:40 +01:00
.pipe(replace('<wordpress-version>', PACKAGE.version))
2021-12-09 19:46:19 +01:00
.pipe(dest('.'))
2021-01-08 14:08:40 +01:00
}
2021-12-09 19:46:19 +01:00
exports.inject = injectMetadata