Fix build scripts so a failure returns a nonzero exit code

This commit is contained in:
Keavon Chambers 2023-01-02 22:04:13 -08:00
parent de5d02da00
commit 5ca6b3fafa
4 changed files with 35 additions and 23 deletions

View file

@ -1,23 +1,19 @@
{
"name": "graphite-web-frontend",
"description": "Graphite's web app frontend. Planned to be replaced by a native GUI written in Rust in the future.",
"private": true,
"scripts": {
"start": "vue-cli-service serve",
"serve": "vue-cli-service serve || echo 'Graphite project failed to build. Did you remember to `npm install` the dependencies?'",
"build": "vue-cli-service build || echo 'Graphite project failed to build. Did you remember to `npm install` the dependencies?'",
"lint": "vue-cli-service lint || echo 'Graphite project had lint errors or otherwise failed. In the latter case, did you remember to `npm install` the dependencies?'",
"lint-no-fix": "vue-cli-service lint --no-fix || echo 'Graphite project had lint errors or otherwise failed. In the latter case, did you remember to `npm install` the dependencies?'",
"tauri:build": "vue-cli-service tauri:build",
"tauri:serve": "vue-cli-service tauri:serve"
},
"repository": {
"type": "git",
"url": "git+https://github.com/GraphiteEditor/Graphite.git"
},
"description": "Graphite's web app frontend. Planned to be replaced by a native GUI written in Rust in the future.",
"author": "Graphite Authors <contact@graphite.rs>",
"license": "Apache-2.0",
"homepage": "https://graphite.rs",
"scripts": {
"start": "npm run serve",
"serve": "vue-cli-service serve || (npm run print-building-help && exit 1)",
"build": "vue-cli-service build || (npm run print-building-help && exit 1)",
"lint": "vue-cli-service lint || (npm run print-linting-help && exit 1)",
"lint-no-fix": "vue-cli-service lint --no-fix || (npm run print-linting-help && exit 1)",
"tauri:build": "vue-cli-service tauri:build",
"tauri:serve": "vue-cli-service tauri:serve",
"print-building-help": "echo 'Graphite project failed to build. Did you remember to `npm install` the dependencies in `/frontend`?'",
"print-linting-help": "echo 'Graphite project had lint errors, or may have otherwise failed. In the latter case, did you remember to `npm install` the dependencies in `/frontend`?'"
},
"dependencies": {
"@tauri-apps/api": "^1.2.0",
"class-transformer": "^0.5.1",
@ -49,8 +45,14 @@
"vue-loader": "^17.0.1",
"vue-template-compiler": "^2.7.14"
},
"//": "Notes about dependency issues and incompatibilities should be added here when needed.",
"homepage": "https://graphite.rs",
"license": "Apache-2.0",
"optionalDependencies": {
"wasm-pack": "^0.10.3"
},
"//": "Notes about dependency issues and incompatibilities should be added here when needed."
"repository": {
"type": "git",
"url": "git+https://github.com/GraphiteEditor/Graphite.git"
}
}

View file

@ -85,11 +85,17 @@ function formatThirdPartyLicenses(jsLicenses) {
if (rustLicenses === undefined) {
// This is probably caused by cargo about not being installed
console.error(`
Could not run \`cargo about\`, which is required to generate license information.
To install cargo-about on your system, you can run:
cargo install cargo-about
License information is required on production builds. Aborting.`);
console.error(
`
Could not run \`cargo about\`, which is required to generate license information.
To install cargo-about on your system, you can run \`cargo install cargo-about\`.
License information is required on production builds. Aborting.
`
.trim()
.split("\n")
.map((line) => line.trim())
.join("\n")
);
process.exit(1);
}
}