Sha256: fd6b2a131d1deabca94d4df1c4cf3392f9db50f46d52a7f21339ebba9fd1e78b

Contents?: true

Size: 990 Bytes

Versions: 6

Compression:

Stored size: 990 Bytes

Contents

/* global btoa: true */
/*!
 * Bootstrap Grunt task for generating raw-files.min.js for the Customizer
 * http://getbootstrap.com
 * Copyright 2014 Twitter, Inc.
 * Licensed under MIT (https://github.com/twbs/bootstrap/blob/master/LICENSE)
 */
'use strict';
var btoa = require('btoa');
var fs = require('fs');

function getFiles(type) {
  var files = {};
  fs.readdirSync(type)
    .filter(function (path) {
      return type === 'fonts' ? true : new RegExp('\\.' + type + '$').test(path);
    })
    .forEach(function (path) {
      var fullPath = type + '/' + path;
      files[path] = (type === 'fonts' ? btoa(fs.readFileSync(fullPath)) : fs.readFileSync(fullPath, 'utf8'));
    });
  return 'var __' + type + ' = ' + JSON.stringify(files) + '\n';
}

module.exports = function generateRawFilesJs(banner) {
  if (!banner) {
    banner = '';
  }
  var files = banner + getFiles('js') + getFiles('less') + getFiles('fonts');
  fs.writeFileSync('docs/assets/js/raw-files.min.js', files);
};

Version data entries

6 entries across 6 versions & 2 rubygems

Version Path
kanpachi-0.0.7 lib/kanpachi/doc/template/components/bootstrap/grunt/bs-raw-files-generator.js
local_pac-0.10.2 vendor/assets/components/bootstrap/grunt/bs-raw-files-generator.js
local_pac-0.10.1 vendor/assets/components/bootstrap/grunt/bs-raw-files-generator.js
local_pac-0.10.0 vendor/assets/components/bootstrap/grunt/bs-raw-files-generator.js
local_pac-0.9.0 vendor/assets/components/bootstrap/grunt/bs-raw-files-generator.js
local_pac-0.7.0 vendor/assets/components/bootstrap/grunt/bs-raw-files-generator.js