easy-aos
Version:
帮助配置arm-gcc开发环境,简化命令行。
82 lines (69 loc) • 1.77 kB
JavaScript
;
Object.defineProperty(exports, "__esModule", {
value: true
});
exports.default = void 0;
var _i18n = _interopRequireDefault(require("../../lib/i18n"));
var _platform = _interopRequireDefault(require("../../config/platform/platform"));
function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }
const t = new _i18n.default("config");
const get_choices = function (arrs, top) {
let result = [];
if (top) {
result.push({
title: top
});
}
arrs.forEach(element => {
if (element != top) {
result.push({
title: element
});
}
});
return result;
};
const config = function (workspace) {
return [{
type: "autocomplete",
name: "board",
message: `${t.__("Board")}: (${workspace.board})`,
choices: get_choices(_platform.default.board_list, workspace.board)
}, {
type: "autocomplete",
name: "virtual_env",
message: `${t.__("Env")}: (${workspace.virtual_env})`,
choices: get_choices(["docker", "conda", "python"], workspace.virtual_env)
}];
};
const aos_path = function (aos_path) {
return [{
type: "text",
name: "path",
message: `${t.__("AOS_PATH")}: (${aos_path})`,
initial: `${aos_path}`
}];
};
const app = function (workspace, app_name) {
return [{
type: "text",
name: "app",
message: `${t.__("App")}: (${workspace.app})`,
initial: `${workspace.app || app_name}`
}];
};
const isAosSource = function (workspace) {
return [{
type: "confirm",
name: "isAosSource",
message: `${t.__("isAosSource")}: `,
initial: workspace.isAosSource
}];
};
var _default = {
isAosSource: isAosSource,
app: app,
aos_path: aos_path,
config: config
};
exports.default = _default;