mirror of
https://github.com/TriliumNext/Notes.git
synced 2025-09-03 14:19:58 +08:00
chore(nx/server): set proper resource dir when run from dist
This commit is contained in:
parent
aa68c705f0
commit
aab545b82e
@ -17,7 +17,7 @@
|
|||||||
"@electron/rebuild": "3.7.2"
|
"@electron/rebuild": "3.7.2"
|
||||||
},
|
},
|
||||||
"scripts": {
|
"scripts": {
|
||||||
"start-prod": "nx build desktop && cross-env TRILIUM_DATA_DIR=data electron dist/main.js",
|
"start-prod": "nx build desktop && cross-env TRILIUM_DATA_DIR=data TRILIUM_RESOURCE_DIR=dist electron dist/main.js",
|
||||||
"rebuild": "electron-rebuild"
|
"rebuild": "electron-rebuild"
|
||||||
},
|
},
|
||||||
"nx": {
|
"nx": {
|
||||||
|
@ -290,6 +290,10 @@ export function envToBoolean(val: string | undefined) {
|
|||||||
* @returns the resource dir.
|
* @returns the resource dir.
|
||||||
*/
|
*/
|
||||||
export function getResourceDir() {
|
export function getResourceDir() {
|
||||||
|
if (process.env.TRILIUM_RESOURCE_DIR) {
|
||||||
|
return process.env.TRILIUM_RESOURCE_DIR;
|
||||||
|
}
|
||||||
|
|
||||||
if (isElectron && !isDev) return process.resourcesPath;
|
if (isElectron && !isDev) return process.resourcesPath;
|
||||||
if (!isDev) {
|
if (!isDev) {
|
||||||
return path.dirname(process.argv[1]);
|
return path.dirname(process.argv[1]);
|
||||||
|
Loading…
x
Reference in New Issue
Block a user