Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

--allow-read=. doesn't appear to work for Deno emit #4

Open
irbull opened this issue May 18, 2022 · 2 comments
Open

--allow-read=. doesn't appear to work for Deno emit #4

irbull opened this issue May 18, 2022 · 2 comments
Labels
enhancement New feature or request

Comments

@irbull
Copy link

irbull commented May 18, 2022

I'm trying to use Deno Emit on a file in the current working directory:

// example.ts
import { emit } from "https://deno.land/x/emit@0.0.1/mod.ts";

const url = new URL("./example.ts", import.meta.url);
const result = await emit(url.href);

console.log(result);

If I start this with --allow-read=. it complains that I need full system --allow-read. We should be able to use emit on a file in the current working directory without requiring full system read access.

I used Deno 🦖 1.22.0

@kitsonk kitsonk added the enhancement New feature or request label May 19, 2022
@kitsonk
Copy link
Contributor

kitsonk commented May 19, 2022

This is because emit attempts to read files from your DENO_DIR cache directory and needs read permissions for that.

We should potentially consider a flag to indicate if the cache should be used or if remote modules should be fetched afresh every time.

@irbull
Copy link
Author

irbull commented May 19, 2022

Thanks @kitsonk. However, if I set my DENO_DIR to something below my current working directory (or even export DENO_DIR=$PWD) it still complains that I need --allow-read.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request
Projects
None yet
Development

No branches or pull requests

2 participants