Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.
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();
}
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(() =>
'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,
gulp.task('createDirs', () => {
fsJ.dir(releaseDir, {empty: true});
fsJ.dir(releaseVersionDir, {empty: true});
fsJ.dir(releaseBuildDir, {empty: true});
});
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`);
};
fh.saveTextFile = function(filePath, value, encoding = 'utf8') {
jetpack.dir(fh.getDirectory(filePath));
fs.writeFileSync(filePath, value, { encoding });
};
createIfNotExists(dir) {
jetpack.dir(dir);
}