You've already forked joplin
							
							
				mirror of
				https://github.com/laurent22/joplin.git
				synced 2025-10-31 00:07:48 +02:00 
			
		
		
		
	Desktop, Cli: Fixed issue when getting version info
This commit is contained in:
		| @@ -59,7 +59,12 @@ try { | ||||
| 	keytar = null; | ||||
| } | ||||
|  | ||||
| shimInit(sharp, keytar); | ||||
| function appVersion() { | ||||
| 	const p = require('./package.json'); | ||||
| 	return p.version; | ||||
| } | ||||
|  | ||||
| shimInit(sharp, keytar, null, appVersion); | ||||
|  | ||||
| const application = app(); | ||||
|  | ||||
|   | ||||
| @@ -87,7 +87,12 @@ try { | ||||
| 	keytar = null; | ||||
| } | ||||
|  | ||||
| shimInit(null, keytar, React); | ||||
| function appVersion() { | ||||
| 	const p = require('./packageInfo.js'); | ||||
| 	return p.version; | ||||
| } | ||||
|  | ||||
| shimInit(null, keytar, React, appVersion); | ||||
|  | ||||
| // Disable drag and drop of links inside application (which would | ||||
| // open it as if the whole app was a browser) | ||||
|   | ||||
| @@ -62,7 +62,7 @@ const gunzipFile = function(source, destination) { | ||||
| 	}); | ||||
| }; | ||||
|  | ||||
| function shimInit(sharp = null, keytar = null, React = null) { | ||||
| function shimInit(sharp = null, keytar = null, React = null, appVersion = null) { | ||||
| 	keytar = (shim.isWindows() || shim.isMac()) && !shim.isPortable() ? keytar : null; | ||||
|  | ||||
| 	shim.fsDriver = () => { | ||||
| @@ -513,12 +513,10 @@ function shimInit(sharp = null, keytar = null, React = null) { | ||||
| 	shim.waitForFrame = () => {}; | ||||
|  | ||||
| 	shim.appVersion = () => { | ||||
| 		if (shim.isElectron()) { | ||||
| 			const p = require('../packageInfo.js'); | ||||
| 			return p.version; | ||||
| 		} | ||||
| 		const p = require('../package.json'); | ||||
| 		return p.version; | ||||
| 		if (appVersion) return appVersion(); | ||||
| 		// Should not happen but don't throw an error because version number is | ||||
| 		// used in error messages. | ||||
| 		return 'unknown-version!'; | ||||
| 	}; | ||||
|  | ||||
| 	shim.pathRelativeToCwd = (path) => { | ||||
|   | ||||
		Reference in New Issue
	
	Block a user