334 Commits

Author SHA1 Message Date
unilock
7207d4c6a4 github: use regexp2 for advanced regex
Signed-off-by: unilock <unilock@fennet.rentals>
2024-04-16 07:04:13 -04:00
unilock
979b606b1e github: check + fail if there are no assets matching regex
Signed-off-by: unilock <unilock@fennet.rentals>
2024-04-15 19:18:05 -04:00
unilock
d54da349d5 github: allow using a regular expression to match assets
safeguard against "undefined behavior" when a release has more than one asset

Signed-off-by: unilock <unilock@fennet.rentals>
2024-04-15 15:30:22 -04:00
unilock
bae4a6be64 github: remove outdated comment
Signed-off-by: unilock <unilock@fennet.rentals>
2024-04-15 15:29:06 -04:00
unilock
72afdee4d8 github: Handle empty x-ratelimit-remaining header
Signed-off-by: unilock <unilock@fennet.rentals>
2024-04-15 14:49:02 -04:00
unilock
3859b37267 github: Notify user when encountering GitHub API ratelimit
Signed-off-by: unilock <unilock@fennet.rentals>
2024-04-15 14:49:02 -04:00
unilock
3f5b953d00 github: Allow specifying branch to retrieve releases for via CLI
Signed-off-by: unilock <unilock@fennet.rentals>
2024-04-15 14:49:02 -04:00
unilock
e5d1d9d383 github: Properly handle writing to pack index
Signed-off-by: unilock <unilock@fennet.rentals>
2024-04-15 14:49:02 -04:00
unilock
d7fd884f48 github: Use Viper for GitHub API token
Signed-off-by: unilock <unilock@fennet.rentals>
2024-04-15 14:49:02 -04:00
unilock
8d4f8d9a86 github: Accept GitHub API token via OS environment variable
"GH_API_TOKEN"

Signed-off-by: unilock <unilock@fennet.rentals>
2024-04-15 14:48:57 -04:00
unilock
c96a6a30ad github: don't return releases on wrong branch
if a branch is specified, but a release cannot be found on that branch, return an error instead of simply the latest release

Signed-off-by: unilock <unilock@fennet.rentals>
2024-04-15 14:48:57 -04:00
unilock
01945213d7 github: standardize language + fix api requests
language:
- funcs, vars, log messages, etc.

api requests:
- make all requests use the makeGet() function
- include packwiz user agent

Signed-off-by: unilock <unilock@fennet.rentals>
2024-04-15 14:48:57 -04:00
unilock
6116393310 github: fixes and improvements
- "file" -> "asset"
- "version" -> "tag" or "release" (where appropriate)
- fix updater.go for upstream changes
- make printed log messages more similar to those of other modules
- move http request function(s) to separate file "request.go"
- remove the concept of a "Mod"; we're using "Repo"s (GitHub repositories) instead
- remove unnecessary fields in structs
- use sha256 instead of sha1 for asset checksums

