Example #1
0
    .then(() =>
    {
        // We need to resolve the path to the staging folder to obtain an absolute path to avoid
        // issues in case the user specifies a different working directory in the "files" array
        const stagingResolved = path.resolve(this._packaging.staging);

        if (Array.isArray(this._packaging.files))
        {
            const copies = [];
            for (const file of this._packaging.files)
            {
                if (typeof file === 'string' && file.length > 0)
                {
                    copies.push(cpy(file, stagingResolved));
                }
                else
                {
                    copies.push(cpy(file.source, stagingResolved, file.options));
                }
            }
            return Promise.all(copies);
        }
        else if (typeof this._packaging.files === 'string' && this._packaging.files.length > 0)
        {
            return cpy(this._packaging.files, stagingResolved);
        }
    })
					del(['**'], { cwd: svnTrunkDir }, function( err ) {
						grunt.log.warn( 'Plug-in trunk deleted.' );

						cpy(['**'], svnTrunkDir, { cwd: deployDir }, function( err ) {
							grunt.log.ok( 'Plug-in from deploy -> trunk copied.' );

							if ( grunt.file.isDir( assetsDir ) ) {
								grunt.log.writeln( 'Processing Plug-in assets...' );

								del(['*.{svg,png,jpg,gif}'], { cwd: svnAssetsDir }, function( err ) {
									grunt.log.warn( 'Plug-in assets deleted.' );

									cpy([
										'icon.svg',
										'icon-*.{png,jpg}',
										'banner-*.{png,jpg}',
										'screenshot-*.{png,jpg}'
									], svnAssetsDir, { cwd: assetsDir }, function( err ) {
										grunt.log.ok( 'Plug-in icons, banners and screenshots copied.' );
										svnChange();
									});
								});
							} else {
								svnChange();
							}
						});
					});
 new WebpackOnBuildPlugin(function (stats) {
     cpy(['public/*'], './../' + env.project + '/public/vendor/langman/').then(() => {
         notifier.notify({
             'title': 'Build Done',
             'message': 'Files were copied to public!'
         });
     });
 }),
Example #4
0
beforeAll(() => {
  // copy our mock modules to the node_modules directory
  // so we can test how things work when importing a macro
  // from the node_modules directory.
  return cpy(['**/*.js'], path.join('..', '..', 'node_modules'), {
    parents: true,
    cwd: path.join(projectRoot, 'other', 'mock-modules'),
  })
})
/**
 * @return {Promise<void>}
 */
async function copyAssets() {
  return cpy([
    '*.html',
    'styles/**/*.css',
    'images/**/*',
    'manifest.json',
    '_locales/**', // currently non-functional
  ], distDir, {
    cwd: sourceDir,
    parents: true,
  });
}
								del(['*.{svg,png,jpg,gif}'], { cwd: svnAssetsDir }, function( err ) {
									grunt.log.warn( 'Plug-in assets deleted.' );

									cpy([
										'icon.svg',
										'icon-*.{png,jpg}',
										'banner-*.{png,jpg}',
										'screenshot-*.{png,jpg}'
									], svnAssetsDir, { cwd: assetsDir }, function( err ) {
										grunt.log.ok( 'Plug-in icons, banners and screenshots copied.' );
										svnChange();
									});
								});
Example #7
0
        return Promise.all(data.langs.reduce(function(promises, lang) {
            var folder = path.join(outputFolder, lang);

            return promises.concat(
                fsHelpers.touch(path.join(folder, '.nojekyll')),
                cpy([
                    path.join(__dirname, 'desktop.bundles', 'index', 'index.{css,js}'),
                    path.join(__dirname, 'favicon.ico'),
                    path.join(pathToData, 'favicon.ico')
                ], folder),
                processDocs(data, lang, BEMTREE, BEMHTML),
                processBlocks(data, lang, BEMTREE, BEMHTML)
            );
        }, []))
Example #8
0
function copyAssetsAndServerFiles(cb,distDir){

    cpy(["src/server.js",
         "src/client/**/*",
        "!src/client/**/*.js",
        "!src/client/**/*.ts",
        "!src/**/*.scss"],distDir,{cwd:process.cwd(),parents: true, nodir: true}).then(function(){

        util.finishTask(cb)

    },function(err){

        util.finishTask(cb,err)
    })

}
Example #9
0
          User.findOne({ _id: req.user._id }, (err, user) => {

            if (err) {
              return res.send(500);
            }

            // if we actually uploaded a file
            if (files.pdfFile.size !== 0) {

              // save it locally
              let linkName = (user._id + '_' + user.local.firstName + '_' + user.local.lastName + '.pdf');
              let linkPath = (__dirname + '/../localStorage/pdfs');
              cpy([files.pdfFile.path], linkPath,
                {
                  rename: linkName
                }
              ).then(() => {

                // save the link in the db
                user.local.resumeLink = linkPath + '/' + linkName;
                user.save();

              });
            }

            // save the essential questions
            // user.local.question1 = fields.question1.trim();
            // user.local.question2 = fields.question2.trim();
            // user.local.question3 = fields.question3.trim();

            user.save();

            // bump them back to profile
            res.render('profile/profile.ejs', {
              user: user
            });
          });
/**
 * React Static Boilerplate
 * https://github.com/koistya/react-static-boilerplate
 *
 * Copyright © 2015-2016 Konstantin Tarkus (@koistya)
 *
 * This source code is licensed under the MIT license found in the
 * LICENSE.txt file in the root directory of this source tree.
 */

const cpy = require('cpy');
const task = require('./task');

/**
 * Copies static files such as robots.txt, favicon.ico to the
 * output (build) folder.
 */
module.exports = task('copy', cpy(['static/**/*.*'], 'build'));
del('demo/src/examples/api').then(() => {
  cpy('dist/core/**/*.d.ts', 'demo/src/examples/api/core');
  cpy('dist/components/**/*.d.ts', 'demo/src/examples/api/components');
});
Example #12
0
var copyTemplate = function(name) {
  var src = path.join(__dirname, 'templates', name);
  cpy([src + '/*'], dest, function(err) {
    console.log('Initialized! run "npm install" to install dependencies and then "npm start" to start the app')
  });
};
Example #13
0
tasks.set('copy', () => cpy(['public/**/*.*'], 'build', { parents: true }));
Example #14
0
function _copyTemplateAssetsToTarget (templateDir, targetDir) {
  return cpy(config.assetsTypes, targetDir, {
    cwd: templateDir,
    parents: true
  }).catch(e => coreutils.logger.fail(e.message))
}
Example #15
0
task: () =>
    cpy(['**/*'], path.resolve(target, 'images'), {
        cwd: path.resolve(publicDir, 'images'),
        parents: true,
        nodir: true,
    }),
Example #16
0
 .then(() =>
 {
     // Copy bundle files
     return cpy(['exporter/**/*.*', 'CSInterface*.js'], buildPath, { cwd: 'bundle/', parents: true });
 })