Skip to content

Conversation

@gaborbernat
Copy link
Contributor

Signed-off-by: Bernát Gábor [email protected]

Signed-off-by: Bernát Gábor <[email protected]>
Signed-off-by: Bernát Gábor <[email protected]>
@gaborbernat gaborbernat merged commit beb7d66 into pypa:main Jan 3, 2023
@gaborbernat gaborbernat deleted the fix branch January 3, 2023 05:16
Copy link

@MeCorey MeCorey left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

virtualenv activation module

Activate with overlay use activate.nu

Deactivate with deactivate, as usual

To customize the overlay name, you can call overlay use activate.nu as foo,

but then simply deactivate won't work because it is just an alias to hide

the "activate" overlay. You'd need to call overlay hide foo manually.

export-env {
def is-string [x] {
($x | describe) == 'string'
}

def has-env [name: string] {
    $name in (env).name
}

# Emulates a `test -z`, but btter as it handles e.g 'false'
def is-env-true [name: string] {
  if (has-env $name) {
    # Try to parse 'true', '0', '1', and fail if not convertible
    let parsed = do -i { $env | get $name | into bool }
    if ($parsed | describe) == 'bool' {
      $parsed

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants