-
-
Notifications
You must be signed in to change notification settings - Fork 78
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
Display current repository path when using haxelib list
#634
base: development
Are you sure you want to change the base?
Display current repository path when using haxelib list
#634
Conversation
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Local scope is not only for when there's a .haxelib
folder in current repository (can be in any parent directory, too), and in this case:
- this PR considers the repo as global while it's not
- it breaks if global scope isn't setup
just double checking, global scope is where haxelibs get installed to, and gets set up via |
Yes (well, where haxelibs get installed to when you don't have a local repository). But you can also only ever use local repositories and never setup global repository to avoid mistakenly installing libs globally. |
nice, just made change that uses Then it compares whatever path it finds to the global repository path via I'll now poke around into making sure that it works without a global scope setup! |
so it's possible to have a local repo without having setup a global one? So this command should respond accordingly and work in local repos on machines with no global repo? |
src/haxelib/api/GlobalScope.hx
Outdated
@@ -21,6 +23,9 @@ using StringTools; | |||
class GlobalScope extends Scope { | |||
function new(repository:Repository) { | |||
super(false, repository); | |||
|
|||
// While this class is "GlobalScope", there's currently not a "LocalScope" equivalent class. For now we can add this here. | |||
isLocal = repository.path != RepoManager.getGlobalPath(); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Hmm, RepoManager.getGlobalPath()
will throw if there's no global repository setup.
This not so pretty hack might not be a good idea..
isLocal
should probably live in Repository
itself, which could also more easily identify local / global cases (might need to rework get()
a bit there).
some changes
When running note: i have only tested global non-setup by renaming my |
took a peak at some of those failed tests just now.
Not to schmooze around the tests too much, what are some options to get these passing? I will say, I don't know testing etiquette! Off the top of my head, maybe can pass |
Yeah, haxelib list parsing is one of my concerns, too. |
|
The Repository - a place where libraries are installed, can hold multiple versions of the same library.
Scope - something takes a library name and tells you which version of that library to use.
|
ah that makes total sense. Knowing what I know now, I'll entirely ignore |
…vant to repositories
haxelib list
haxelib list
Adds a file system check for a
.haxelib
directory inGlobalScope.hx
(there's noLocalScope.hx
class), and then setsisLocal
accordingly.Then in the
Main.list()
function, we check forisLocal
being true or false. We displayLocal Haxelib Repository at: {localPath}
if we are in local scope, andGlobal Haxelib at: ${RepoManager.getGlobalPath()}\n
also slightly change the way that list works, appending just one string and printing a single string to the CLI, rather than printing each string individually
In the root of FNF (.haxelib directory exists)
In the
assets/
folder/submodule of FNF (.haxelib directory does not exist