Skip to content

Commit

Permalink
convertToSingleHost.js shows usage if no args given (#259)
Browse files Browse the repository at this point in the history
convertToSingleHost.js shows usage if no arguments are given

Co-authored-by: Adam Krantz <adamk@microsoft.com>
Co-authored-by: Darren Miller <millerds@users.noreply.github.com>
Co-authored-by: Rick Kirkham <Rick-Kirkham@users.noreply.github.com>
  • Loading branch information
4 people authored May 13, 2024
1 parent efa6e1f commit baab9b3
Showing 1 changed file with 13 additions and 1 deletion.
14 changes: 13 additions & 1 deletion convertToSingleHost.js
Original file line number Diff line number Diff line change
Expand Up @@ -4,12 +4,24 @@ const fs = require("fs");
const path = require("path");
const util = require("util");
const childProcess = require("child_process");
const hosts = ["excel", "onenote", "outlook", "powerpoint", "project", "word"];

if (process.argv.length <= 2) {
const hostList = hosts.map((host) => `'${host}'`).join(", ");
console.log("SYNTAX: convertToSingleHost.js <host> <manifestType> <projectName> <appId>");
console.log();
console.log(` host (required): Specifies which Office app will host the add-in: ${hostList}`);
console.log(` manifestType: Specify the type of manifest to use: 'xml' or 'json'. Defaults to 'xml'`);
console.log(` projectName: The name of the project (use quotes when there are spaces in the name). Defaults to 'My Office Add-in'`);
console.log(` appId: The id of the project or 'random' to generate one. Defaults to 'random'`);
console.log();
process.exit(1);
}

const host = process.argv[2];
const manifestType = process.argv[3];
const projectName = process.argv[4];
let appId = process.argv[5];
const hosts = ["excel", "onenote", "outlook", "powerpoint", "project", "word"];
const testPackages = [
"@types/mocha",
"@types/node",
Expand Down

0 comments on commit baab9b3

Please sign in to comment.