Skip to content

[feature] Join affected env with path separators #2097

@KS-ZF

Description

@KS-ZF

Describe the bug

When using filegroups for environment variables, moonrepo passes a string where the different file paths are separated via comma ',' but not via the OS-Specific path separators e.g. ':' for POSIX or ';' for Windows
Because file separators are OS-Specific, this can lead to issues with programs expecting OS-Specific path separators, e.g. python programs using 'os.pathsep'.

Steps to reproduce

  1. On Windows, create a moon.yml file with a fileGroup 'myFiles' and a task 'myTask'
  fileGroups:
    myFiles:
    - "/example_file_path/file_a.txt"
    - "/example_file_path/file_b.txt"
  
  tasks:
    myTask:
     command: echo
     args:
       - "$env:MY_FILE_PATHS"
     env:
        MY_FILE_PATHS: "@group(myFiles)"
  1. Execute task 'myTask'
    Expected behavior
    moonrepo passes file paths separated by OS-Specific file separator to environment variable, therefore the terminal output on windows should be:
    myTask | ..\..\..\example_file_path\file_a.txt;..\..\..\example_file_path\file_b.txt

Screenshots

Image

Environment
N/A

Additional context

N/A

Metadata

Metadata

Assignees

Labels

bugSomething isn't working

Type

No type

Projects

No projects

Relationships

None yet

Development

No branches or pull requests

Issue actions