mirror of
https://gh.wpcy.net/https://github.com/wp-cli/scaffold-command.git
synced 2026-05-21 16:41:02 +08:00
53 lines
1.1 KiB
Text
53 lines
1.1 KiB
Text
module.exports = function( grunt ) {
|
|
|
|
'use strict';
|
|
var banner = '/**\n * <%= pkg.homepage %>\n * Copyright (c) <%= grunt.template.today("yyyy") %>\n * This file is generated automatically. Do not edit.\n */\n';
|
|
// Project configuration
|
|
grunt.initConfig( {
|
|
|
|
pkg: grunt.file.readJSON( 'package.json' ),
|
|
|
|
addtextdomain: {
|
|
options: {
|
|
textdomain: '{{textdomain}}',
|
|
},
|
|
target: {
|
|
files: {
|
|
src: [ '*.php', '**/*.php', '!node_modules/**', '!php-tests/**', '!bin/**' ]
|
|
}
|
|
}
|
|
},
|
|
|
|
wp_readme_to_markdown: {
|
|
your_target: {
|
|
files: {
|
|
'README.md': 'readme.txt'
|
|
}
|
|
},
|
|
},
|
|
|
|
makepot: {
|
|
target: {
|
|
options: {
|
|
domainPath: '/languages',
|
|
mainFile: '{{plugin_slug}}.php',
|
|
potFilename: '{{plugin_slug}}.pot',
|
|
potHeaders: {
|
|
poedit: true,
|
|
'x-poedit-keywordslist': true
|
|
},
|
|
type: 'wp-plugin',
|
|
updateTimestamp: true
|
|
}
|
|
}
|
|
},
|
|
} );
|
|
|
|
grunt.loadNpmTasks( 'grunt-wp-i18n' );
|
|
grunt.loadNpmTasks( 'grunt-wp-readme-to-markdown' );
|
|
grunt.registerTask( 'i18n', ['addtextdomain', 'makepot'] );
|
|
grunt.registerTask( 'readme', ['wp_readme_to_markdown'] );
|
|
|
|
grunt.util.linefeed = '\n';
|
|
|
|
};
|