UNPKG

office-addin-manifest

Version:
63 lines 2.73 kB
#!/usr/bin/env node "use strict"; // Copyright (c) Microsoft Corporation. All rights reserved. // Licensed under the MIT license. var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) { if (k2 === undefined) k2 = k; var desc = Object.getOwnPropertyDescriptor(m, k); if (!desc || ("get" in desc ? !m.__esModule : desc.writable || desc.configurable)) { desc = { enumerable: true, get: function() { return m[k]; } }; } Object.defineProperty(o, k2, desc); }) : (function(o, m, k, k2) { if (k2 === undefined) k2 = k; o[k2] = m[k]; })); var __setModuleDefault = (this && this.__setModuleDefault) || (Object.create ? (function(o, v) { Object.defineProperty(o, "default", { enumerable: true, value: v }); }) : function(o, v) { o["default"] = v; }); var __importStar = (this && this.__importStar) || function (mod) { if (mod && mod.__esModule) return mod; var result = {}; if (mod != null) for (var k in mod) if (k !== "default" && Object.prototype.hasOwnProperty.call(mod, k)) __createBinding(result, mod, k); __setModuleDefault(result, mod); return result; }; Object.defineProperty(exports, "__esModule", { value: true }); const commander_1 = require("commander"); const office_addin_usage_data_1 = require("office-addin-usage-data"); const commands = __importStar(require("./commands")); /* global process */ const commander = new commander_1.Command(); commander.name("office-addin-manifest"); commander.version(process.env.npm_package_version || "(version not available)"); commander.command("info <manifest-path>").action(commands.info); commander .command("modify <manifest-path>") .option("-g,--guid [guid]", "Change the guid. A random guid is used if one is not provided.") .option("-d, --displayName <name>", "Change the display name.") .action(commands.modify); commander .command("validate <manifest-path>") .option("-p, --production", "Verify the manifest for production environment") .action(commands.validate); commander .command("export") .option("-m, --manifest <manfest-path>", "Specify the location of the manifest file. Default is './manifest.json'") .option("-o, --output <output-path>", "Specify where to save the package. Default is next to the manifest file input") .action(commands.exportManifest); // if the command is not known, display an error commander.on("command:*", function () { (0, office_addin_usage_data_1.logErrorMessage)(`The command syntax is not valid.\n`); process.exitCode = 1; commander.help(); }); if (process.argv.length > 2) { commander.parse(process.argv); } else { commander.help(); } //# sourceMappingURL=cli.js.map