Skip to content

Commit

Permalink
new: Support shims dir.
Browse files Browse the repository at this point in the history
  • Loading branch information
milesj committed Oct 20, 2023
1 parent 983f22c commit bda1bc8
Show file tree
Hide file tree
Showing 3 changed files with 13 additions and 2 deletions.
8 changes: 8 additions & 0 deletions helpers.ts
Original file line number Diff line number Diff line change
Expand Up @@ -13,6 +13,10 @@ export function getProtoHome() {
return process.env.PROTO_HOME;
}

if (process.env.PROTO_ROOT) {
return process.env.PROTO_ROOT;
}

return path.join(os.homedir(), '.proto');
}

Expand All @@ -24,6 +28,10 @@ export function getPluginsDir() {
return path.join(getProtoHome(), 'plugins');
}

export function getShimsDir() {
return path.join(getProtoHome(), 'shims');
}

export function getToolsDir() {
return path.join(getProtoHome(), 'tools');
}
Expand Down
5 changes: 4 additions & 1 deletion index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,7 @@ import * as core from '@actions/core';
import {
getBinDir,
getPluginsDir,
getShimsDir,
getToolchainCacheKey,
getToolsDir,
installBin,
Expand Down Expand Up @@ -39,10 +40,12 @@ async function restoreCache() {

async function run() {
try {
const shimsDir = getShimsDir();
const binDir = getBinDir();

core.info(`Added ${binDir} to PATH`);
core.info(`Added ${shimsDir} and ${binDir} to PATH`);
core.addPath(binDir);
core.addPath(shimsDir);

await restoreCache();

Expand Down
2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "@moonrepo/setup-toolchain",
"version": "0.0.4",
"version": "0.0.5",
"description": "A GitHub action to setup and cache the proto and moon toolchains. ",
"main": "dist/index.js",
"scripts": {
Expand Down

0 comments on commit bda1bc8

Please sign in to comment.