firebase-tools
Version:
Command-Line Interface for Firebase
36 lines (35 loc) • 1.4 kB
JavaScript
;
Object.defineProperty(exports, "__esModule", { value: true });
exports.DEFAULT_RUNTIME = void 0;
exports.promptRuntime = promptRuntime;
exports.promptAutomaticBaseImageUpdates = promptAutomaticBaseImageUpdates;
const prompt_1 = require("../prompt");
const utils_1 = require("../utils");
const apphosting = require("../gcp/apphosting");
exports.DEFAULT_RUNTIME = "nodejs";
async function promptRuntime(projectId, location) {
const choices = [{ name: "Node.js (default)", value: exports.DEFAULT_RUNTIME }];
try {
const supportedRuntimes = await apphosting.listSupportedRuntimes(projectId, location);
for (const r of supportedRuntimes) {
if (r.runtimeId !== exports.DEFAULT_RUNTIME) {
choices.push({ name: r.runtimeId, value: r.runtimeId });
}
}
}
catch (err) {
(0, utils_1.logWarning)("Failed to list supported runtimes. Falling back to hardcoded list.");
choices.push({ name: "nodejs22", value: "nodejs22" });
}
return await (0, prompt_1.select)({
message: "Which runtime do you want to use?",
choices: choices,
default: exports.DEFAULT_RUNTIME,
});
}
async function promptAutomaticBaseImageUpdates() {
return await (0, prompt_1.confirm)({
message: "Would you like to enable Automatic Base Image Updates (ABIU)?",
default: true,
});
}