Thanks to visit codestin.com
Credit goes to github.com

Skip to content

yargs().env() always fails in deno runtime #405

@reosablo

Description

@reosablo

This is a small reproducible code:

// example.ts
import yargs from "https://deno.land/x/[email protected]/deno.ts";
yargs().env().parse([]);
deno run example.ts              # uncaught error: permission denied
deno run --allow-env example.ts  # uncaught error: Object.keys(undefined)

Maybe, that's because env() in deno.ts:12:14 returns nothing and doesn't handle PermissionDenied errors like this:

  env: () => {
    Deno.env.toObject()
  },

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions