fix: add `deno install` root to path (#7)

This commit is contained in:
Satya Rohith 2021-06-27 13:07:03 +05:30 committed by GitHub
parent eb33d5551a
commit a63bb6b1ba
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
2 changed files with 10 additions and 0 deletions

View File

@ -26,6 +26,11 @@ jobs:
- name: Test Deno
run: deno run https://deno.land/std/examples/welcome.ts
- name: Test `deno install`
run: |
deno install --allow-net -n deno_curl https://deno.land/std/examples/curl.ts
deno_curl https://deno.land/std/examples/curl.ts
- name: Format
if: runner.os == 'Linux' && matrix.deno == 'canary'
run: npm run fmt:check

View File

@ -1,3 +1,5 @@
const os = require("os");
const path = require("path");
const process = require("process");
const core = require("@actions/core");
const tc = require("@actions/tool-cache");
@ -33,6 +35,9 @@ async function install(version) {
);
core.info(`Cached Deno to ${newCachedPath}.`);
core.addPath(newCachedPath);
const denoInstallRoot = process.env.DENO_INSTALL_ROOT ||
path.join(os.homedir(), ".deno", "bin");
core.addPath(denoInstallRoot);
}
/** @returns {string} */