Skip to content

Commit

Permalink
RK-12004 Update appVersion used if remote is empty (#305)
Browse files Browse the repository at this point in the history
* Bump hard-coded appVersion used in case remote is empty

* Try importing The version directly from package json

* Use require package json instead of import from json
  • Loading branch information
Urook authored Apr 11, 2022
1 parent 008ed19 commit fea5681
Show file tree
Hide file tree
Showing 3 changed files with 4 additions and 4 deletions.
2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "explorook",
"version": "1.8.33",
"version": "1.8.34",
"description": "Rookout's site addon to support local files and folders",
"main": "dist/index.js",
"scripts": {
Expand Down
4 changes: 2 additions & 2 deletions src/api.ts
Original file line number Diff line number Diff line change
Expand Up @@ -304,12 +304,12 @@ export const resolvers = {
},
appVersion: async (parent: any): Promise<string> => {
if (process.env.development) {
return require("../package.json").version;
return require("../package.json")?.version;
} else if (remote) {
return remote.app.getVersion();
} else {
// remote should exist. but sometimes it's undefined and breaks tests for some reason, so adding a temp fallback
return "1.8.16";
return require("../package.json")?.version || "1.8.34";
}
},
recentLogs: (parent: any): Log[] => {
Expand Down
2 changes: 1 addition & 1 deletion tsconfig.json
Original file line number Diff line number Diff line change
Expand Up @@ -23,4 +23,4 @@
"include": [
"src/*"
]
}
}

0 comments on commit fea5681

Please sign in to comment.