Skip to content

Commit

Permalink
Merge pull request #82 from jmalak/osx
Browse files Browse the repository at this point in the history
change default location to install Open Watcom to <home directory>/watcom
  • Loading branch information
jmalak authored Mar 26, 2024
2 parents b38c0fe + 838d250 commit 4d50066
Show file tree
Hide file tree
Showing 3 changed files with 24 additions and 7 deletions.
5 changes: 5 additions & 0 deletions .github/workflows/build_test_release.yml
Original file line number Diff line number Diff line change
Expand Up @@ -35,6 +35,11 @@ jobs:
- "1.9"
- "2.0"
- "2.0-64"
include:
- runner: macos-latest
version: "2.0-64"
- runner: macos-14
version: "2.0-64"
steps:
- name: Download artifact
uses: actions/download-artifact@v4
Expand Down
2 changes: 1 addition & 1 deletion action.yml
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@ inputs:
required: false
default: ''
location:
description: 'Location where Open Watcom should be extracted to (default=/opt/watcom or C:\\WATCOM)'
description: 'Location where Open Watcom should be extracted to (default=$HOME/watcom or %USERPROFILE%\\WATCOM)'
required: false
default: ''
environment:
Expand Down
24 changes: 18 additions & 6 deletions src/main.ts
Original file line number Diff line number Diff line change
Expand Up @@ -50,32 +50,44 @@ function getInputs(): ISetupWatcomSettings {
throw new Error("Unsupported version");
}

let default_location: string;
let p_path_subdir: string;
let p_inc_subdirs: string[];
if (process.platform === "win32") {
default_location = "C:\\WATCOM";
if (p_version == "2.0-64") {
p_path_subdir = "BINNT64";
} else {
p_path_subdir = "BINNT";
}
p_inc_subdirs = ["H", "H\\NT", "H\\NT\\DIRECTX", "H\\NT\\DDK"];
} else if (process.platform === "darwin") {
throw new Error("Unsupported platform");
if (p_version !== "2.0-64") {
throw new Error("Unsupported platform");
}
if (process.arch === 'arm64') {
p_path_subdir = "armo64";
} else if (process.arch === 'x64') {
p_path_subdir = "bino64";
} else {
throw new Error("Unsupported platform");
}
p_inc_subdirs = ["lh"];
} else {
default_location = "/opt/watcom";
if (p_version == "2.0-64") {
p_path_subdir = "binl64";
} else {
p_path_subdir = "binl";
}
p_inc_subdirs = ["lh"];
}

let p_location = core.getInput("location");
if (!p_location) {
p_location = default_location;
if (process.platform === "win32") {
const home_path = process.env["USERPROFILE"] + "";
p_location = path.join(home_path, "WATCOM");
} else {
const home_path = process.env["HOME"] + "";
p_location = path.join(home_path, "watcom");
}
}

const p_environment = core.getBooleanInput("environment");
Expand Down

0 comments on commit 4d50066

Please sign in to comment.