anki-addon-builder
anki-addon-builder copied to clipboard
Building with uncommitted changes on MacOS and Windows
Description
aab build dev
wasn't working for me on MacOS, because the command being executed to get timestamps of uncommitted changes was different. The original code had a link to this StackOverflow post, which conveniently lists the code that needs to be run on Linux, MacOS, and Windows to get timestamps. All this PR does is check for the user's OS, and run the appropriate command. This fixed the command for me on MacOS. I don't have access to a Windows computer, so I haven't tested it on there.
Aside from that simple change, I also had to use a regex to extract the digits in the timestamp out from the entire command output. I'm not sure why this wasn't necessary before, so if this breaks something for someone else, please let me know. From my tests, though, the commands from the StackOverflow post print output in the form M 1618523117 designer/options.ui
, so to convert it to an integer we'd have to pick out the part of the string that was an integer.
Checklist:
Please replace the space inside the brackets with an x and fill out the ellipses if the following items apply:
- [x] I've read and understood the contribution guidelines
- [x] I've tested my changes by building at least one of the add-ons that use aab for Anki 2.1
- [x] I've tested that the packages produced by my modified branch of aab work with the latest version of Anki