How to use the fs-jetpack.copy function in fs-jetpack

To help you get started, we’ve selected a few fs-jetpack examples, based on popular ways it is used in public projects.

Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.

github misega / HTML5-Banners / gulpfile.js View on Github external
return tap(function(file) {
            var filename = path.basename(file.relative);

            if (filename === 'index.html') {
                var adScriptLib = file.contents.toString().replace('', getAdScript('lib'));
                file.contents = new Buffer(adScriptLib);
            }

            if (filename === 'script.js') {
                var adScriptInit = file.contents.toString().replace('timeline.init();', getAdScript('init'));
                file.contents = new Buffer(adScriptInit);

                if (platform === 'sizmek') { // move init file into folder
                    fs.copy(supportFiles.cwd() + '/EBLoader.js', path.parse(file.path).dir + '/EBLoader.js', { overwrite: true });
                }
            }
        });
    };
github misega / HTML5-Banners / gulpfile.js View on Github external
bannerList.forEach(function(item) {
        var banner = './review/banners/' + item;
        fs.copy('./banners/' + item, banner);
        // remove unnecessary files/folders within the `assets` folder
        fs.remove(banner + '/assets/css/source.css');
        fs.remove(banner + '/assets/img/keyframes');
        // remove the fonts folder, if empty
        var dirFonts = fs.inspectTree(banner + '/assets/css/fonts/');
        if (!dirFonts.size) { fs.remove(banner + '/assets/css/fonts/'); }
    });
github maidsafe / safe_examples / demo_app / app / backend / create_template_file.js View on Github external
export let createTemplateFile = function(title, content, dirPath, callback) {
  var tempDirName = 'safe_uploader_template';
  dirPath = path.resolve(__dirname, dirPath);
  try {
    var tempDirPath = temp.mkdirSync(tempDirName);
    jetpack.copy(dirPath, tempDirPath, { overwrite: true });
    var htmlFilePath = path.resolve(tempDirPath, 'index.html');
    var templateString = fs.readFileSync(htmlFilePath).toString();
    // var tempFilePath = path.resolve(tempDirPath, 'index.html');
    fs.writeFileSync(htmlFilePath,
      util.format(templateString, title, title, content));
    return callback(null, tempDirPath);
  } catch (e) {
    return callback(e);
  }
};
github ik9999 / searx-term / tasks / release.js View on Github external
gulp.task('release', ['createDirs'], () => {
  fsJ.file(path.join(releaseVersionDir, 'run.sh'), {mode: '775'});
  fsJ.file(path.join(releaseVersionDir, 'setup.sh'), {mode: '775'});
  fsJ.copy(resDir, releaseVersionDir, {overwrite: true});
  fsJ.copy(buildDir, releaseBuildDir, {overwrite: true});
  fsJ.copy(packageJsonPath, packageJsonReleasePath, {overwrite: true});
});
github gaccettola / mortis / client_desktop / source / gulp / build.js View on Github external
function copy_task ( )
{
    jetpack.copy ( 'app/styles',
                   'build/styles' );

    copy_app_to_build ( 'moment' );

    copy_app_to_build ( 'sqlite3' );

    copy_app_to_build ( 'debug-menu' );

    copy_app_to_build ( 'minimatch' );

    copy_app_to_build ( 'mkdirp' );

    copy_app_to_build ( 'bluebird' );

    copy_app_to_build ( 'rimraf' );
github ubergrape / grape-electron / tasks / start.js View on Github external
function copyFile(path) {
        gutil.log(`Copy file ${path.substr(srcDir.path().length)}`);
        const destPath = path.replace(srcDir.path(), destDir.path());
        jetpack.copy(path, destPath, {overwrite: true});
    }
github biati-digital / glightbox / development / package.js View on Github external
async function createFolder() {
    const tmpfolder = path.join(os.tmpdir(), 'glightbox-master');

    await updateIndexVersion(args[0]);
    await updatePackageVersion(args[0]);

    jetpack.copy(folder, tmpfolder, {
        matching: ['!node_modules', '!node_modules/**/*', '!.git', '!.git/**/*', '!.github', '!.github/**/*', '!.vscode', '!.vscode/**/*', '!*.psd', '!.DS_Store']
    });
    notify('Created folder', `Created folder correctly`);

    const zip = await createZip(tmpfolder).catch(error => {
        jetpack.remove(tmpfolder);
    });

    const folderName = path.basename(folder);
    jetpack.remove(tmpfolder);
    jetpack.move(zip, path.join(folder, folderName +'-master.zip'));

    notify('Done', `Packaging process ended correctly`);
}
createFolder();
github NREL / OpenStudio-PAT / tasks / build.js View on Github external
gulp.task('manifest', function () {
  jetpack.copy('manifest.json', path.join(conf.paths.dist, '/manifest.json'), {overwrite: true});
});