UNPKG

convex

Version:

Client for the Convex Cloud

53 lines (52 loc) 2.21 kB
"use strict"; var __create = Object.create; var __defProp = Object.defineProperty; var __getOwnPropDesc = Object.getOwnPropertyDescriptor; var __getOwnPropNames = Object.getOwnPropertyNames; var __getProtoOf = Object.getPrototypeOf; var __hasOwnProp = Object.prototype.hasOwnProperty; var __export = (target, all) => { for (var name in all) __defProp(target, name, { get: all[name], enumerable: true }); }; var __copyProps = (to, from, except, desc) => { if (from && typeof from === "object" || typeof from === "function") { for (let key of __getOwnPropNames(from)) if (!__hasOwnProp.call(to, key) && key !== except) __defProp(to, key, { get: () => from[key], enumerable: !(desc = __getOwnPropDesc(from, key)) || desc.enumerable }); } return to; }; var __toESM = (mod, isNodeMode, target) => (target = mod != null ? __create(__getProtoOf(mod)) : {}, __copyProps( isNodeMode || !mod || !mod.__esModule ? __defProp(target, "default", { value: mod, enumerable: true }) : target, mod )); var __toCommonJS = (mod) => __copyProps(__defProp({}, "__esModule", { value: true }), mod); var init_exports = {}; __export(init_exports, { init: () => init }); module.exports = __toCommonJS(init_exports); var import_commander = require("commander"); var import_login = require("./lib/login.js"); var import_path = __toESM(require("path")); var import_commander2 = require("commander"); var import_context = require("./lib/context.js"); var import_init = require("./lib/init.js"); const cwd = import_path.default.basename(process.cwd()); const init = new import_commander.Command("init").description("Initialize a new Convex project in the current directory").option( "--project <name>", `Name of the project to create. Defaults to \`${cwd}\` (the current directory)` ).addOption( new import_commander2.Option( "--team <slug>", "Slug identifier for the team this project will belong to." ) ).action(async (options) => { const ctx = import_context.oneoffContext; if (!await (0, import_login.checkAuthorization)(ctx)) { await (0, import_login.performLogin)(ctx); } await (0, import_init.init)(ctx, options.project, options.team); }); //# sourceMappingURL=init.js.map