Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.
.then(function() {
return mkdirp.mkdirpAsync(nov.novemberDir() + 'app/controllers/' + modelFolderName)
})
// Add all the CRUD-actions for the model
var downloadAndInstall = function (log, options, version, cb) {
var path = join(options.directory, version);
var response = { path: path, version: version };
return mkdirp.mkdirpAsync(options.directory).then(function (arg) {
return fs.statAsync(path).then(function () {
return response;
});
})
.catch(function (err) {
if (err.cause && err.cause.code === 'ENOENT') {
return new Promises(function (resolve, reject) {
log('INFO', 'Downloading & Installing ' + version);
var gunzip = zlib.createGunzip();
var url = 'https://download.elasticsearch.org/elasticsearch/elasticsearch/elasticsearch-' + version + '.tar.gz';
var out = tar.Extract({ path: path, strip: 1 });
out.on('close', function () {
resolve(response);
}).on('error', reject);
request.get(url)
.pipe(gunzip)
yield asyncEach(articles, function *(article, jdx) {
let key = `blogs/${blog.handle}/${article.id}/article.json`
yield mkdirp.mkdirpAsync(path.dirname(key))
yield fs.writeFileAsync(key, JSON.stringify(article))
var metafields = yield helpers.shopifyRequestAsync({
method: 'get',
url: `https://${target.api_key}:${target.password}@${target.domain}.myshopify.com/admin/articles/${article.id}/metafields.json`
})
metafields = metafields[1].metafields
yield fs.writeFileAsync(`blogs/${blog.handle}/${article.id}/metafields.json`, JSON.stringify(metafields))
})
Promise.all(_.map(formats, function(format) {
var generateDocs = require(__dirname + '/generators/' + format + '/generator');
var dir = opts.outdir + '/' + format + '/' + specjs.MODULE;
return mkdirp.mkdirpAsync(dir).then(function() {
return fs.writeFileAsync(dir + '/doc.js', generateDocs(specjs));
});
}));
});