Skip to content
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

change default location to install Open Watcom to <home directory>/watcom #82

Merged
merged 1 commit into from
Mar 26, 2024
Merged
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: 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