anki-addon-builder icon indicating copy to clipboard operation
anki-addon-builder copied to clipboard

Building with uncommitted changes on MacOS and Windows

Open warrenalphonso opened this issue 3 years ago • 0 comments

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:

warrenalphonso avatar Apr 15 '21 23:04 warrenalphonso