Browse Source

Grunt task to copy to local timeline.knightlab.com repository, if

available.
pull/512/head
Scott Robbin 12 years ago
parent
commit
1a69a7faff
  1. 1
      .gitignore
  2. 53
      Gruntfile.js
  3. 11
      package.json

1
.gitignore vendored

@ -14,3 +14,4 @@ compiled/css/timeline-generator.css
*.tmproject
tmtags
source/gfx/Sprites/
/node_modules

53
Gruntfile.js

@ -0,0 +1,53 @@
'use strict';
// Variables
var path = require('path');
module.exports = function(grunt) {
// Project configuration
grunt.initConfig({
// Configs
pkg: grunt.file.readJSON('package.json'),
timeline: {
compiled: 'compiled',
website: '../timeline.knightlab.com'
},
// Banner for the top of CSS and JS files
// Note: The existing Timeline repo has its own banner, so we'll ignore this for now
banner: '/* <%= pkg.title || pkg.name %> - v<%= pkg.version %> - <%= grunt.template.today("yyyy-mm-dd") %>\n' +
' * <%= pkg.homepage %>\n' +
' * Copyright (c) <%= grunt.template.today("yyyy") %> <%= pkg.author %>;\n' +
' */\n',
// Copy
copy: {
website: {
files: [
// Styles/Themes
{ expand: true, cwd: '<%= timeline.compiled %>/css', src: ['*.css', 'themes/**'], dest: '<%= timeline.website %>/static/css'},
// Scripts
{ expand: true, cwd: '<%= timeline.compiled %>/js', src: ['**/*.js'], dest: '<%= timeline.website %>/static/js'},
// Images
{ expand: true, cwd: '<%= timeline.compiled %>/css', src: ['*.{png,gif,jpg}'], dest: '<%= timeline.website %>/static/img'}
]
}
}
});
// Load all Grunt tasks
require('matchdep').filterDev('grunt-*').forEach(grunt.loadNpmTasks);
// Task aliases
grunt.registerTask('check', 'Check for the timeline.knightlab.com repository', function() {
// Make sure CDN repo exists
if(!grunt.file.exists(grunt.config.get('timeline.website'))) {
grunt.fatal('Could not find local website repository.')
}
});
grunt.registerTask('website', "Copy select files to the timeline.knightlab.com website repository", ['check', 'copy']);
};

11
package.json

@ -0,0 +1,11 @@
{
"name": "TimelineJS",
"version": "2.22.0",
"author": "Zach Wise",
"homepage": "https://github.com/NUKnightLab/TimelineJS",
"devDependencies": {
"grunt": "~0.4.1",
"grunt-contrib-copy": "~0.4.0",
"matchdep": "~0.1.1"
}
}
Loading…
Cancel
Save