Skip to content

Commit

Permalink
Fixing gruntfile formatting (#2289)
Browse files Browse the repository at this point in the history
  • Loading branch information
benwerd committed Dec 12, 2018
1 parent 2ba636e commit ff60612
Show file tree
Hide file tree
Showing 12 changed files with 202 additions and 203 deletions.
188 changes: 94 additions & 94 deletions Gruntfile.js
@@ -1,109 +1,109 @@
/**
* Gruntfile for Known project.
* Gruntfile for Known project.
*/

module.exports = function (grunt) {
// Project configuration.
grunt.initConfig({
pkg: grunt.file.readJSON('package.json'),
uglify: {
options: {
banner: '/*! <%= pkg.name %> <%= grunt.template.today("yyyy-mm-dd") %> */\n'
},
my_target: {
files: {
'js/default.min.js': 'js/default.js',
'js/embeds.min.js': 'js/embeds.js',
'js/image.min.js': 'js/image.js',
'js/service-worker.min.js': 'js/service-worker.js',
'js/templates/default/shell.min.js': 'js/templates/default/shell.js'
}
}
},
cssmin: {
target: {
files: [{
expand: true,
cwd: 'css/',
src: ['*.css', '!*.min.css'],
dest: 'css/',
ext: '.min.css'
}]
}
},
csslint: {
options: {
quiet: true,
ids: false
},
src: ['css/*.css']
},
jshint: {
// define the files to lint
files: [
'Gruntfile.js',
'js/default.js',
'js/embeds.js',
'js/image.js',
'js/service-worker.js',
'js/templates/default/shell.js'
],
// Project configuration.
grunt.initConfig({
pkg: grunt.file.readJSON('package.json'),
uglify: {
options: {
banner: '/*! <%= pkg.name %> <%= grunt.template.today("yyyy-mm-dd") %> */\n'
},
my_target: {
files: {
'js/default.min.js': 'js/default.js',
'js/embeds.min.js': 'js/embeds.js',
'js/image.min.js': 'js/image.js',
'js/service-worker.min.js': 'js/service-worker.js',
'js/templates/default/shell.min.js': 'js/templates/default/shell.js'
}
}
},
cssmin: {
target: {
files: [{
expand: true,
cwd: 'css/',
src: ['*.css', '!*.min.css'],
dest: 'css/',
ext: '.min.css'
}]
}
},
csslint: {
options: {
quiet: true,
ids: false
},
src: ['css/*.css']
},
jshint: {
// define the files to lint
files: [
'Gruntfile.js',
'js/default.js',
'js/embeds.js',
'js/image.js',
'js/service-worker.js',
'js/templates/default/shell.js'
],

// configure JSHint (documented at http://www.jshint.com/docs/)
options: {
// more options here if you want to override JSHint defaults
globals: {
jQuery: true,
console: true,
module: true,
document: true,
"$": false,
known: false,
wwwroot: true,
base64ToArrayBuffer: true,
// configure JSHint (documented at http://www.jshint.com/docs/)
options: {
// more options here if you want to override JSHint defaults
globals: {
jQuery: true,
console: true,
module: true,
document: true,
"$": false,
known: false,
wwwroot: true,
base64ToArrayBuffer: true,

EXIF: true,
self: true,
EXIF: true,
self: true,

Security: true,
Template: true,
ImageTools: true,
},
node: true,
browser: true,
}
},
watch: {
files: ['<%= jshint.files %>'],
tasks: ['jshint']
}
Security: true,
Template: true,
ImageTools: true,
},
node: true,
browser: true,
}
},
watch: {
files: ['<%= jshint.files %>'],
tasks: ['jshint']
}

});
});

// Load the plugins
grunt.loadNpmTasks('grunt-contrib-uglify');
grunt.loadNpmTasks('grunt-contrib-cssmin');
grunt.loadNpmTasks('grunt-contrib-jshint');
grunt.loadNpmTasks('grunt-contrib-watch');
grunt.loadNpmTasks('grunt-contrib-csslint');
grunt.loadNpmTasks('grunt-contrib-uglify');
grunt.loadNpmTasks('grunt-contrib-cssmin');
grunt.loadNpmTasks('grunt-contrib-jshint');
grunt.loadNpmTasks('grunt-contrib-watch');
grunt.loadNpmTasks('grunt-contrib-csslint');

// Tests
grunt.registerTask('test', ['csslint', 'jshint']);
grunt.registerTask('test', ['csslint', 'jshint']);

// Build language pack
grunt.registerTask('build-lang', '', function(){
const { execSync } = require('child_process');
execSync('touch ./languages/source/known.pot'); // Make sure it exists, if we're going to remove (for broken builds)
execSync('rm ./languages/source/known.pot'); // Remove existing
execSync('find ./Idno -type f -regex ".*\.php" | php ./languages/processfile.php >> ./languages/source/known.pot'); // Build from idno core
execSync('find ./templates -type f -regex ".*\.php" | php ./languages/processfile.php >> ./languages/source/known.pot'); // Build from templates
execSync('echo ./known.php | php ./languages/processfile.php >> ./languages/source/known.pot'); // Build from console
});
grunt.registerTask('build-lang', '', function () {

const {execSync} = require('child_process');

execSync('touch ./languages/source/known.pot'); // Make sure it exists, if we're going to remove (for broken builds)
execSync('rm ./languages/source/known.pot'); // Remove existing

execSync('find ./Idno -type f -regex ".*\.php" | php ./languages/processfile.php >> ./languages/source/known.pot'); // Build from idno core
execSync('find ./templates -type f -regex ".*\.php" | php ./languages/processfile.php >> ./languages/source/known.pot'); // Build from templates
execSync('echo ./known.php | php ./languages/processfile.php >> ./languages/source/known.pot'); // Build from console

});

// Default task(s).
grunt.registerTask('default', ['uglify', 'cssmin']);
};
grunt.registerTask('default', ['uglify', 'cssmin']);
};
38 changes: 19 additions & 19 deletions Themes/Black/Gruntfile.js
Expand Up @@ -3,22 +3,22 @@
*/

