-
Notifications
You must be signed in to change notification settings - Fork 5.4k
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
Support shebangs #1197
Support shebangs #1197
Conversation
I suspect this is going to need an integration test and more changes as TypeScript doesn't like files without extensions. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Lgtm
@kitsonk probably right - but initial tests worked. We can nail down further problems as they arise. |
Changes since v0.1.12: - First pass at running subprocesses (denoland#1156) - Improve flag parsing (denoland#1200) - Improve fetch() (denoland#1194 denoland#1188 denoland#1102) - Support shebang (denoland#1197)
how can I use this feature? |
There is nothing you need to do to use the feature. Source files are stripped of shebangs before they are used. |
The following doesn't work... file #!/usr/bin/env deno
console.log("test"); run via |
Okay, looks like I need... #!/usr/bin/env -S deno -q run
// deno-language: ts
console.log("test"); without a file extension... |
@tracker1 You were telling incorrect information. I wrote the following code and save it as #!/usr/bin/env -S deno -q run
// deno-language: ts
function echo(input: string) {
console.log(input);
}
echo("Hello, world!"); Renaming To my understanding, deno currently has no option to run a extension-less interpreter files written in TS. |
Oh wait, I found @tracker1 edited this Stack Overflow post to show the incorrect information there: https://stackoverflow.com/posts/63044107/revisions Please don't do this! Check your knowledge before you teach someone. It seems @martin-braun is one of the victims (denoland/vscode_deno#475 (comment)). |
@aiotter Thanks for mentioning me and reminding me about that. I previously found #5088 and learned that it is not implemented yet, but I forgot to edit my issue on vscode_deno. I edited my GitHub issue and I also removed the misinformation from dwmorrin's answer at StackOverflow to prevent further confusion in the community. |
Thanks @martin-braun! I appreciate your help to remove the misinformation. Nice work! |
Fixes #929