11/* global require, process, console */
22
3- import fs from "fs" ;
3+ const fs = require ( "fs" ) ;
4+ const path = require ( "path" ) ;
5+ const util = require ( "util" ) ;
6+ const manifest = require ( "office-addin-manifest" ) ;
7+
48const host = process . argv [ 2 ] ;
59const manifestType = process . argv [ 3 ] ;
610const projectName = process . argv [ 4 ] ;
7- const appId = process . argv [ 5 ] ;
11+ let appId = process . argv [ 5 ] ;
812const hosts = [ "excel" , "onenote" , "outlook" , "powerpoint" , "project" , "word" ] ;
9- import path from "path" ;
10- import util from "util" ;
11- import { OfficeAddinManifest } from "office-addin-manifest" ;
1213const testPackages = [
1314 "@types/mocha" ,
1415 "@types/node" ,
@@ -135,7 +136,7 @@ async function deleteSupportFiles() {
135136 await unlinkFileAsync ( "LICENSE" ) ;
136137 await unlinkFileAsync ( "README.md" ) ;
137138 await unlinkFileAsync ( "SECURITY.md" ) ;
138- await unlinkFileAsync ( "./convertToSingleHost.mjs " ) ;
139+ await unlinkFileAsync ( "./convertToSingleHost.js " ) ;
139140 await unlinkFileAsync ( ".npmrc" ) ;
140141 await unlinkFileAsync ( "package-lock.json" ) ;
141142}
@@ -260,6 +261,9 @@ if ((host !== "outlook") || (manifestType !== "json")) {
260261} ;
261262
262263if ( projectName ) {
263- OfficeAddinManifest . modifyManifestFile ( manifestPath , projectName , appId ) ;
264+ if ( ! appId ) {
265+ appId = "random" ;
266+ }
267+ manifest . OfficeAddinManifest . modifyManifestFile ( manifestPath , appId , projectName ) ;
264268}
265269
0 commit comments