Skip to content
This repository has been archived by the owner on Apr 10, 2020. It is now read-only.

Commit

Permalink
Merge pull request #6 from OfficeDev/dev
Browse files Browse the repository at this point in the history
Update supported products
  • Loading branch information
beth-panx authored Apr 5, 2017
2 parents cbada4b + cb87605 commit 051b6c2
Show file tree
Hide file tree
Showing 4 changed files with 10 additions and 8 deletions.
2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "office-addin-validator",
"version": "1.0.0",
"version": "1.0.1",
"description": "Tool to help validate Microsoft Office Add-in manifest files.",
"repository": {
"type": "git",
Expand Down
1 change: 1 addition & 0 deletions readme.md
Original file line number Diff line number Diff line change
Expand Up @@ -30,6 +30,7 @@ npm install -g office-addin-validator
```bash
$ validate-office-addin your_manifest.xml
```
![](src/docs/valid.gif)
> **Note:** At this time, we only support validation on manifest files that lives on your local drive.
Copyright (c) 2017 Microsoft Corporation. All rights reserved.
Binary file added src/docs/valid.gif
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
15 changes: 8 additions & 7 deletions src/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -31,13 +31,14 @@ commander
if (fs.existsSync(manifest)) {
// progress bar start
status.start({
pattern: ' {uptime.green} {spinner.dots.green} Calling validation service...'
pattern: ' {uptime.green} {spinner.green} Calling validation service...'
});
let response = await callOmexService(manifest, options);
if (response.statusCode === 200) {
let formattedBody = JSON.parse(response.body.trim());
let validationReport = formattedBody.checkReport.validationReport;
let validationResult = validationReport.result;
insight.trackEvent('Validation Results', { result: validationResult });

console.log('-------------------------------------');
switch (validationResult) {
Expand All @@ -57,27 +58,26 @@ commander
break;
}
console.log('-------------------------------------');
insight.trackEvent('Validation Results', { result: validationResult });
} else {
console.log('Unexpected program error.');
process.exitCode = 1;
insight.trackException(new Error('Unexpected program error.'));
}
} else {
console.log('Error: Please provide a valid local manifest file path.');
insight.trackException(new Error('Manifest file path is not valid.'));
// exit node process when file does not exit
// update node process exit code when file does not exit
process.exitCode = 1;
}
} catch (err) {
let statusCode = err['statusCode'];
logError(statusCode);
insight.trackException(new Error('Service Error. Error Code: ' + statusCode));
// exit node process when error is thrown
// update node process exit code when error is thrown
process.exitCode = 1;
} finally {
// stop progress bar
status.stop();
process.exit();
}
}).parse(process.argv);

Expand Down Expand Up @@ -133,11 +133,12 @@ function logSupportedProduct(obj) {
let product = [];
getProduct(obj, product);
let unique = [...new Set(product)];
console.log(`These Office applications will accept your add-in manifest:`);
console.log(`Based on the requirements specified in your manifest, your add-in can run on the following platforms; your add-in will be tested on these platforms when you submit it to the Office Store:`);
for (let i of unique) {
console.log(' - ' + i);
}
console.log(`Based on the features and requirement sets implemented by your add-in, use the Add-in Availability Page (https://dev.office.com/add-in-availability) to determine which platforms to test your add-in against.`);
console.log(`Important: This analysis is based on the requirements specified in your manifest and does not account for any runtime JavaScript calls within your add-in. For information about which API sets and features are supported on each platform, see Office Add-in host and platform availability. (https://dev.office.com/add-in-availability).\n`);
console.log(`*This does not include mobile apps. You can opt-in to support mobile apps when you submit your add-in.`);
}
}

Expand Down

0 comments on commit 051b6c2

Please sign in to comment.