How to use the vinyl-fs.dest function in vinyl-fs

To help you get started, we’ve selected a few vinyl-fs 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 router5 / router5 / scripts / changelog.js View on Github external
function conventionalChangelog(done) {
    clog({
            preset: 'angular',
            // repository: 'https://github.com/router5/router5',
            // append: false
        })
        .pipe(source('CHANGELOG.md'))
        .pipe(fs.dest(path.join(__dirname, '..')));
}
github Tencent / omi / packages / omi-cli / lib / init-o.js View on Github external
console.log(
			chalk.bold.cyan("Omi-Cli") +
				(!isCn
					? " will creating a new omi app in "
					: " 即将创建一个新的应用在 ") +
				dest
		);

		vfs
			.src(["**/*", "!node_modules/**/*"], {
				cwd: tpl,
				cwdbase: true,
				dot: true
			})
			.pipe(template(dest, tpl))
			.pipe(vfs.dest(dest))
			.on("end", function() {
				try {
					info("Rename", "gitignore -> .gitignore");
					renameSync(join(dest, "gitignore"), join(dest, ".gitignore"));
					if (customPrjName) {
						try {
							var appPackage = require(join(dest,"package.json"));
							appPackage.name = projectName;
							fs.writeFile(join(dest,"package.json"), JSON.stringify(appPackage, null, 2), (err) => {
								if (err) return console.log(err);
							})
							process.chdir(customPrjName);
						} catch (err) {
							console.log(error(err));
						}
					}
github Tencent / omi / packages / omi-cli / lib / init.js View on Github external
console.log(
			chalk.bold.cyan("Omi-Cli") +
				(!isCn
					? " will creating a new omi app in "
					: " 即将创建一个新的应用在 ") +
				dest
		);

		vfs
			.src(["**/*", "!node_modules/**/*"], {
				cwd: tpl,
				cwdbase: true,
				dot: true
			})
			.pipe(template(dest, tpl))
			.pipe(vfs.dest(dest))
			.on("end", function() {
				try {
					info("Rename", "gitignore -> .gitignore");
					renameSync(join(dest, "gitignore"), join(dest, ".gitignore"));
					if (customPrjName) {
						try {
							var appPackage = require(join(dest,"package.json"));
							appPackage.name = projectName;
							fs.writeFile(join(dest,"package.json"), JSON.stringify(appPackage, null, 2), (err) => {
								if (err) return console.log(err);
							})
							process.chdir(customPrjName);
						} catch (err) {
							console.log(error(err));
						}
					}
github Tencent / omi / cli / lib / init.js View on Github external
function createApp() {
        console.log();
        console.log(chalk.bold.cyan("Omi-Cli") + (!isCn ? ' will creating a new omi app in ' : ' 即将创建一个新的应用在 ') + dest);

        vfs.src(['**/*', '!mode_modules/**/*'], {cwd: tpl, cwdbase: true, dot: true})
            .pipe(template(dest, tpl))
            .pipe(vfs.dest(dest))
            .on('end', function(){
                try{
                    info('Rename', 'gitignore -> .gitignore');
                    renameSync(join(dest, 'gitignore'), join(dest, '.gitignore'));
                    if(customPrjName) {
                        try{
                            process.chdir(customPrjName);
                        }
                        catch (err) {
                            console.log(error(err));
                        }
                    }
                    info('Install', 'npm will install dependencies');
                    console.log();
                    require('./install')(mirror, done)
                } catch(e){
github LiskHQ / lisk-docs / gulp.d / tasks / format.js View on Github external
module.exports = (files) => () =>
  vfs
    .src(files)
    .pipe(prettier())
    .pipe(vfs.dest((file) => file.base))
github Chimeejs / chimee / packages / chimee / tool / documentation.js View on Github external
.then(output => {
      const dist = file.replace(/^\.\/src/, './docs/html').replace(/\/[^\/]+$/, '');
      streamArray(output).pipe(vfs.dest(dist));
    });
});
github cloudflare / cloudflare-gcp / cli / cmds / setEnv.js View on Github external
setTimeout(function () {
      try {
        vinyl.src(`templates/*.yml`)
          .pipe(replace(patterns))
          .pipe(vinyl.dest(`dist`))
      } catch (e) {
        err(e)
      } finally {
        cb(null, 5)
      }
    }, 1000)
  }
github spmjs / spm / lib / doc.js View on Github external
function copyHtmls() {
  var vfs = require('vinyl-fs');
  var through = require('through2');
  vfs.src(['./**/*.html', '!./_site/**/*.html', '!./spm_modules/**/*.html', '!./node_modules/**/*.html'])
    .pipe(through.obj(function(f, enc, cb) {
      f.contents = new Buffer(require('./utils/deps').replaceDeps(f.contents, f.relative));
      this.push(f);
      cb();
    }))
    .pipe(vfs.dest('./_site/'));
}
github OpenLiberty / openliberty.io / src / main / content / antora_ui / gulp.d / tasks / build.js View on Github external
vfs.src('css/site.css', { ...opts, sourcemaps }).pipe(postcss(postcssPlugins)),
    vfs.src('font/*.{ttf,woff*(2)}', opts),
    vfs
      .src('img/**/*.{jpg,ico,png,svg}', opts)
      .pipe(
        imagemin([
          imagemin.gifsicle(),
          imagemin.jpegtran(),
          imagemin.optipng(),
          imagemin.svgo({ plugins: [{ removeViewBox: false }] }),
        ])
      ),
    vfs.src('helpers/*.js', opts),
    vfs.src('layouts/*.hbs', opts),
    vfs.src('partials/*.hbs', opts)
  ).pipe(vfs.dest(dest, { sourcemaps: sourcemaps && '.' }))
}

vinyl-fs

Vinyl adapter for the file system.

MIT
Latest version published 10 months ago

Package Health Score

85 / 100
Full package analysis