eiriktsarpalis / nosln

A dotnet cli tool for generating solution files
MIT License
34 stars 1 forks source link

the param `-I` doesnt support directory wildcard on unix using unix dir separator #5

Open enricosada opened 4 years ago

enricosada commented 4 years ago

Environment: running on unix ( Ubuntu 18.04.2 LTS )

given a tree like

src/common/
├── Thor.Sif.Services.IndexCarts
│   └── Thor.Sif.Services.IndexCarts.fsproj
├── Thor.Sif.Services.IndexInventory
│   └── Thor.Sif.Services.IndexInventory.fsproj
├── Thor.Sif.Services.IndexLPNSnapshot
│   └── Thor.Sif.Services.IndexLPNSnapshot.fsproj
└── Thor.Sif.Services.IndexLocationZonesService
     └── Thor.Sif.Services.IndexLocationZonesService.fsproj

this works

dotnet nosln --flatten --quiet -o the.sln -I src\\common\\Thor.Sif.Services.**\\*.fsproj

but this doesnt

dotnet nosln --flatten --quiet -o the.sln -I src/common/Thor.Sif.Services.**/*.fsproj

and generate an empty sln

workaround

Use \\ instead of /

note

i tried without success also:

enricosada commented 4 years ago

i'll send a PR

eiriktsarpalis commented 4 years ago

That's surprising, globbing is delegated to the fake library, which I think generally works with forward slashes.

enricosada commented 4 years ago

Investigating this, it's the bash expansion who happen before the invocation of the program.

using dotnet nosln --flatten --quiet -o the.sln -I "src/common/Thor.Sif.Services.**/*.fsproj" works as expected

if the argument is not quoted, bash expand the passing the list of paths like

-I "src/common/Thor.Sif.Services.IndexCarts/Thor.Sif.Services.IndexCarts.fsproj" "src/common/Thor.Sif.Services.IndexInventory/Thor.Sif.Services.IndexInventory.fsproj" "src/common/Thor.Sif.Services.IndexLPNSnapshot/Thor.Sif.Services.IndexLPNSnapshot.fsproj" ...

so, it's okish and correct, just unexpected.

if -I can accept a list of string (and act like multiple -I), may work OOTB without quotes. But maybe that can be create other issues, i'll try apply this fix and let's see.

eiriktsarpalis commented 4 years ago

Ah yes, try using single quotes which don't get expanded by the shell.

On Wed, 25 Mar 2020, 14:35 Enrico Sada, notifications@github.com wrote:

Investigating this, it's the bash expansion who happen before the invocation of the program.

using dotnet nosln --flatten --quiet -o the.sln -I "src/common/Thor.Sif.Services.*/.fsproj" works as expected

if the argument is not quoted, bash expand the passing the list of paths like

-I "src/common/Thor.Sif.Services.IndexCarts/Thor.Sif.Services.IndexCarts.fsproj" "src/common/Thor.Sif.Services.IndexInventory/Thor.Sif.Services.IndexInventory.fsproj" "src/common/Thor.Sif.Services.IndexLPNSnapshot/Thor.Sif.Services.IndexLPNSnapshot.fsproj" ...

so, it's okish and correct, just unexpected.

if -I can accept a list of string (and act like multiple -I), may work OOTB without quotes. But maybe that can be create other issues, i'll try apply this fix and let's see.

— You are receiving this because you commented. Reply to this email directly, view it on GitHub https://github.com/eiriktsarpalis/nosln/issues/5#issuecomment-603874265, or unsubscribe https://github.com/notifications/unsubscribe-auth/AAVO3M37IHLNUM42DKZYM33RJIJBZANCNFSM4LTNHNHA .