зеркало из https://github.com/mozilla/glean.js.git
Merge pull request #343 from Dexterp37/cli_return
Bug 1712048 - Report the correct exit code when failing in the CLI
This commit is contained in:
Коммит
a014595c0f
|
@ -7,6 +7,8 @@
|
|||
[Full changelog](https://github.com/mozilla/glean.js/compare/v0.13.0...v0.14.0)
|
||||
|
||||
* [#313](https://github.com/mozilla/glean.js/pull/313): Send Glean.js version and platform information on X-Telemetry-Agent header instead of User-Agent header.
|
||||
* [#343](https://github.com/mozilla/glean.js/pull/343): BUGFIX: Report the correct failure exit code when the Glean command line tool fails.
|
||||
|
||||
# v0.13.0 (2021-05-18)
|
||||
|
||||
[Full changelog](https://github.com/mozilla/glean.js/compare/v0.12.0...v0.13.0)
|
||||
|
|
|
@ -165,6 +165,7 @@ async function setup(projectRoot: string) {
|
|||
console.log(`Using Glean virtual environment at ${venvRoot}`);
|
||||
} else if (!await createPythonVenv(venvRoot)){
|
||||
console.error(`Failed to create a Glean virtual environment at ${venvRoot}`);
|
||||
process.exit(1);
|
||||
}
|
||||
}
|
||||
|
||||
|
@ -189,33 +190,10 @@ async function runGlean(projectRoot: string, parserArgs: string[]) {
|
|||
|
||||
if (err) {
|
||||
console.error(`${stderr}`);
|
||||
process.exit(1);
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* Runs the command.
|
||||
*
|
||||
* @param args the arguments passed to this process.
|
||||
*/
|
||||
async function run(args: string[]) {
|
||||
if (args.length < 3) {
|
||||
throw new Error("Not enough arguments. Please refer to https://mozilla.github.io/glean_parser/readme.html");
|
||||
}
|
||||
|
||||
const projectRoot = process.cwd();
|
||||
try {
|
||||
await setup(projectRoot);
|
||||
} catch (err) {
|
||||
console.error("Failed to setup the Glean build environment", err);
|
||||
}
|
||||
|
||||
await runGlean(projectRoot, args.slice(2));
|
||||
}
|
||||
|
||||
run(argv).catch(e => {
|
||||
console.error("There was an error running Glean", e);
|
||||
});
|
||||
|
||||
/**
|
||||
* Returns a spinner
|
||||
*
|
||||
|
@ -239,3 +217,30 @@ function stopSpinner(spinner: NodeJS.Timeout) {
|
|||
process.stdout.write(" \r");
|
||||
clearInterval(spinner);
|
||||
}
|
||||
|
||||
/**
|
||||
* Runs the command.
|
||||
*
|
||||
* @param args the arguments passed to this process.
|
||||
*/
|
||||
async function run(args: string[]) {
|
||||
if (args.length < 3) {
|
||||
throw new Error("Not enough arguments. Please refer to https://mozilla.github.io/glean_parser/readme.html");
|
||||
}
|
||||
|
||||
const projectRoot = process.cwd();
|
||||
try {
|
||||
await setup(projectRoot);
|
||||
} catch (err) {
|
||||
console.error("Failed to setup the Glean build environment", err);
|
||||
process.exit(1);
|
||||
}
|
||||
|
||||
await runGlean(projectRoot, args.slice(2));
|
||||
}
|
||||
|
||||
// For discoverability, try to leave this function as the last one on this file.
|
||||
run(argv).catch(e => {
|
||||
console.error("There was an error running Glean", e);
|
||||
process.exit(1);
|
||||
});
|
||||
|
|
|
@ -17,14 +17,14 @@ Running the example requires Python 3.
|
|||
npm link
|
||||
```
|
||||
|
||||
2. Link the `@mozilla/glean` package to this sample web extension. On this `web-extension` folder run:
|
||||
2. Link the `@mozilla/glean` package to this sample web extension. On this `web-extension/javascript` folder run:
|
||||
|
||||
```bash
|
||||
npm install
|
||||
npm link @mozilla/glean
|
||||
```
|
||||
|
||||
3. Build this sample. On this `web-extension` folder run:
|
||||
3. Build this sample. On this `web-extension/javascript` folder run:
|
||||
|
||||
```bash
|
||||
npm run build
|
||||
|
@ -44,6 +44,6 @@ npm run build
|
|||
- **Chromium-based browsers**
|
||||
1. Go to [chrome://extensions](chrome://extensions);
|
||||
2. Click on `Load unpacked`;
|
||||
3. Choose this `web-extension` folder;
|
||||
3. Choose this `web-extension/javascript` folder;
|
||||
4. Click on `background page`;
|
||||
5. Try clicking on the little Glean logo that should have been added to your browsers toolbar.
|
||||
|
|
|
@ -17,14 +17,14 @@ Running the example requires Python 3.
|
|||
npm link
|
||||
```
|
||||
|
||||
2. Link the `@mozilla/glean` package to this sample web extension. On this `web-extension` folder run:
|
||||
2. Link the `@mozilla/glean` package to this sample web extension. In this `web-extension/typescript` folder run:
|
||||
|
||||
```bash
|
||||
npm install
|
||||
npm link @mozilla/glean
|
||||
```
|
||||
|
||||
3. Build this sample. On this `web-extension` folder run:
|
||||
3. Build this sample. On this `web-extension/typescript` folder run:
|
||||
|
||||
```bash
|
||||
npm run build
|
||||
|
@ -44,6 +44,6 @@ npm run build
|
|||
- **Chromium-based browsers**
|
||||
1. Go to [chrome://extensions](chrome://extensions);
|
||||
2. Click on `Load unpacked`;
|
||||
3. Choose this `web-extension` folder;
|
||||
3. Choose this `web-extension/typescript` folder;
|
||||
4. Click on `background page`;
|
||||
5. Try clicking on the little Glean logo that should have been added to your browsers toolbar.
|
||||
|
|
Загрузка…
Ссылка в новой задаче