gbammc / Thor

Switch the right application ASAP.
MIT License
1.16k stars 69 forks source link

fix: sort keys before converting to JSON to make ordering consistent #61

Closed pallxk closed 11 months ago

pallxk commented 1 year ago

This change makes the generated JSON file from "Export Shortcuts" consistent.

Before the change, key (appBundleURL, appDisplayName and shortcut) ordering is random, which is annoying when the file is tracked via git.

The change should work for macOS 10.13+ as per doc https://developer.apple.com/documentation/foundation/jsonserialization/writingoptions/2888322-sortedkeys