Skip to content

Commit

Permalink
Set THE_DEPS_DIR for entire pipeline
Browse files Browse the repository at this point in the history
  • Loading branch information
delasy committed Feb 1, 2025
1 parent 58902f5 commit 300fe62
Show file tree
Hide file tree
Showing 4 changed files with 14 additions and 2 deletions.
8 changes: 7 additions & 1 deletion dist/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -71,6 +71,7 @@ function run() {
core.addPath(cachedPath);
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());
});
Expand Down Expand Up @@ -125,8 +126,9 @@ var __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, P, ge
});
};
Object.defineProperty(exports, "__esModule", ({ value: true }));
exports.versionToNumber = exports.tempDirectory = exports.platformName = exports.platformArch = exports.installedVersion = exports.cliUrl = exports.binaryExtension = exports.isWin = void 0;
exports.versionToNumber = exports.tempDirectory = exports.platformName = exports.platformArch = exports.installedVersion = exports.homePath = exports.cliUrl = exports.binaryExtension = exports.isWin = void 0;
const exec_1 = __nccwpck_require__(5236);
const os = __importStar(__nccwpck_require__(857));
const path = __importStar(__nccwpck_require__(6928));
exports.isWin = process.platform === 'win32';
exports.binaryExtension = exports.isWin ? '.exe' : '';
Expand All @@ -143,6 +145,10 @@ function cliUrl(version) {
}
}
exports.cliUrl = cliUrl;
function homePath() {
return path.join(os.homedir(), exports.isWin ? 'The' : '.the');
}
exports.homePath = homePath;
function installedVersion() {
var _a, _b;
return __awaiter(this, void 0, void 0, function* () {
Expand Down
2 changes: 1 addition & 1 deletion dist/index.js.map

Large diffs are not rendered by default.

1 change: 1 addition & 0 deletions src/main.ts
Original file line number Diff line number Diff line change
Expand Up @@ -41,6 +41,7 @@ async function run (): Promise<void> {

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())
Expand Down
5 changes: 5 additions & 0 deletions src/utils.ts
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
import { exec } from '@actions/exec'
import * as os from 'os'
import * as path from 'path'

export const isWin = process.platform === 'win32'
Expand All @@ -17,6 +18,10 @@ export function cliUrl (version: string): string {
}
}

export function homePath (): string {
return path.join(os.homedir(), isWin ? 'The' : '.the')
}

export async function installedVersion (): Promise<string> {
let stdout = ''

Expand Down

0 comments on commit 300fe62

Please sign in to comment.