Skip to content

[Bug]: tsp compile --list-files doesn't list files, if spec is outside current directory #9313

@mikeharder

Description

@mikeharder

Describe the bug

tsp compile --list-files doesn't list files, if the spec is outside the current directory. The compile itself seems to work fine, just the files are not listed.

Reproduction

If I run tsp compile --list-files on a spec under my current directory, it prints the files as expected:

~/specs-mh$ npx tsp compile --list-files specification/contosowidgetmanager/Contoso.Management
TypeSpec compiler v1.7.1

✔ Compiling
✔ @azure-tools/typespec-autorest 565ms specification/contosowidgetmanager/
    specification/contosowidgetmanager/resource-manager/Microsoft.Contoso/preview/2021-10-01-preview/contoso.json
    specification/contosowidgetmanager/resource-manager/Microsoft.Contoso/preview/2021-10-01-preview/examples/Operations_List.json
    ...
Compilation completed successfully.

However, if I run the same command on the same spec, but outside my current directory, no files are printed:

~/specs-mh$ npx tsp compile --list-files ../specs-mh-2/specification/contosowidgetmanager/Contoso.Management
TypeSpec compiler v1.7.1

✔ Compiling
✔ @azure-tools/typespec-autorest 529ms ../specs-mh-2/specification/contosowidgetmanager/

Compilation completed successfully.

Checklist

Metadata

Metadata

Assignees

No one assigned

    Labels

    Type

    No type

    Projects

    No projects

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions