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

test Command Produces Unexpected Results #1975

Open
ic-it opened this issue Dec 30, 2024 · 0 comments
Open

test Command Produces Unexpected Results #1975

ic-it opened this issue Dec 30, 2024 · 0 comments
Labels
dep: mvdan/sh Issues related to the upstream interpreter used by Task.

Comments

@ic-it
Copy link

ic-it commented Dec 30, 2024

Description

Problem Description:
The test and [ ] commands produce inconsistent results when executed via a Taskfile compared to direct execution in the shell.


$ echo $SHELL
/bin/bash
$ task --version
Task version: v3.40.1 (h1:Q/TjPh5SAI+XK2fBravDPZXNGm6mvnwrLJqCXfhZ3Wc=)
$ task test
task: [test] test -w .ruff_cache && echo WRITABLE || echo NOT WRITABLE
NOT WRITABLE
task: [test] [ -w .ruff_cache ] && echo WRITABLE || echo NOT WRITABLE
NOT WRITABLE
$ test -w .ruff_cache && echo WRITABLE || echo NOT WRITABLE
WRITABLE
$ [ -w .ruff_cache ] && echo WRITABLE || echo NOT WRITABLE
WRITABLE

Version

v3.40.1

Operating system

Linux, Fedora 41

Experiments Enabled

No response

Example Taskfile

version: 3

tasks:
  test:
    cmds:
      - test -w .ruff_cache && echo WRITABLE || echo NOT WRITABLE
      - |
        [ -w .ruff_cache ] && echo WRITABLE || echo NOT WRITABLE

Dependency

This issue depends on mvdan/sh#1116

@task-bot task-bot added the state: needs triage Waiting to be triaged by a maintainer. label Dec 30, 2024
@andreynering andreynering added dep: mvdan/sh Issues related to the upstream interpreter used by Task. and removed state: needs triage Waiting to be triaged by a maintainer. labels Dec 30, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
dep: mvdan/sh Issues related to the upstream interpreter used by Task.
Projects
None yet
Development

No branches or pull requests

3 participants