Closed emmasab closed 2 months ago
@millerds I can reproduce. If the user gives a name with a space in it, the first word is put into the <DisplayName>
element and the second word into the <Id>
element.
This affects all project types except the manifest-only type.
I never use spaces in my project names, so I don't know how long it's been like this, but I think we'd have seen customer complaints if it had been very long.
I think this is a result of our moving the manifest update from generator-office to the convert script. You and repro this by running "npm run convert-to-single-host excel xml my add-in" in the template repo. The convert script line near the end that set's the cmdLine value needs to include quotes around the argument for the project name.
@millerds I think the damage is done before then. At the top where name and id are consecutive arguments:
const projectName = process.argv[4]; // = "my"
let appId = process.argv[5]; // = "add-in"
I think the generator has to put the display name in quotation marks. Then the line that sets the cmdline value doesn't need to change. If that seems right to you, should this move back to the generator repo?
@Rick-Kirkham Actually . . . I'm thinking now that it needs to be done in both places. They are both doing the same thing . . . that is taking a string argument and plugging it into another string that will be used as a cli command where any unquoted spaces get interpreted as argument separators. The symptoms reported here are based on the generator-office problem, but once that is fixed the project will be generated with a correct GUID, but the name will only be the first word instead of the whole thing.
I'll move this back because of the symptoms reported, but you'll need another issue for the templates for the fix there as well.
Fix is checked into the repo. Need change to taskpane repo in order to be effective. Will publish the generator-office change soon.
Change to conversion script is in 258.
Fix to generator-office has been published. Please update and it should work now.
Expected behavior
Run
yo office
Select the following
The manifest.xml produced contains a randomly generated GUID in the
<id><\id>
tagCurrent behavior
The manifest.xml produced contains
<Id>Add-In</Id>
insteadRunning
npm run validate
confirms the manifest is invalid