Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Find out where a particular file links to / from #83

Closed
OpenBagTwo opened this issue Jul 7, 2023 · 1 comment · Fixed by #117
Closed

Find out where a particular file links to / from #83

OpenBagTwo opened this issue Jul 7, 2023 · 1 comment · Fixed by #117
Labels
enhancement New feature or request
Milestone

Comments

@OpenBagTwo
Copy link
Owner

GIVEN Steve has EnderChest set up on his system, linking multiple instances to multiple shulker boxes
AND he wants to find which shulker box is providing a particular resource pack, world save or config file,

WHEN he opens a terminal, navigates to his minecraft root and runs the command:

$ enderchest inventory minecraft some_instance --path resourcepacks/cool_resource_pack.zip

(see notes for variations)

THEN he gets back a message:

instances/some_instance/.minecraft/resourcepacks/cool_resource_pack.zip links to the "pretty resource packs" shulker box

regardless of whether the copy of "cool_resource_pack.zip" inside the "pretty resource packs" shulker box is itself a symlink,

BUT ONLY if the symlink into his instance isn't overwritten by a shulker box with a higher priority

SO that he doesn't have to go digging through the entire list of shulker boxes returned by enderchest inventory shulker_box to find the one providing that file when he wants to delete, replace or modify that file


GIVEN Narrator is wanting to replace a given mod, config or resource pack

AND wants to make sure that the change only propagates to the instances he wants

WHEN he opens a terminal, navigates to his minecraft root and runs the command:

$ enderchest inventory shulker_box dev_box --path mods/best_mod_ever.jar

(see notes for variations)

THEN he gets back a message:

EnderChest/dev_box/mods/best_mod_ever.jar is linked to by the following instances:
- 1.20_dev
- testbench
- important_smp

where the list of instances only includes the instances where the symlink isn't overwritten by links to other higher priority boxes

SO that he knows whether he can safely replace the file in that box or whether he should do it in a box with higher (or lower) priority

Notes

This isn't quite as simple as reading each link's target, mostly because of the abspathing / full-link-resolving that EnderChest does by default.

Supported syntaxes

  • -p should be accepted in place of --path (I don't think it's being used for anything else)
  • the path can be absolute (or relative to the minecraft root) for ease of tab-completion, but an error should be raised if the path is outside of the specified instance / shulker box
  • I'd actually love it if minecraft instance_name and shulker_box box_name were optional (or ignored with a warning) when an absolute/relative-to-minecraft-root -p is given, but we'll see how gnarly that is
@OpenBagTwo OpenBagTwo added the enhancement New feature or request label Jul 7, 2023
@OpenBagTwo OpenBagTwo added this to the v0.2 milestone Jul 10, 2023
@OpenBagTwo OpenBagTwo modified the milestones: v0.2, v0.1.4 Sep 22, 2023
@OpenBagTwo
Copy link
Owner Author

OpenBagTwo commented Nov 6, 2023

Implementation idea:

  1. Running place creates a dictionary of links to their targets
  2. This inventory operation then just queries the dictionary

Optional:

  1. Running place caches the dictionary in a hidden file (set to not be synced) in the EnderChest root
  2. Then inventory just queries the cache

This would be less for performance reasons as to enable inventory to give the information on the last place (to meet the use case of "I just updated my mods through PrismLauncher, and that deleted a bunch of symlinks, and now I'm trying to figure out where to put the new mod files"

Bonus:
--path should support glob-style wildcards

OpenBagTwo added a commit that referenced this issue Nov 15, 2023
OpenBagTwo added a commit that referenced this issue Nov 16, 2023
OpenBagTwo added a commit that referenced this issue Jan 11, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request
Projects
None yet
Development

Successfully merging a pull request may close this issue.

1 participant