bit-bin
Version:
<a href="https://opensource.org/licenses/Apache-2.0"><img alt="apache" src="https://img.shields.io/badge/License-Apache%202.0-blue.svg"></a> <a href="https://github.com/teambit/bit/blob/master/CONTRIBUTING.md"><img alt="prs" src="https://img.shields.io/b
62 lines (45 loc) • 1.4 kB
JavaScript
var _interopRequireDefault = require("@babel/runtime/helpers/interopRequireDefault");
Object.defineProperty(exports, "__esModule", {
value: true
});
exports.CommandNotFound = void 0;
function _defineProperty2() {
const data = _interopRequireDefault(require("@babel/runtime/helpers/defineProperty"));
_defineProperty2 = function () {
return data;
};
return data;
}
function _chalk() {
const data = _interopRequireDefault(require("chalk"));
_chalk = function () {
return data;
};
return data;
}
function _paperError() {
const data = require("./paper-error");
_paperError = function () {
return data;
};
return data;
}
class CommandNotFound extends _paperError().PaperError {
constructor(commandName, suggestion) {
super(`command ${commandName} was not found`);
(0, _defineProperty2().default)(this, "commandName", void 0);
(0, _defineProperty2().default)(this, "suggestion", void 0);
this.commandName = commandName;
this.suggestion = suggestion;
}
report() {
let output = _chalk().default.yellow(`warning: '${_chalk().default.bold(this.commandName)}' is not a valid command.
see 'bit --help' for additional information`);
if (this.suggestion) {
output += `\nDid you mean ${_chalk().default.bold(this.suggestion)}?`;
}
return output;
}
}
exports.CommandNotFound = CommandNotFound;
;