Closed andOlga closed 6 years ago
Thanks, I guess I forgot to push the changes after releasing the last batch.
@ItaloKnox You didn't. It's just that the version number is used on two places in the URL and you only changed one of them. Also it's partially my fault too - we had a report about this for Onikakushi which I fixed but apparently neglected to check the other chapters.
Heh, that's what I get for not paying attention. I'm still trying to implement a better way of handling the links, I'll see if I can get it done this time.
@ItaloKnox Perhaps use something along the lines of set VERSION=v3.0.1
at the top of the script, and then use %VERSION%
inside the URL? That would prevent mistakes like this happening, since it would only need to be changed once.
Yep, exactly what I wanted to suggest. :-)
And there is also the possibility of pulling latest version from GitHub API.
My solution was something like that, @enumag.
curl -s https://api.github.com/repos/07th-mod/onikakushi/releases/latest | grep browser_download_url | cut -d '"' -f 4
This line outputs the link to the last version of the patch and requires no changes when new versions are released. The thing is: the link is generated but not saved, so I don't have a clue on how to actually use the link. I have very little experience with commands like that.
We could also go with the VERSION
thing, much easier and requires no more dependencies for Windows. I'll push these while I try to figure how to make my version work as intended. Thanks, @tlm-2501.
@ItaloKnox Ah, this is interesting! I wasn't familiar with the Github API providing this information. In that case, I may be able to help a little bit.
The following will produce the equivalent output on Windows (assuming PowerShell is installed, which it is by default on all supported Windows versions):
powershell -command "(convertfrom-json (invoke-webrequest https://api.github.com/repos/07th-mod/onikakushi/releases/latest).content).assets.browser_download_url"
You can then pipe the output of this to a file (with >something.txt
), and feed that file to aria2c
using the -i
parameter, instead of specifying the URL directly.
Oh god, I can't believe I forgot we could do that even though I do it all the time. It should also work with my version but yours works out of the box already, so I won't need to update the installers with new dependencies.
Though there is a small issue you might be able to figure out. This happens when I input the .txt file with the link:
@ItaloKnox I honestly have no idea what's happening here. I have tested my approach on my machine (running that powershell command, redirecting the output to file and using it with aria2c -i file.txt
), and it works perfectly. Maybe let powershell itself handle the whole file processing thing, to eliminate the possibility of cmd
doing something weird to text encodings? You'd do it like this:
powershell -command "(convertfrom-json (invoke-webrequest https://api.github.com/repos/07th-mod/onikakushi/releases/latest).content).assets.browser_download_url | set-content file.txt"
If that's not it, then I honestly don't know.
set-content file.txt
seems to work this time. I guess the encoding was broken.
I'll take the full installation to a test drive and see if it works well. Best case scenario we fixed this issue and won't have to deal with it again.
Ok, everything seems to be working perfectly. Thanks a lot, @tlm-2501, you really helped me. Also took this chance to fix some stuff in the code that was broken and I didn't notice.
Thank you!