Skip to content
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
5 changes: 4 additions & 1 deletion src/haxeshim/HaxeInstallation.hx
Original file line number Diff line number Diff line change
Expand Up @@ -4,19 +4,21 @@ class HaxeInstallation {
static var EXT = if (Os.IS_WINDOWS) '.exe' else '';

public var path(default, null):String;
public var scope(default, null):String;
public var stdLib(default, null):String;
public var compiler(default, null):String;
public var haxelib(default, null):String;
public var version(default, null):String;
public var haxelibRepo(default, null):String;

public function new(path:String, version:String, haxelibRepo:String) {
public function new(path:String, version:String, haxelibRepo:String, scope:String) {
this.path = path;
this.version = version;
this.compiler = '$path/haxe$EXT';
this.haxelib = '$path/haxelib$EXT';
this.stdLib = '$path/std';
this.haxelibRepo = haxelibRepo;
this.scope = scope;
}

public function env():Env {
Expand All @@ -25,6 +27,7 @@ class HaxeInstallation {
HAXEPATH: path,
HAXELIB_PATH: haxelibRepo,
HAXE_VERSION: version,
SCOPE_PATH: scope
}

return ret.mergeInto(Neko.ENV);
Expand Down
4 changes: 3 additions & 1 deletion src/haxeshim/HaxelibCli.hx
Original file line number Diff line number Diff line change
Expand Up @@ -124,7 +124,9 @@ class HaxelibCli {
#if nodejs
js.Node.process.stdout.on('error', function () {});//hxcpp apparently closes stdout and then writing to it fails
#end
new HaxelibCli(Scope.seek()).dispatch(Sys.args());
new HaxelibCli(Scope.seek({
cwd: Sys.getEnv('SCOPE_PATH')
})).dispatch(Sys.args());
}

}
6 changes: 3 additions & 3 deletions src/haxeshim/Scope.hx
Original file line number Diff line number Diff line change
Expand Up @@ -223,9 +223,9 @@ class Scope {
return
switch path(version) {
case Some(path):
new HaxeInstallation(path, version, haxelibRepo);
new HaxeInstallation(path, version, haxelibRepo, scopeDir);
case None:
new HaxeInstallation('$versionDir/$version', version, haxelibRepo);
new HaxeInstallation('$versionDir/$version', version, haxelibRepo, scopeDir);
}

function resolveThroughHaxelib(libs:Array<Arg>)
Expand Down Expand Up @@ -501,7 +501,7 @@ class Scope {
static public function seek(?options:SeekingOptions) {
if (options == null)
options = {};

var cwd = switch options.cwd {
case null: Sys.getCwd();
case v: v;
Expand Down