Add check-prettier to GitHub actions

Signed-off-by: Marquis Kurt <software@marquiskurt.net>
This commit is contained in:
Marquis Kurt 2019-10-05 15:08:31 -04:00
parent cbb12c4455
commit 298b7606cb
No known key found for this signature in database
GPG Key ID: 725636D259F5402D
6 changed files with 142 additions and 119 deletions

22
.github/workflows/review-style.yml vendored Normal file
View File

@ -0,0 +1,22 @@
name: Prettier
on: [pull_request]
jobs:
build:
runs-on: ubuntu-latest
steps:
- name: Clone source code
uses: actions/checkout@v1
- name: Install Node
uses: actions/setup-node@v1
with:
node-version: 10.x
- name: Install dependencies and run Prettier
run: |
npm install
npm run check-prettier
env:
CI: true

View File

@ -56,6 +56,7 @@
"build-desktop-darwin-nosign": "npm run create-mac-icon; electron-builder -p 'never' -m dmg -c.mac.identity=null -c.afterSign=\"desktop/donothing.js\"",
"build-desktop-linux": "electron-builder -p 'never' -l deb AppImage snap",
"build-desktop-linux-select": "electron-builder -p 'never' -l ",
"check-prettier": "prettier --check src/**/**.tsx",
"test": "react-scripts test",
"eject": "react-scripts eject"
},

View File

@ -131,11 +131,11 @@ export function createUserDefaults() {
export async function getConfig(): Promise<Config | undefined> {
try {
const resp = await axios.get("config.json");
let config: Config = resp.data;
return config;
return resp.data as Config;
} catch (err) {
console.error(
"Couldn't configure Hyperspace with the config file. Reason: " + err.name
"Couldn't configure Hyperspace with the config file. Reason: " +
err.name
);
}
}