mavensmate
Version:
Core APIs that drive MavensMate IDEs for Salesforce1/Force.com
48 lines (42 loc) • 1.2 kB
JavaScript
/**
* @file Lists checkpoints for a given file
* @author Joseph Ferraro <@joeferraro>
*/
;
var Promise = require('bluebird');
var inherits = require('inherits');
var BaseCommand = require('../../command');
var CheckpointService = require('../../services/checkpoint');
function Command() {
Command.super_.call(this, Array.prototype.slice.call(arguments, 0));
}
inherits(Command, BaseCommand);
Command.prototype.execute = function() {
var self = this;
return new Promise(function(resolve, reject) {
var project = self.getProject();
var checkpointService = new CheckpointService(project);
checkpointService.listCheckpoints(self.payload.path)
.then(function(res) {
resolve(res);
})
.catch(function(error) {
reject(error);
})
.done();
});
};
exports.command = Command;
exports.addSubCommand = function(program) {
program
.command('new-checkpoint [filePath]')
.description('List Apex checkpoints for filepath')
.action(function(filePath){
program.commandExecutor.execute({
name: this._name,
body: {
path: filePath
}
});
});
};