Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.
return new Promise(function(resolve, reject) {
ncp.limit = 16;
fsExtra.removeSync(TARGET_JS_DIR);
ncp(SOURCE_JS_DIR,
TARGET_JS_DIR,
{
filter: function(name) {
// only copy over .js files
const regEx = /\/((\w|-)+)(\.js)?$/;
return regEx.test(name);
}
},
function (error) {
if (error == null) {
resolve({
value: null,
const fs = require("fs");
const ncp = require("ncp");
const { spawn } = require("child_process");
const pkg = require("./package.json");
const platform = process.platform;
const v8Version = process.versions.v8;
const nodeVersion = process.versions.node;
const architecture = process.arch;
ncp.limit = 16;
const msvsVersion = process.env.npm_config_msvsversion || "";
process.stdout.write(`
Compiling...
Platform: ${platform} | ${architecture}
Node: ${nodeVersion}
V8: ${v8Version}
`);
let build = "Release";
// build
// build/release
let buildDir = `./build/`;
function init() {
console.log('copy files...');
ncp.limit = 16;
ncp(
path.resolve(__dirname, '../../blog.yml'),
path.resolve(process.cwd(), './blog.yml'));
ncp(
path.resolve(__dirname, '../../article'),
path.resolve(process.cwd(), './article'));
ncp(
path.resolve(__dirname, '../../views'),
path.resolve(process.cwd(), './views'),
function(err) {
if (err) throw err;
console.log('copy complete!');
console.log('bower install...');
Childprocess.exec('bower install', {
cwd: path.resolve(process.cwd(), './views/template/default/public')},
var fs = require('fs');
var RSVP = require('rsvp');
var ncp = require('ncp');
ncp.limit = 1;
var getBuilder = require('./get-builder');
module.exports = function(outputDir) {
var builder = getBuilder();
builder.build().then(function (hash) {
try {
fs.mkdirSync(outputDir);
} catch (err) {
if (err.code !== 'EEXIST') throw err;
console.error('Error: Directory "' + outputDir + '" already exists. Refusing to overwrite files.');
process.exit(1);
}
var dir = hash.directory;
return RSVP.denodeify(ncp)(dir, outputDir, {
clobber: false
"use strict";
const fs = require('fs-extra');
const ncp = require('ncp');
const path = require('path');
const config = require('./config');
const zipFolder = require('zip-folder');
const execSync = require('child_process').execSync;
const prompt = require('prompt');
const chokidar = require('chokidar');
const ap = require('c2-addon-parser');
ncp.limit = 0;
const dirs = {
HERE: path.join(process.cwd(), '/'),
SOURCE: path.join(process.cwd(), '/source'),
C2ADDON: path.join(process.cwd(), '/source/c2addon'),
C3ADDON: path.join(process.cwd(), '/source/c3addon'),
CAPX: path.join(process.cwd(), '/capx'),
VERSIONS: path.join(process.cwd(), '/versions'),
RELEASES: path.join(process.cwd(), '/releases')
};
const ADDON_NAME = process.cwd().split(path.sep).pop().replace(' ', '_');
const allowedTypes = { PLUGIN: 'plugin', BEHAVIOR: 'behavior' };
const dist = { C2: 'C2', C3: 'C3'};
module.exports = function(from, to, cb) {
console.log(
'Copying',
from.replace(dir, '.'),
'to',
to.replace(dir, '.'),
'...'
);
ncp.limit = 1000000;
ncp(from, to, cb);
};
function(error, stdout, srderr) {
if (error !== null) {
console.error('error:', error);
}
console.log('copy static files..')
ncp.limit = 16;
ncp(
path.resolve(
process.cwd(),
'./views/template', globalConfig.theme, 'public'),
path.resolve(
process.cwd(),
'./_build/public')
);
}
).stdout.pipe(process.stdout);
const fs = require('fs');
const path = require('path');
const mkdirp = require('mkdirp');
const ncp = require('ncp');
const chalk = require('chalk');
ncp.limit = 16;
const helpers = ['gulpfile.js', 'src', 'data', '.editorconfig', '.htmllintrc', '.stylelintrc', '.eslintignore', '.eslintrc.json'];
const destinationPath = './';
const message = (text, error = true) => (text ? console.log(chalk.hex(error ? '#e01258' : '#12e09f')(text)) : false);
const directoryExists = (dirPath) => {
try {
return fs.existsSync(dirPath) && fs.statSync(dirPath).isDirectory();
} catch (err) {
message(err);
return false;
}
};
const fs = require('fs')
const path = require('path')
const mkdirp = require('mkdirp')
const ncp = require('ncp')
const log = require('./log')
ncp.limit = 16
const slash = dirPath => ((dirPath.substr(-1) !== '/') ? `${dirPath}/` : dirPath)
const getCurrentDirectoryBase = () => {
try {
return path.basename(process.cwd())
} catch (err) {
log.message(err)
return false
}
}
const directoryExists = (dirPath) => {
try {
if (!fileExists(dirPath)) {
const copyDirContents = (source, destination) => new Promise((resolve, reject) => {
const ncp = require('ncp');
ncp.limit = 16;
ncp(source, destination, (err) => {
if (err) {
reject(err);
} else {
resolve();
}
});
});