Skip to content

Commit

Permalink
add HAXEPATH because windows
Browse files Browse the repository at this point in the history
  • Loading branch information
Hazel committed Mar 3, 2024
1 parent 9e15b80 commit 3280f1b
Show file tree
Hide file tree
Showing 3 changed files with 6 additions and 2 deletions.
4 changes: 3 additions & 1 deletion dist/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -86,6 +86,7 @@ class Asset {
async setup() {
const toolPath = tool_cache.find(this.name, this.version);
if (toolPath) {
console.log(`[${this.name}] found = ${toolPath}`);
return toolPath;
}
return tool_cache.cacheDir(await this.download(), this.name, this.version);
Expand Down Expand Up @@ -341,11 +342,12 @@ async function setup(version, nightly, cacheDependencyPath) {
console.log(`[neko] NEKOPATH = ${nekoPath}`);
lib_core.exportVariable('NEKOPATH', nekoPath);
lib_core.exportVariable('LD_LIBRARY_PATH', `${nekoPath}:$LD_LIBRARY_PATH`);
console.log(`[haxe] dl start = ${version}`);
const haxe = new HaxeAsset(version, nightly);
console.log(`[haxe] dl start = ${version} (${haxe.downloadUrl})`);
const haxePath = await haxe.setup();
lib_core.addPath(haxePath);
console.log(`[haxe] HAXE_STD_PATH = ${haxePath}/std`);
lib_core.exportVariable('HAXEPATH', haxePath);
lib_core.exportVariable('HAXE_STD_PATH', external_node_path_namespaceObject.join(haxePath, 'std'));
if (env.platform === 'osx') {
// Ref: https://github.com/asdf-community/asdf-haxe/pull/7
Expand Down
1 change: 1 addition & 0 deletions src/asset.ts
Original file line number Diff line number Diff line change
Expand Up @@ -18,6 +18,7 @@ abstract class Asset {
async setup() {
const toolPath = tc.find(this.name, this.version);
if (toolPath) {
console.log(`[${this.name}] found = ${toolPath}`);
return toolPath;
}

Expand Down
3 changes: 2 additions & 1 deletion src/setup.ts
Original file line number Diff line number Diff line change
Expand Up @@ -21,11 +21,12 @@ export async function setup(version: string, nightly: boolean, cacheDependencyPa
core.exportVariable('NEKOPATH', nekoPath);
core.exportVariable('LD_LIBRARY_PATH', `${nekoPath}:$LD_LIBRARY_PATH`);

console.log(`[haxe] dl start = ${version}`);
const haxe = new HaxeAsset(version, nightly);
console.log(`[haxe] dl start = ${version} (${haxe.downloadUrl})`);
const haxePath = await haxe.setup();
core.addPath(haxePath);
console.log(`[haxe] HAXE_STD_PATH = ${haxePath}/std`);
core.exportVariable('HAXEPATH', haxePath);
core.exportVariable('HAXE_STD_PATH', path.join(haxePath, 'std'));

if (env.platform === 'osx') {
Expand Down

0 comments on commit 3280f1b

Please sign in to comment.