module.exports = function (grunt) {
// Project configuration.
grunt.initConfig({
pkg: grunt.file.readJSON('package.json'),
});

// Build language pack (todo: find a cleaner way)
grunt.registerTask('build-lang', '', function(){
const { execSync } = require('child_process');
execSync('touch ./languages/black.pot'); // Make sure it exists, if we're going to remove (for broken builds)
execSync('rm ./languages/black.pot'); // Remove existing
execSync('find . -type f -regex ".*\.php" | php ../../languages/processfile.php >> ./languages/black.pot');
});

};
// Project configuration.
grunt.initConfig({
pkg: grunt.file.readJSON('package.json'),
});


// Build language pack (todo: find a cleaner way)
grunt.registerTask('build-lang', '', function(){

const { execSync } = require('child_process');

execSync('touch ./languages/black.pot'); // Make sure it exists, if we're going to remove (for broken builds)
execSync('rm ./languages/black.pot'); // Remove existing

execSync('find . -type f -regex ".*\.php" | php ../../languages/processfile.php >> ./languages/black.pot');

});

};
36 changes: 18 additions & 18 deletions Themes/Cherwell/Gruntfile.js
Expand Up @@ -4,21 +4,21 @@

module.exports = function (grunt) {
// Project configuration.
grunt.initConfig({
pkg: grunt.file.readJSON('package.json'),
});

// Build language pack (todo: find a cleaner way)
grunt.registerTask('build-lang', '', function(){
const { execSync } = require('child_process');
execSync('touch ./languages/cherwell.pot'); // Make sure it exists, if we're going to remove (for broken builds)
execSync('rm ./languages/cherwell.pot'); // Remove existing
execSync('find . -type f -regex ".*\.php" | php ../../languages/processfile.php >> ./languages/cherwell.pot');
});

};
grunt.initConfig({
pkg: grunt.file.readJSON('package.json'),
});


// Build language pack (todo: find a cleaner way)
grunt.registerTask('build-lang', '', function(){

const { execSync } = require('child_process');

execSync('touch ./languages/cherwell.pot'); // Make sure it exists, if we're going to remove (for broken builds)
execSync('rm ./languages/cherwell.pot'); // Remove existing

execSync('find . -type f -regex ".*\.php" | php ../../languages/processfile.php >> ./languages/cherwell.pot');

});

};
34 changes: 17 additions & 17 deletions Themes/Fauvists/Gruntfile.js
Expand Up @@ -3,22 +3,22 @@
*/

module.exports = function (grunt) {
// Project configuration.
grunt.initConfig({
pkg: grunt.file.readJSON('package.json'),
});
// Project configuration.
grunt.initConfig({
pkg: grunt.file.readJSON('package.json'),
});



// Build language pack (todo: find a cleaner way)
grunt.registerTask('build-lang', '', function(){
const { execSync } = require('child_process');
execSync('touch ./languages/fauvists.pot'); // Make sure it exists, if we're going to remove (for broken builds)
execSync('rm ./languages/fauvists.pot'); // Remove existing
execSync('find . -type f -regex ".*\.php" | php ../../languages/processfile.php >> ./languages/fauvists.pot');
});

};
grunt.registerTask('build-lang', '', function () {

const {execSync} = require('child_process');

execSync('touch ./languages/fauvists.pot'); // Make sure it exists, if we're going to remove (for broken builds)
execSync('rm ./languages/fauvists.pot'); // Remove existing

execSync('find . -type f -regex ".*\.php" | php ../../languages/processfile.php >> ./languages/fauvists.pot');

});

};
34 changes: 17 additions & 17 deletions Themes/Green/Gruntfile.js
Expand Up @@ -3,22 +3,22 @@
*/

module.exports = function (grunt) {
// Project configuration.
grunt.initConfig({
pkg: grunt.file.readJSON('package.json'),
});
// Project configuration.
grunt.initConfig({
pkg: grunt.file.readJSON('package.json'),
});



// Build language pack (todo: find a cleaner way)
grunt.registerTask('build-lang', '', function(){
const { execSync } = require('child_process');
execSync('touch ./languages/green.pot'); // Make sure it exists, if we're going to remove (for broken builds)
execSync('rm ./languages/green.pot'); // Remove existing
execSync('find . -type f -regex ".*\.php" | php ../../languages/processfile.php >> ./languages/green.pot');
});

};
grunt.registerTask('build-lang', '', function () {

const {execSync} = require('child_process');

execSync('touch ./languages/green.pot'); // Make sure it exists, if we're going to remove (for broken builds)
execSync('rm ./languages/green.pot'); // Remove existing

execSync('find . -type f -regex ".*\.php" | php ../../languages/processfile.php >> ./languages/green.pot');

});

};

0 comments on commit ff60612

Please sign in to comment.