Skip to content

Commit

Permalink
Save version of app in file for proxy app
Browse files Browse the repository at this point in the history
  • Loading branch information
Jonas Fritzke Emdal committed May 12, 2022
1 parent 964cbea commit 64cdac9
Show file tree
Hide file tree
Showing 3 changed files with 15 additions and 2 deletions.
3 changes: 2 additions & 1 deletion pc-nrfconnect-launcher/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -36,7 +36,8 @@
"dist/",
"src/main/",
"node_modules/",
"resources/"
"resources/",
"package.json"
],
"directories": {
"output": "release"
Expand Down
2 changes: 1 addition & 1 deletion pc-nrfconnect-launcher/resources/bundle/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
"name": "pc-nrfconnect-ble",
"version": "4.0.0",
"description": "A natural first choice for Bluetooth Low Energy development",
"displayName": "Bluetooth Low Energy Standalone",
"displayName": "nRF Connect for Desktop Bluetooth Low Energy Standalone",
"repository": {
"type": "git",
"url": "https://github.com/NordicPlayground/pc-nrfconnect-ble-standalone.git"
Expand Down
12 changes: 12 additions & 0 deletions pc-nrfconnect-launcher/src/main/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -121,4 +121,16 @@ if (electronApp.isPackaged) {
? process.env.APPIMAGE
: process.execPath
).catch(err => console.log(err.message));

// Save version of the app in a file called 'version' for the proxy ble app
const packageJsonRaw = fs.readFileSync(
join(electronApp.getAppPath(), 'package.json'),
{ encoding: 'utf-8' }
);

const { version } = JSON.parse(packageJsonRaw);

createTextFile(join(global.userDataDir, 'version'), version).catch(err =>
console.log(err.message)
);
}

0 comments on commit 64cdac9

Please sign in to comment.