Signed-off-by: unilock <unilock@fennet.rentals>
2024-04-15 14:48:57 -04:00
Tricked
837b4db760 fix: apply some suggestions 2024-04-15 14:48:57 -04:00
Tricked
faec4f4738 use sha1 instead of sha256 2024-04-15 14:48:57 -04:00
Tricked
5c07741447 feat: add branch support for github mods 2024-04-15 14:48:57 -04:00
Tricked
cb9550f4a6 feat: add support for more url aliases 2024-04-15 14:48:57 -04:00
Tricked
8c97b3e73b fix: use mod.title instead of slug 2024-04-15 14:48:57 -04:00
Tricked
715e9439a1 fix: file hashing 2024-04-15 14:48:57 -04:00
Tricked
07033023af feat: begin github support 2024-04-15 14:48:55 -04:00
comp500
ef049968b1
Fix incorrect usage of slices.Compact (fixes #257) 2023-09-23 21:52:23 +01:00
JaegyuDev
9889b48b0d
Add --side argument to filter list command (#256)
* added list command filter by side

* changed error logging for --side flags

* removed len checks on side flags

* removed comments previous commit made useless
2023-09-16 17:26:10 +01:00
comp500
b451a9b034 Support Quilt in CurseForge pack export (fixes #252) 2023-08-28 12:41:48 +01:00
comp500
66e9e1de78 Tweak list output format, sort by lowercase name 2023-08-26 15:57:13 +01:00
Noah Reinalter
1cd848264d
Optionally show filenames in list output (#248) 2023-08-26 15:54:00 +01:00
comp500
ac6a590f52 Use packwiz User-Agent for url command 2023-08-19 14:05:23 +01:00
comp500
4c23e264b0 Clean up code, filter version numbers for NeoForge as well as Forge
NeoForge doesn't seem to have an update checker JSON yet, so we can't determine
the recommended version
2023-07-30 15:09:18 +01:00
comp500
234f927be9 Support NeoForge as a loader (compatible with Forge mods)
TODO: implement support in migrate command
2023-07-30 14:56:11 +01:00
comp500
38dcc505e5 Add NeoForge to Modrinth version filtering 2023-07-30 14:56:11 +01:00
comp500
9c856e3d54 Fix crash with new CurseForge metadata (added NeoForge) 2023-07-30 14:56:11 +01:00
comp500
39b9c300cc chore: update flake.lock 2023-07-16 22:53:25 +00:00
comp500
2255af72cf Fix branch for CI commit 2023-07-16 23:52:35 +01:00
comp500
aac49a8dec Re-add flake.lock workflow from #130, with only manual dispatch
flake.lock needs to be updated for Go 1.19!
2023-07-16 23:48:47 +01:00
comp500
10535d5e75 chore: update packwiz vendorSha256 2023-07-06 22:51:21 +00:00
comp500
d5b84f2647 Supply Github API token to Nix vendor hash update 2023-07-06 23:50:14 +01:00
comp500
1d979c28bf chore: update packwiz vendorSha256 2023-07-06 03:57:24 +00:00
comp500
beef8c6692 Add prefix to env variable lookup, replace . with _
e.g. $PACKWIZ_INIT_REINIT is equivalent to the -r flag
2023-07-06 04:56:58 +01:00
comp500
99d0af14c4 Fix duplicates in Modrinth dependency lookups 2023-07-02 14:38:10 +01:00
comp500
41465407b2 Fix out of bounds array access in acceptable-versions command 2023-06-27 00:46:26 +01:00
comp500
e8c28ae57e Add hold/unhold aliases, tweak help msg, remove unused param 2023-06-25 01:41:01 +01:00
joeyak
dffdbc9b80
Add pin and unpin commands/updated update command to work with pin & unpin (#234)
* Add pin and unpin commands/updated update command to work with pin & unpin

* Inline cobra functions
2023-06-25 01:38:03 +01:00
comp500
0df199852f Attempt to redownload cached files when errors are found 2023-06-23 19:45:44 +01:00
comp500
dd5520e471 Fix cache errors from files with same length/murmur2 fingerprint 2023-06-23 19:00:35 +01:00
comp500
d018d7e780 Fix download warning print loops 2023-06-23 18:22:02 +01:00
comp500
cbd38b3b73 CF: Treat versions with no loader as equal in loader comparison 2023-05-31 16:08:10 +01:00
comp500
7b380f23df Add support for legacy.curseforge.com URLs 2023-05-31 15:22:00 +01:00
comp500
2b878f5e28 Clean up misleading help message for cf import 2023-05-30 17:49:15 +01:00
comp500
6ab8235086 Change url add command to use sha256 (fixes #156) 2023-05-29 23:24:11 +01:00
comp500
4fb1f1b59d Index fixes and performance improvements (fixes #223, #224)
- Fixed creation of duplicate index entries when importing from CurseForge (fixes #224)
- Automatically remove duplicates in index
- Fixed `packwiz serve` with a custom `--pack-root` argument (fixes #223)
- Fixed `packwiz serve` with a custom index.toml location
- Cleaned up internal serving code, added comments and better errors
- Refactored path handling code
- Improved refreshing/exporting performance
- Factored out duplicated exporting logic
- Replaced GetAllMods calls with cleaner LoadAllMods calls and made the former private
- Improved variable names in update command
- Improved handling of aliassed files
- Changed CheckUpdate to take references to metadata
- Removed the ability to use an absolute path to the index file (that probably didn't work anyway)
- Behaviour change: order of entries in exported files may be random
2023-05-29 23:15:55 +01:00
comp500
d25817273b Fix Modrinth URL version number precedence (oldest-first) 2023-05-21 16:35:26 +01:00