mirror of
https://github.com/laurent22/joplin.git
synced 2024-12-24 10:27:10 +02:00
Cross-platform version number retrieval (#2355)
* Add shim to retrieve application version. * Create shim to retrieve app version number. * Add a fall through handler to throw an error.
This commit is contained in:
parent
4ec9492f7c
commit
f78729ad1f
@ -378,6 +378,15 @@ function shimInit() {
|
||||
};
|
||||
|
||||
shim.waitForFrame = () => {};
|
||||
|
||||
shim.appVersion = () => {
|
||||
if (shim.isElectron()) {
|
||||
const p = require('../packageInfo.js');
|
||||
return p.version;
|
||||
}
|
||||
const p = require('../package.json');
|
||||
return p.version;
|
||||
};
|
||||
}
|
||||
|
||||
module.exports = { shimInit };
|
||||
|
@ -144,6 +144,11 @@ function shimInit() {
|
||||
return Platform.OS;
|
||||
};
|
||||
|
||||
shim.appVersion = () => {
|
||||
const p = require('react-native-version-info').default;
|
||||
return p.appVersion;
|
||||
};
|
||||
|
||||
// NOTE: This is a limited version of createResourceFromPath - unlike the Node version, it
|
||||
// only really works with images. It does not resize the image either.
|
||||
shim.createResourceFromPath = async function(filePath, defaultProps = null) {
|
||||
|
@ -197,6 +197,10 @@ shim.waitForFrame = () => {
|
||||
throw new Error('Not implemented');
|
||||
};
|
||||
|
||||
shim.appVersion = () => {
|
||||
throw new Error('Not implemented');
|
||||
};
|
||||
|
||||
shim.injectedJs = name => '';
|
||||
|
||||
let isTestingEnv_ = false;
|
||||
|
Loading…
Reference in New Issue
Block a user