fix: add install root to path

This commit is contained in:
Satya Rohith 2021-06-16 05:31:38 +05:30
parent eb33d5551a
commit c7dcf0a98b
No known key found for this signature in database
GPG Key ID: 95F8574CC45A40F8
2 changed files with 11 additions and 1 deletions

View File

@ -26,6 +26,11 @@ jobs:
- name: Test Deno - name: Test Deno
run: deno run https://deno.land/std/examples/welcome.ts 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 - name: Format
if: runner.os == 'Linux' && matrix.deno == 'canary' if: runner.os == 'Linux' && matrix.deno == 'canary'
run: npm run fmt:check run: npm run fmt:check

View File

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