Skip to content

Commit

Permalink
Add debug logging
Browse files Browse the repository at this point in the history
  • Loading branch information
delasy committed Feb 1, 2025
1 parent 300fe62 commit 3a1a308
Show file tree
Hide file tree
Showing 4 changed files with 13 additions and 6 deletions.
5 changes: 3 additions & 2 deletions dist/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -64,16 +64,17 @@ function run() {
return __awaiter(this, void 0, void 0, function* () {
const version = core.getInput('the-version', { required: true });
let cachedPath = tc.find('the', version);
const shouldDownload = cachedPath.length === 0;
const shouldDownload = cachedPath.length !== 0;
if (shouldDownload) {
cachedPath = yield download(version);
}
core.addPath(cachedPath);
core.debug(JSON.stringify({ 'utils.versionToNumber(version)': utils.versionToNumber(version), OFFLINE_COMPILER_VERSION: OFFLINE_COMPILER_VERSION }));
if (shouldDownload && utils.versionToNumber(version) >= OFFLINE_COMPILER_VERSION) {
yield (0, exec_1.exec)('the offline');
core.exportVariable('THE_DEPS_DIR', path.join(utils.homePath(), 'deps'));
}
core.setOutput('the-version', utils.installedVersion());
core.setOutput('the-version', yield utils.installedVersion());
});
}
run().catch((err) => {
Expand Down
2 changes: 1 addition & 1 deletion dist/index.js.map

Large diffs are not rendered by default.

6 changes: 4 additions & 2 deletions src/main.ts
Original file line number Diff line number Diff line change
Expand Up @@ -31,20 +31,22 @@ async function download (version: string): Promise<string> {
async function run (): Promise<void> {
const version = core.getInput('the-version', { required: true })
let cachedPath = tc.find('the', version)
const shouldDownload = cachedPath.length === 0
const shouldDownload = cachedPath.length !== 0

if (shouldDownload) {
cachedPath = await download(version)
}

core.addPath(cachedPath)

core.debug(JSON.stringify({ 'utils.versionToNumber(version)': utils.versionToNumber(version), OFFLINE_COMPILER_VERSION }))

if (shouldDownload && utils.versionToNumber(version) >= OFFLINE_COMPILER_VERSION) {
await exec('the offline')
core.exportVariable('THE_DEPS_DIR', path.join(utils.homePath(), 'deps'))
}

core.setOutput('the-version', utils.installedVersion())
core.setOutput('the-version', await utils.installedVersion())
}

run().catch((err) => {
Expand Down
6 changes: 5 additions & 1 deletion test/example
Original file line number Diff line number Diff line change
@@ -1,3 +1,7 @@
main {
print("Hello, World!")
mut req := request_open("GET", "https://ci.thelang.io/echo?ip")
res := req.read()
req.close()

print(req.data.str())
}

0 comments on commit 3a1a308

Please sign in to comment.