Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.
upload += '<<<<<< ENV\n'
}
}
// List git files
var root = path.resolve(args.options.root || query.root || '.')
console.log('==> Building file structure')
try {
upload +=
execSync('git ls-files || hg locate', { cwd: root })
.toString()
.trim() + '\n<<<<<< network\n'
} catch (err) {
// not a git/hg dir, emulating git/hg ignore behavior
upload +=
walk
.sync({ path: root, ignoreFiles: ['.gitignore', '.hgignore'] })
.join('\n')
.trim() + '\n<<<<<< network\n'
}
// Make gcov reports
if ((args.options.disable || '').split(',').indexOf('gcov') === -1) {
try {
console.log('==> Generating gcov reports (skip via --disable=gcov)')
var gcg = args.options['gcov-glob'] || ''
if (gcg) {
if (!isWindows) {
gcg = gcg
.split(' ')
.map(function(p) {
return "-not -path '" + p + "'"
})
"error": "Plugin exists already; use -o to overwrite"
});
}
if (opts.clean) {
cli.debug(`(Cleaning) Removing files inside ${targetFolder}`);
shell.rm("-Rf", path.join(targetFolder, "*"));
}
} else {
shell.mkdir(targetFolder);
}
// the comment below doesn't respect .xdignore (or other ignore files)
// but this is the gist of what we're trying to accomplish
// shell.cp("-R", path.join(sourcePath, "*"), targetFolder)
const files = ignoreWalk.sync({
path: sourcePath,
ignoreFiles: [".gitignore", ".xdignore", ".npmignore"],
includeEmpty: false,
}).filter(filterAlwaysIgnoredFile);
files.forEach(file => {
const srcFile = path.join(sourcePath, file);
const tgtFile = path.join(targetFolder, file);
const tgtDir = path.dirname(tgtFile);
if (!fs.existsSync(tgtDir)) {
mkdirp.sync(tgtDir);
}
shell.cp(srcFile, tgtFile);
});
return Object.assign({}, result, {
async function getFiles(dir) {
const files = walk
.sync({ path: dir, ignoreFiles: ['.hygenignore'] })
.map(f => path.join(dir, f))
return files
}
_getFiles = _asyncToGenerator(function* (dir) {
const files = walk.sync({
path: dir,
ignoreFiles: ['.hygenignore']
}).map(f => path.join(dir, f));
return files;
});
return _getFiles.apply(this, arguments);
return __awaiter(this, void 0, void 0, function* () {
const files = walk
.sync({ path: dir, ignoreFiles: ['.hygenignore'] })
.map(f => path.join(dir, f));
return files;
});
}
const id = metadata.id;
if (!id) {
return Object.assign({}, result, {
"error": "Can't package a plugin without a plugin ID in the manifest"
});
}
result.targetZip = path.join(sourcePath, '..', path.basename(sourcePath) + ".xdx");
const zipfile = new yazl.ZipFile();
zipfile.outputStream.pipe(fs.createWriteStream(result.targetZip)).on("close", function() {
});
const files = ignoreWalk.sync({
path: sourcePath,
ignoreFiles: [".gitignore", ".xdignore", ".npmignore"],
includeEmpty: false,
}).filter(filterAlwaysIgnoredFile);
files.forEach(file => {
zipfile.addFile(path.join(sourcePath, file), file);
});
zipfile.end();
result.ok = `"${metadata.name}"@${metadata.version} [${metadata.id}] packaged successfully at ${result.targetZip}`;
return result;
});