How to use the fs-jetpack.dir 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 NREL / OpenStudio-PAT / app / app / project / projectService.js View on Github external
setProject(projectDir) {
    const vm = this;
    if (vm.Message.showDebug()) vm.$log.debug('Project setProject');

    vm.setProjectDir(projectDir);
    if (vm.Message.showDebug()) vm.$log.debug('in set project: projectDir: ', vm.projectDir.path());
    vm.setProjectName(projectDir.path().replace(/^.*[\\\/]/, ''));
    if (vm.Message.showDebug()) vm.$log.debug('project name: ', vm.projectName);

    vm.mongoDir = jetpack.dir(path.resolve(vm.projectDir.path() + '/data/db'));
    vm.logsDir = jetpack.dir(path.resolve(vm.projectDir.path() + '/logs'));
    vm.projectMeasuresDir = jetpack.dir(path.resolve(vm.projectDir.path() + '/measures'));
    vm.seedDir = jetpack.dir(path.resolve(vm.projectDir.path() + '/seeds'));
    vm.weatherDir = jetpack.dir(path.resolve(vm.projectDir.path() + '/weather'));

    // initializeProject will also create the basic folder structure, if it is missing
    vm.initializeProject();

  }
github WilianZilv / angoole / handlers / postbackHandler.js View on Github external
if (fileCount > 1) {
                messenger.send(
                    `A página é muito grande, estou enviando em ${fileCount} partes para você conseguir ler o conteúdo 😎.`
                )
            } else {
                messenger.send('Estou enviando ✌')
            }

            for (const file of files) {
                await messenger
                    .sendFile(file, 'image')
                    .catch(err => console.log(err))
            }
            messenger.send('Prontinho 🙂', true)

            fs.dir(recipientPath).remove()
        })
        .catch(() =>
github cocos-creator / engine / rollup / mappings.config.js View on Github external
'use strict';

const fsJetpack = require('fs-jetpack');
const resolve = require('rollup-plugin-node-resolve');

console.log('rollup mappings...');

let dest = './bin';
let file = 'mappings';
let name = 'mappings';
let sourcemap = true;
let globals = {};

fsJetpack.dir(dest);

module.exports = {
  input: './cocos/3d/misc/offline-mappings.js',
  external: [],
  plugins: [
    resolve({
      jsnext: false,
      main: false,
      root: process.cwd()
    }),
  ],
  output: [
    {
      file: `${dest}/${file}.js`,
      format: 'cjs',
      name,
github ik9999 / searx-term / tasks / release.js View on Github external
gulp.task('createDirs', () => {
  fsJ.dir(releaseDir, {empty: true});
  fsJ.dir(releaseVersionDir, {empty: true});
  fsJ.dir(releaseBuildDir, {empty: true});
});
github z-edit / zedit / src / javascripts / helpers / logger.js View on Github external
this.init = function(name = 'log', path = 'logs') {
        let dateStr = dateFormat(new Date(), 'yyyy_mm_dd_HH_MM'),
            filePath = jetpack.path(`${path}/${name}_${dateStr}.txt`);
        jetpack.dir(path);
        stream = jetpack.createWriteStream(filePath, { flags: 'a+' });
        messages = [];
        logger.log(`${bar}\nSession started at ${new Date()}\n`);
    };
github z-edit / zedit / src / javascripts / helpers / fileHelpers.js View on Github external
fh.saveTextFile = function(filePath, value, encoding = 'utf8') {
    jetpack.dir(fh.getDirectory(filePath));
    fs.writeFileSync(filePath, value, { encoding });
};