diff --git a/developer-notes.md b/developer-notes.md index 565dd474..c479b212 100644 --- a/developer-notes.md +++ b/developer-notes.md @@ -42,3 +42,19 @@ For per-platform build/signing setup, see https://blog.mifi.no/2020/03/31/automa - Release draft at github - Bump [snap version](https://snapcraft.io/losslesscut/listing) - `npm run scan-i18n` to get the newest Englist strings and push so weblate gets them + +## Licenses + +### Generate summary + +``` +npx license-checker --summary +``` + +### Regenerate licenses file + +``` +npm run generate-licenses +#cp licenses.txt mifi.no/public/losslesscut/ +``` +Then deploy. \ No newline at end of file diff --git a/package.json b/package.json index 6a2ad278..84e8c7f6 100644 --- a/package.json +++ b/package.json @@ -25,7 +25,8 @@ "postinstall": "patch-package && electron-builder install-app-deps", "pack-linux": "electron-builder --linux", "prepack-linux": "yarn build", - "scan-i18n": "i18next-scanner --config i18next-scanner.config.js" + "scan-i18n": "i18next-scanner --config i18next-scanner.config.js", + "generate-licenses": "yarn licenses generate-disclaimer > licenses.txt && echo '\n\nffmpeg is licensed under GPL v2+:\n\nhttp://www.gnu.org/licenses/old-licenses/gpl-2.0.html' >> licenses.txt" }, "author": { "name": "Mikael Finstad", diff --git a/public/constants.js b/public/constants.js index 2913dc90..fbc2c81a 100644 --- a/public/constants.js +++ b/public/constants.js @@ -1,9 +1,11 @@ const homepage = 'https://mifi.no/losslesscut/'; const githubLink = 'https://github.com/mifi/lossless-cut/'; const releasesPage = 'https://github.com/mifi/lossless-cut/releases'; +const licensesPage = 'https://mifi.no/losslesscut/licenses.txt'; module.exports = { homepage, releasesPage, githubLink, + licensesPage, }; diff --git a/public/menu.js b/public/menu.js index b99ccb6a..e47c44e2 100644 --- a/public/menu.js +++ b/public/menu.js @@ -4,7 +4,7 @@ const i18n = require('i18next'); const { Menu } = electron; const { dialog } = electron; -const { homepage, releasesPage } = require('./constants'); +const { homepage, releasesPage, licensesPage } = require('./constants'); module.exports = (app, mainWindow, newVersion) => { const menu = [ @@ -273,6 +273,10 @@ module.exports = (app, mainWindow, newVersion) => { mainWindow.webContents.send('openAbout'); }, }, + { + label: i18n.t('Licenses'), + click() { electron.shell.openExternal(licensesPage); }, + }, { label: i18n.t('Learn More'), click() { electron.shell.openExternal(homepage); },