Skip to content

Commit

Permalink
move the isLocal check to Scope, and remove the arg from the constructor
Browse files Browse the repository at this point in the history
  • Loading branch information
ninjamuffin99 committed Jul 30, 2024
1 parent d9a4b88 commit 508d461
Show file tree
Hide file tree
Showing 3 changed files with 4 additions and 6 deletions.
Binary file modified run.n
Binary file not shown.
5 changes: 1 addition & 4 deletions src/haxelib/api/GlobalScope.hx
Original file line number Diff line number Diff line change
Expand Up @@ -22,10 +22,7 @@ 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.suggestGlobalPath() ?? "";
super(repository);
}

public function runScript(library:ProjectName, ?callData:CallData, ?version:Version):Void {
Expand Down
5 changes: 3 additions & 2 deletions src/haxelib/api/Scope.hx
Original file line number Diff line number Diff line change
Expand Up @@ -60,9 +60,10 @@ abstract class Scope {
public final repository:Repository;
final overrides:LockFormat;

function new(isLocal:Bool, repository:Repository) {
this.isLocal = isLocal;
function new(repository:Repository) {
this.repository = 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.suggestGlobalPath() ?? "";

overrides = loadOverrides();
}
Expand Down

0 comments on commit 508d461

Please sign in to comment.