Skip to content

Commit

Permalink
Improve metadata in Info.plist file
Browse files Browse the repository at this point in the history
  • Loading branch information
mishamyrt committed Aug 7, 2023
1 parent 85489d9 commit e3fa1b2
Show file tree
Hide file tree
Showing 8 changed files with 57 additions and 12 deletions.
8 changes: 8 additions & 0 deletions AUTHORS
Original file line number Diff line number Diff line change
@@ -0,0 +1,8 @@
# This is the official list of project authors for copyright purposes.
# This file is distinct from the CONTRIBUTORS.txt file.
# See the latter for an explanation.
#
# Names should be added to this file as:
# Name or Organization <email address>

Mikhael Khrustik ([email protected])
4 changes: 4 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -12,6 +12,10 @@ and this project adheres to [Semantic Versioning][].
* Mechanism for searching for application updates
* `About` menu

## Fixed

* Improved metadata in Info.plist file

## [1.0.0-beta6]

## Changed
Expand Down
8 changes: 7 additions & 1 deletion Makefile
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
VERSION = 1.0.0-beta6
VERSION = 1.0.0-beta7
DIST_PATH = dist
BUILD_PATH = app/build/bin

Expand Down Expand Up @@ -38,8 +38,14 @@ lint-app:
$(call go_lint,app)
cd app/frontend; pnpm run lint

.PHONY: generate
generate:
./utils/update-version.mjs app/wails.json "$(VERSION)"
cd app; wails generate module

.PHONY: build
build:
make generate
cd app; wails build \
-clean \
-platform "$(PLATFORMS)" \
Expand Down
6 changes: 3 additions & 3 deletions app/build/darwin/Info.dev.plist
Original file line number Diff line number Diff line change
Expand Up @@ -4,11 +4,11 @@
<key>CFBundlePackageType</key>
<string>APPL</string>
<key>CFBundleName</key>
<string>{{.Info.ProductName}}</string>
<string>{{.Info.ProductName}}Dev</string>
<key>CFBundleExecutable</key>
<string>{{.Name}}</string>
<key>CFBundleIdentifier</key>
<string>com.wails.{{.Name}}</string>
<string>co.myrt.nuga-dev</string>
<key>CFBundleVersion</key>
<string>{{.Info.ProductVersion}}</string>
<key>CFBundleGetInfoString</key>
Expand All @@ -29,4 +29,4 @@
<true/>
</dict>
</dict>
</plist>
</plist>
4 changes: 2 additions & 2 deletions app/build/darwin/Info.plist
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@
<key>CFBundleExecutable</key>
<string>{{.Name}}</string>
<key>CFBundleIdentifier</key>
<string>com.wails.{{.Name}}</string>
<string>co.myrt.nuga</string>
<key>CFBundleVersion</key>
<string>{{.Info.ProductVersion}}</string>
<key>CFBundleGetInfoString</key>
Expand All @@ -24,4 +24,4 @@
<key>NSHumanReadableCopyright</key>
<string>{{.Info.Copyright}}</string>
</dict>
</plist>
</plist>
7 changes: 6 additions & 1 deletion app/wails.json
Original file line number Diff line number Diff line change
Expand Up @@ -9,5 +9,10 @@
"author": {
"name": "mishamyrt",
"email": "[email protected]"
},
"info": {
"productVersion": "1.0.0-beta7",
"comments": "NuPhy(R) keyboard configurator",
"copyright": "Copyright 2023 The Nuga Project Authors (https://github.com/mishamyrt/Nuga/blob/master/AUTHORS)"
}
}
}
10 changes: 5 additions & 5 deletions utils/format-hex-stream.mjs
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@
import { argv, exit } from 'process'

/**
* @param {string} stream
* @param {string} stream
*/
function getHexPairs(stream) {
const pairs = []
Expand All @@ -21,15 +21,15 @@ function main() {
console.log(result)
}

if (argv.length < 3) {
if (argv.length < 4) {
console.error("Too few arguments")
console.log("Usage: format-hex-stream.mjs <hex_stream>")
console.log("Usage: update-version.mjs <path> <version>")
exit(1)
}

if (argv[2].length % 2 !== 0) {
console.error("Wrong HEX stream")
exit(1)
}
}

main()
main()
22 changes: 22 additions & 0 deletions utils/update-version.mjs
Original file line number Diff line number Diff line change
@@ -0,0 +1,22 @@
#!/usr/bin/env node
// @ts-check
import { readFile, writeFile } from 'fs/promises'
import { argv, exit } from 'process'

if (argv.length < 4) {
console.error("Too few arguments")
console.log("Usage: update-version.mjs <path> <version>")
exit(1)
}

async function main () {
const path = argv[2]
const version = argv[3]
const content = await readFile(path, { encoding: "utf-8" })
const config = JSON.parse(content)

config.info.productVersion = version
await writeFile(path, JSON.stringify(config, null, 2))
}

main()

0 comments on commit e3fa1b2

Please sign in to comment.