Skip to content

devNull - Cross-platform special variable like pathSep/lineSep #2407

@solvingj

Description

@solvingj

Description

In #2406 I requested pathSep as a special platform variable with ";" for windows, and ":" for posix.

This is a similar request for making it easy to suppress output in a similar way. This one is probably less agreeable because it's got a few assumptions baked in, but here's my current implementation on all my Taskfiles.

vars:
  DEVNULL: '{{if eq .OS "windows"}}NUL 2>&1{{else}}/dev/null 2>&1{{end}}'

Metadata

Metadata

Assignees

No one assigned

    Labels

    area: templatingChanges related to the templating engine.os: windowsIssues that affect users on Windows.

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions