first try of builder

This commit is contained in:
rnsrk 2022-09-06 14:37:18 +02:00
parent f1e8197e4f
commit 99adc9c445
8 changed files with 31 additions and 5 deletions

View file

@ -1,6 +1,6 @@
MIT License
Copyright (c) Alex Devero <deveroalex@gmail.com> (alexdevero.com)
Copyright (c) Robert Nasarek <r.nasarek@gnm.de> (rnsrk.de)
Permission is hereby granted, free of charge, to any person obtaining a copy
of this software and associated documentation files (the "Software"), to deal

View file

@ -19,9 +19,10 @@ let trayMenu = Menu.buildFromTemplate([
}
},
{
label: 'Schließen',
label: 'Beenden',
click: function(){
mainWindow.close()
app.quit()
}
}
])
@ -30,6 +31,9 @@ function createTray() {
tray = new Tray('./resources/files/images/marvin16x16.png');
tray.setToolTip('Marvin')
tray.setContextMenu(trayMenu);
tray.on('click', function() {
tray.popUpContextMenu();
})
}
// Keep a reference for dev mode
@ -198,6 +202,7 @@ function createWindow(dimensions) {
// Don't show until we are ready and loaded
mainWindow.once('ready-to-show', () => {
mainWindow.show()
// Open the DevTools automatically if developing
if (dev) {

BIN
marvin256x256.ico Normal file

Binary file not shown.

After

Width:  |  Height:  |  Size: 200 KiB

View file

@ -33,9 +33,26 @@
"prod": "cross-env NODE_ENV=production webpack --mode production --config webpack.build.config.js && electron --noDevServer .",
"start": "cross-env NODE_ENV=development webpack serve --hot --host 0.0.0.0 --config=./webpack.dev.config.js --mode development",
"build": "cross-env NODE_ENV=production webpack --config webpack.build.config.js --mode production",
"installer": "electron-builder",
"package": "npm run build",
"postpackage": "electron-packager ./ --ignore 'resources/files' --out=./builds --asar --overwrite --platform win32,linux --icon marvin.ico --extra-resource 'resources/files'"
},
"build": {
"appId": "marvin",
"win": {
"target": [
"nsis"
],
"icon": "marvin256x256.ico"
},
"nsis": {
"oneClick": false,
"installerIcon": "marvin.ico",
"uninstallerIcon": "marvin.ico",
"uninstallDisplayName": "Marvin-Uninstaller",
"allowToChangeInstallationDirectory": true
}
},
"dependencies": {
"@emotion/react": "^11.10.0",
"@emotion/styled": "^11.10.0",
@ -61,8 +78,11 @@
"cross-env": "^7.0.3",
"css-loader": "^6.7.1",
"electron": "^20.0.3",
"electron-builder": "^23.3.3",
"electron-devtools-installer": "^3.2.0",
"electron-packager": "^15.5.1",
"electron-squirrel-startup": "^1.0.0",
"electron-winstaller": "^5.0.0",
"file-loader": "^6.2.0",
"html-webpack-plugin": "^5.5.0",
"mini-css-extract-plugin": "^2.6.1",

View file

@ -1,3 +1,3 @@
{
"rootDir": "/home/rbrt/Schreibtisch/marvin"
"rootDir": "C:\\Users\\Robert\\Desktop\\marvin"
}

View file

@ -92,9 +92,10 @@ export async function fillTemplate(log, objectData) {
// Write document to disk.
if (buffer) {
const normCharacterObjectId = replaceSpecialCharacters(objectData.inventarnummer)
const normCharacterTitle = replaceSpecialCharacters(objectData.titel)
const normSpacingTitle = normCharacterTitle.replace(/[^A-Z0-9]+/ig, "_");
const filename = objectData.datum + '_' + normSpacingTitle + '.docx'
const filename = objectData.datum + '_' + normCharacterObjectId + '_' + normSpacingTitle + '.docx'
fs.writeFileSync(path.join(documentPath, filename), buffer)
log = {
...log,

BIN
src/marvin256x256.ico Normal file

Binary file not shown.

After

Width:  |  Height:  |  Size: 200 KiB

View file

@ -1,5 +1,5 @@
// Config
import configImport from '/home/rbrt/WebstormProjects/marvin/resources/files/config/config.json'
import configImport from '/resources/files/config/config.json'
// Components
import {Log} from "../components/Log";