ogit
Version:
A lazy developer's Git CLI made simple. Makes using git on cloud IDEs (i.e. C9) a walk in the park.
42 lines (41 loc) • 1.48 kB
JavaScript
;
Object.defineProperty(exports, "__esModule", { value: true });
const tslib_1 = require("tslib");
const AbstractStashCommand_1 = require("../abstracts/AbstractStashCommand");
const OperationUtils_1 = require("../utils/OperationUtils");
const git_1 = require("../wrapper/git");
class ClearStashCommand extends AbstractStashCommand_1.default {
constructor() {
super(...arguments);
this.shouldCheckForChanges = () => {
return false;
};
}
getPrompts() {
return tslib_1.__awaiter(this, void 0, void 0, function* () {
const verifyingNumber = OperationUtils_1.OperationUtils.getRandomVerificationNumber();
return [
{
message: `Please enter ${verifyingNumber} on the prompt`,
type: 'input',
name: 'verificationConfirmed',
validate(number) {
return number === verifyingNumber;
}
}
];
});
}
performStashOperation() {
return tslib_1.__awaiter(this, void 0, void 0, function* () {
yield git_1.GitFacade.clearStash();
});
}
run() {
return tslib_1.__awaiter(this, void 0, void 0, function* () {
yield this.runHelper();
});
}
}
ClearStashCommand.description = 'Clears all the stashes in the local repos';
exports.ClearStashCommand = ClearStashCommand;