101 Commits

Author SHA1 Message Date
comp500
dd5520e471 Fix cache errors from files with same length/murmur2 fingerprint 2023-06-23 19:00:35 +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
Matt Artist
539be71d11
Add migrate command (#207)
* Add base and loader command

* Support updating to latest

* Support explicit fabric versions

* Support explicit Forge version

* Support quilt

* Add support for updating Minecraft

* Add support for Forge recommended

* Fix Forge version sorting

* Various fixes

* Add documentation to the use

* More suggestions
2023-04-13 02:23:37 +01:00
comp500
9bddd21d32 Prevent the pack root directory from being packwizignored 2023-03-25 13:37:25 +00:00
comp500
9fc9ee5e09 Fix O(n^2) path lookup using a binary search 2023-03-24 02:37:45 +00:00
comp500
d79556259b Improve directory traversal performance 2023-03-24 02:18:13 +00:00
comp500
fa5460a187 Normalise paths to ensure they are compared properly 2023-03-24 01:31:10 +00:00
comp500
37cc68a9f7 Significantly improve refreshing performance
Looping through every file on every file update *and* cleaning + fromslash is sloww with many files
(ideally, we'd have a map to look up the file, but this is already significantly faster)
2023-03-24 01:00:05 +00:00
Matt Artist
1786e47806
fix: convert download hashes to lower before compare (#199) 2023-03-11 18:21:21 +00:00
comp500
aeae76a569 Linter fixes (error handling, unused constants, raw strings) 2023-03-10 17:06:48 +00:00
comp500
42d8370d0c Latest version fixes: correctly order preferences (fixes #198)
Both CurseForge and Modrinth preferences were not being done in a specific order - so
a file with a newer Minecraft version would not necessarily take priority over a file
with a more preferred loader (e.g. Quilt over Fabric) or a file with a newer release
date / CurseForge ID.
Also fixed a loop variable reference in the CurseForge loop, which caused eagerly resolved
(included in API response) file info to be inconsistent with the chosen version, and
added filtering for duplicate values in the acceptable-game-versions/primary version list
to ensure game versions are always compared properly (so the same index == same version).
2023-03-10 16:35:34 +00:00
comp500
d38d279d98 Prefer game versions according to acceptable versions list (fixes #181)
The acceptable versions list should now be specified in order of preference, where the last version is the most preferable Minecraft version
2023-02-14 16:10:06 +00:00
comp500
074e68f9b0 Exclude .DS_Store folder in default packwizignore 2023-02-12 22:27:50 +00:00
comp500
672d22d0dd Fix deprecated uses of ioutil 2023-01-20 18:43:46 +00:00
comp500
79d3ed3957 Reword "mod"/"addon"/"install" to clearer terms across all commands (fixes #138) 2023-01-20 18:39:23 +00:00
comp500
6160c2ac01 Use FlexVer to get largest loader version (fixes Forge default version in init) 2022-11-19 20:25:38 +00:00
comp500
4f6528dcb5 Fix Modrinth exports of external files with omitted side field 2022-10-30 04:52:09 +00:00
Tricked
c7c2ca786b
feat: add command for arbitrary URLs (#137)
* feat: install command for direct downloads

* use sha1 instead of sha256

* apply suggestions

* feat: parse urls instead of using hasprefix

* stop by default and add force flag

* Implement various fixes and improvements

Co-authored-by: Tricked <72335827+SkyBlockDev@users.noreply.github.com>
Co-authored-by: comp500 <comp500@users.noreply.github.com>
2022-08-27 00:08:25 +01:00
comp500
044c34e07c Move to go-modrinth lib (v2 API) and always supply UA in HTTP requests 2022-08-02 02:53:31 +01:00
comp500
1ed323e6c6 Fix HTTP link in liteloader maven listing 2022-07-19 03:17:54 +01:00
comp500
0d8c1762a3 Handle uppercase hashes properly (case-fold compare or normalise to lowercase) 2022-06-20 16:59:06 +01:00
Morgane Austreelis
d051932bbb
Add --cache flag to export commands (#133)
This option allow overriding the cache directory

An 'cache.directory' entry has also been added in the config
2022-06-09 00:36:24 +01:00
comp500
f533e677ca Merge duplicate getLoaders methods into single core method 2022-06-08 22:34:50 +01:00
comp500
72fbc68256 Omit mode when empty (equivalent to mode "url") 2022-06-07 03:23:41 +01:00
comp500
bf2f060efc Fix lookup of old .toml files 2022-05-21 14:29:59 +01:00
comp500
fc3b5ff8ea Bump current pack format version number and auto-migrate loaded packs 2022-05-21 05:05:08 +01:00
comp500
dae133b73c Completed download implementation for Modrinth export 2022-05-21 05:00:21 +01:00
comp500
f3837af145 Completed download implementation for CF export
Added support for importing manual files and rehashing where necessary
Moved cache folder to "local" user folder
Cleaned up messages, saved index after importing
2022-05-21 03:40:00 +01:00
comp500
55f0e4a297 WIP: misc fixes, start updating CF/MR export to use download system 2022-05-20 18:13:43 +01:00
comp500
e73fa8c48a Continued work on download system (cache + cf meta now implemented) 2022-05-18 22:11:28 +01:00
comp500
30bc6d81bb WIP caching system for Modrinth/CurseForge pack export 2022-05-18 16:02:40 +01:00
comp500
3a6109c1f9 Merge branch 'master' into wip/new-curseforge-api 2022-05-17 01:07:04 +01:00
comp500
0f3096e251 Use the correct directories for non-mod files; use .pw.toml extension
The mods-folder option is now replaced with two new options: meta-folder and meta-folder-base
This allows non-mod files to use the correct directory based on their category; with correct
import of resource packs/etc from CurseForge packs, and the ability to override this behaviour.
To improve the reliability of packwiz metadata file marking (in the index), new files now use .pw.toml
as the extension - any extension can be used, but .pw.toml will now be automatically be
marked as a metafile regardless of folder, so you can easily move metadata files around.
Existing metadata files will still work (as metafile = true is set in the index); though in
the future .pw.toml may be required.
2022-05-16 21:06:10 +01:00
comp500
2073e4475e Support Modrinth modpack fileSize field and sha512 hash 2022-05-16 01:15:12 +01:00
comp500
5a48ddeb66 Create local store functions 2022-05-14 19:38:32 +01:00
comp500
f1eb34d444 Quilt support 2022-04-20 20:58:49 +01:00
comp500
3fb350f244 Pass through optional-disabled on CF import (fixes #93) 2022-03-07 18:22:29 +00:00
comp500
07c0af7bcb Add packwiz binaries to default ignores (fixes #37) 2022-02-14 20:09:55 +00:00
comp500
f1716faa72 Fix URL re-encoding for square brackets 2022-02-14 18:47:03 +00:00
comp500
36b6d806c8 Re-encode URLs from CF and when exporting to MR for RFC3986 compliance 2022-02-14 15:48:54 +00:00
comp500
fa5de4b4bc Add default .packwizignore contents (fixes #3) 2022-02-10 16:47:38 +00:00
Sasha Sorokin
f41235b04c
Fix ignore file inconsistencies (#88)
* Fix ignore file inconsistencies

.packwizignore is supposed to work like .gitignore, yet it fails
miserably at doing so, being able to ignore only global patterns like
*.zip, and failing at patterns like /*.zip.

This commit introduces two changes to fix the issue:

- First, it uses a more up-to-date library. denormal/go-gitignore has
  not been updated since 2018 and has long open issues and pull
  requests, one of which tries to address leading slash ignoring, a-la
  /*.zip. denormal account seems to be abandoned since around the same
  year, so it makes sense to find a new library that does roughly the
  same thing.

  Gladly so, there's actually a library by sabhiram that shares the same
  name (but not the package name itself - which is just ignore - so it
  probably requires aliasing when importing).

- Secondly, it checks relative paths against ignore file instead of the
  absolute ones, which makes it possible to use leading slash (and
  probably some other features) with the new library.

From personal tests, it seems to address most - if not all - of the
inconsistencies. However, since it's a different library more throughout
testing probably wouldn't hurt to make sure it didn't break anything.

* Move dependency to main block
2022-01-23 21:05:34 +00:00
comp500
ce49820ef5 Add description field for Modrinth exports 2021-12-28 22:29:35 +00:00
comp500
60c08b93f3 Implement Modrinth pack exporting (fixes #34) 2021-12-28 22:03:22 +00:00
comp500
96a2d5fdf6 Update loader/mc versions from imported CF packs (fixes #70)
also refactored internal modloader handling!
2021-11-22 14:44:08 +00:00
comp500
b628e2762c Switch to better semver library and add pack-format field 2021-10-12 18:51:02 +01:00
comp500
a8bf26cc26 Remove unused Client/Server fields 2021-10-11 21:09:55 +01:00
comp500
c89aeed576 Remove unnecessary filepath.Rel (Ignore calls Abs anyway) 2021-09-19 14:31:19 +01:00
comp500
896b9548de Fabric filtering and native export for CurseForge 2021-06-15 03:09:49 +01:00
comp500
76460c5414 Remove pack-root, fix serve command (fixes #39)
index.toml is now the pack root - if you want to replicate
what the pack-root option would have provided, just move
your index.toml (and update the path in pack.toml)
2021-06-13 19:15:33 +01:00