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

Wildcards not working #57

Closed
Xeevis opened this issue Jan 23, 2022 · 1 comment · Fixed by #60
Closed

Wildcards not working #57

Xeevis opened this issue Jan 23, 2022 · 1 comment · Fixed by #60

Comments

@Xeevis
Copy link
Contributor

Xeevis commented Jan 23, 2022

In readme it says I can use wildcards to update all files in a directory.

deno-udd/README.md

Lines 41 to 45 in d8402fb

To update all the ts files in your directory:
```sh
udd *.ts
```

However this doesn't quite work for me on Deno 1.18.0

Warning Implicitly using latest version (0.7.1) for https://deno.land/x/udd/main.ts
*.ts
error: Uncaught (in promise) Error: The filename, directory name, or volume label syntax is incorrect. (os error 123), open '*.ts'
    return decoder.decode(await Deno.readFile(this.filename));
                          ^
    at async open (deno:runtime/js/40_files.js:51:17)
    at async Object.readFile (deno:runtime/js/40_read_file.js:25:18)
    at async Udd.content (https://deno.land/x/udd@0.7.1/mod.ts:56:27)
    at async Udd.run (https://deno.land/x/udd@0.7.1/mod.ts:60:29)
    at async udd (https://deno.land/x/udd@0.7.1/mod.ts:14:10)
    at async main (https://deno.land/x/udd@0.7.1/main.ts:135:21)
    at async https://deno.land/x/udd@0.7.1/main.ts:175:3
The terminal process "C:\Users\Xeevis\.dev\deno.EXE 'run', '--allow-read', '--allow-write', '--allow-net', '--reload', '--quiet', 'https://deno.land/x/udd/main.ts', '--dry-run', '*.ts'" terminated with exit code: 1.
@hayd
Copy link
Owner

hayd commented Jan 23, 2022

Thanks for filing this issue.

It looks like I was assuming shell expansion which isn't a thing on windows. https://superuser.com/a/460609

So udd should expand the glob... either *.ts should be passed https://deno.land/std@0.122.0/fs/README.md#expandglob or doing so should require an additional flag. 🤔 Edit: I think that we should allow some kind of "fixed string" flag, but by default glob expand here (I think):

const depFiles: string[] = a._.map((x) => x.toString());

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants