Advertisement
Guest User

Untitled

a guest
Mar 31st, 2015
215
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 1.61 KB | None | 0 0
  1. var globalConfig = {
  2. paths:{
  3. base:'docroot/_diffs',
  4. js:'<%=globalConfig.paths.base %>/js',
  5. css:'<%=globalConfig.paths.base %>/css',
  6. sass:'<%=globalConfig.paths.base %>/sass',
  7. templates:'<%=globalConfig.paths.base %>/templates'
  8. },
  9. urls: {
  10. theme:'/nbn-spark-theme',
  11. css:'<%=urls.theme %>/css',
  12. js:'<%=urls.theme %>/js'
  13. }
  14. };
  15.  
  16.  
  17. // Project configuration.
  18. grunt.initConfig({
  19. pkg: grunt.file.readJSON('package.json'),
  20.  
  21. "file-creator": {
  22. options: {
  23. openFlags: 'w'
  24. },
  25. "write_ie_template": {
  26. 'docroot/_diffs/templates/ie_css.vm':function(fs, fd, done) {
  27. var glob = grunt.file.glob;
  28. var _ = grunt.util._;
  29.  
  30. var dir = '<%= this.globalConfig.paths.css %>/blessed';
  31. grunt.log.writeln('dir: '+ dir);
  32. // OUTPUT dir: <%= this.globalConfig.paths.css %>/blessed
  33.  
  34. glob(dir, function (err, files) {
  35.  
  36. var stylesheets = [];
  37. _.each(files, function(file) {
  38. stylesheets.push(file);
  39. grunt.log.writeln(['found file: '+file]);
  40. });
  41.  
  42. fs.writeSync(fd, '## built '+ grunt.template.today("yyyy-mm-dd") +'n');
  43. _.each(stylesheets, function(file, i) {
  44. grunt.log.writeln('file: '+ file);
  45. var file_url = file.replace('docroot/_diffs/','');
  46. fs.writeSync(fd, '<link rel="stylesheet" type="text/css" href="/nbn-spark-theme/' + file_url + '" />'+'n');
  47. });
  48. done();
  49. });
  50. }
  51. }
  52.  
  53. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement