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() {
if (!appWasImported) {
// Update app name if the app is not imported.
return Q.ninvoke(fs, 'readFile', manifestDesktopFilename, { encoding: 'utf-8' }).then(function(manifestDesktopData) {
var manifestDesktop;
try {
// jshint evil:true
manifestDesktop = eval('(' + manifestDesktopData + ')');
// jshint evil:false
} catch (e) {
console.error(e);
return Q.reject('Unable to parse manifest ' + manifestDesktopFilename);
}
manifestDesktop.name = appName || path.basename(destAppDir);
manifest.name = manifestDesktop.name;
Q.ninvoke(fs, 'writeFile', manifestDesktopFilename, JSON.stringify(manifestDesktop, null, 4));
});
}
})
.then(function() {
function () {
// Invoke NPM Cache Add
return Q.ninvoke(npm.commands, 'cache', ['add', (packageName + '@' + packageVersion)]).then(
function (info) {
var packageDir = path.resolve(npm.cache, info.name, info.version, 'package');
var packageTGZ = path.resolve(npm.cache, info.name, info.version, 'package.tgz');
return unpack.unpackTgz(packageTGZ, packageDir);
}
);
}
);
return this.collection().then(function(collection) {
return Q.ninvoke(collection, 'update', selector, object, {})
.then(function(result) {
return object;
});
});
},
function doBlock(sourceBtUser, sinkUid) {
return Q.ninvoke(twitter, 'blocks', 'create', {
user_id: sinkUid,
skip_status: 1
}, sourceBtUser.access_token, sourceBtUser.access_token_secret)
.spread(function(result, response) {
logger.trace('/blocks/create', sourceBtUser, sinkUid,
response.statusCode);
return result;
});
}
.then(function(favourites) {
var issue = _.find(favourites, {
id: filterId
});
if (!issue) {
throw NodeUtil.format('Could not find any filter with id: %s.', filterId);
} else {
return Q.ninvoke(jiraApi, 'requestRef', issue.searchUrl);
}
})
.then(function(issues) {
.then(function() {
return Q.ninvoke(self.repo, 'add', self.repo.path + '/*');
})
.then(function() {
.then(() => {
return Q.ninvoke(fs, 'rename', file.path, absoluteUrl);
})
.then(() => {
return fileTools.mkdirp(generatedAppOutputDir).then(function() {
var w3cManifestInfoCopy = JSON.parse(JSON.stringify(w3cManifestInfo));
return Q.ninvoke(platform, 'create', w3cManifestInfoCopy, generatedAppOutputDir, options, href).then(function () {
log.info('The ' + platform.name + ' app was created successfully!');
})
.catch(function (err) {
return Q.reject(new CustomError('Failed to create the ' + platform.name + ' app.', err));
});
});
});
module.exports.getBoxes = function * (connection) {
logger.debug("Getting boxes")
let boxes = yield Q.ninvoke(connection, "getBoxes")
return boxes
}
.then(function (coll) {
return Q.ninvoke(coll, 'distinct', key, query, options);
})
.then(deferred.resolve)