Title: Fails to run when .js file assoc is not node · Issue #1 · tinyhttp/cli · GitHub
Open Graph Title: Fails to run when .js file assoc is not node · Issue #1 · tinyhttp/cli
X Title: Fails to run when .js file assoc is not node · Issue #1 · tinyhttp/cli
Description: I just tried on a online Linux VSCode environment. It has the same issue. the tinyhttp.ps1 tries to execute .js directly. When the file assoc is not node.exe, it fails to execute. For example on my PC, double click .js will open VSCode, ...
Open Graph Description: I just tried on a online Linux VSCode environment. It has the same issue. the tinyhttp.ps1 tries to execute .js directly. When the file assoc is not node.exe, it fails to execute. For example on my...
X Description: I just tried on a online Linux VSCode environment. It has the same issue. the tinyhttp.ps1 tries to execute .js directly. When the file assoc is not node.exe, it fails to execute. For example on my...
Opengraph URL: https://github.com/tinyhttp/cli/issues/1
X: @github
Domain: patch-diff.githubusercontent.com
{"@context":"https://schema.org","@type":"DiscussionForumPosting","headline":"Fails to run when .js file assoc is not node","articleBody":"I just tried on a online Linux VSCode environment. It has the same issue.\r\n\r\n---\r\n\r\nthe tinyhttp.ps1 tries to execute .js directly. When the file assoc is not node.exe, it fails to execute. For example on my PC, double click .js will open VSCode, so does execute .js in shell.\r\n\r\nI have no clue why this happens. Theoretically it's auto generated? BTW I'm using npm, not pnpm\r\n\r\n```pwsh\r\n#!/usr/bin/env pwsh\r\n$basedir=Split-Path $MyInvocation.MyCommand.Definition -Parent\r\n\r\n$exe=\"\"\r\nif ($PSVersionTable.PSVersion -lt \"6.0\" -or $IsWindows) {\r\n # Fix case when both the Windows and Linux builds of Node\r\n # are installed in the same directory\r\n $exe=\".exe\"\r\n}\r\n# Support pipeline input\r\nif ($MyInvocation.ExpectingInput) {\r\n $input | \u0026 \"$basedir/../@tinyhttp/cli/dist/index.js\" $args\r\n} else {\r\n \u0026 \"$basedir/../@tinyhttp/cli/dist/index.js\" $args\r\n}\r\nexit $LASTEXITCODE\r\n```\r\n\r\nthis is another cli tool\r\n\r\n```pwsh\r\n#!/usr/bin/env pwsh\r\n$basedir=Split-Path $MyInvocation.MyCommand.Definition -Parent\r\n\r\n$exe=\"\"\r\nif ($PSVersionTable.PSVersion -lt \"6.0\" -or $IsWindows) {\r\n # Fix case when both the Windows and Linux builds of Node\r\n # are installed in the same directory\r\n $exe=\".exe\"\r\n}\r\n$ret=0\r\nif (Test-Path \"$basedir/node$exe\") {\r\n # Support pipeline input\r\n if ($MyInvocation.ExpectingInput) {\r\n $input | \u0026 \"$basedir/node$exe\" \"$basedir/node_modules/jiti/bin/jiti.js\" $args\r\n } else {\r\n \u0026 \"$basedir/node$exe\" \"$basedir/node_modules/jiti/bin/jiti.js\" $args\r\n }\r\n $ret=$LASTEXITCODE\r\n} else {\r\n # Support pipeline input\r\n if ($MyInvocation.ExpectingInput) {\r\n $input | \u0026 \"node$exe\" \"$basedir/node_modules/jiti/bin/jiti.js\" $args\r\n } else {\r\n \u0026 \"node$exe\" \"$basedir/node_modules/jiti/bin/jiti.js\" $args\r\n }\r\n $ret=$LASTEXITCODE\r\n}\r\nexit $ret\r\n```\r\n\r\n**Versions**\r\n\r\n- `node`: v19.8.1\r\n- `@tinyhttp/cli`: 1.3.4\r\n","author":{"url":"https://github.com/imba-tjd","@type":"Person","name":"imba-tjd"},"datePublished":"2023-03-30T12:32:38.000Z","interactionStatistic":{"@type":"InteractionCounter","interactionType":"https://schema.org/CommentAction","userInteractionCount":0},"url":"https://github.com/1/cli/issues/1"}
| route-pattern | /_view_fragments/issues/show/:user_id/:repository/:id/issue_layout(.:format) |
| route-controller | voltron_issues_fragments |
| route-action | issue_layout |
| fetch-nonce | v2:a1c9427b-a748-4f90-fc62-0b96e7f5a550 |
| current-catalog-service-hash | 81bb79d38c15960b92d99bca9288a9108c7a47b18f2423d0f6438c5b7bcd2114 |
| request-id | A7B0:336FB:A98A79:E54860:698E402A |
| html-safe-nonce | 714856bf95c53644a476112f1964a2269c253c7014ef2967169e2d7a4ecbc126 |
| visitor-payload | eyJyZWZlcnJlciI6IiIsInJlcXVlc3RfaWQiOiJBN0IwOjMzNkZCOkE5OEE3OTpFNTQ4NjA6Njk4RTQwMkEiLCJ2aXNpdG9yX2lkIjoiODgyNzE5ODI5MzgyODA1OTE3OCIsInJlZ2lvbl9lZGdlIjoiaWFkIiwicmVnaW9uX3JlbmRlciI6ImlhZCJ9 |
| visitor-hmac | 208e7e066c6d85009435c4ff86caf0ed24c1e757cc13d5d63b0ad1cfffa847d7 |
| hovercard-subject-tag | issue:1647528970 |
| github-keyboard-shortcuts | repository,issues,copilot |
| google-site-verification | Apib7-x98H0j5cPqHWwSMm6dNU4GmODRoqxLiDzdx9I |
| octolytics-url | https://collector.github.com/github/collect |
| analytics-location | / |
| fb:app_id | 1401488693436528 |
| apple-itunes-app | app-id=1477376905, app-argument=https://github.com/_view_fragments/issues/show/tinyhttp/cli/1/issue_layout |
| twitter:image | https://opengraph.githubassets.com/dd59608cd74467083e535ad0f6d246861ad3d4e400df8761b28f81752cd7bbca/tinyhttp/cli/issues/1 |
| twitter:card | summary_large_image |
| og:image | https://opengraph.githubassets.com/dd59608cd74467083e535ad0f6d246861ad3d4e400df8761b28f81752cd7bbca/tinyhttp/cli/issues/1 |
| og:image:alt | I just tried on a online Linux VSCode environment. It has the same issue. the tinyhttp.ps1 tries to execute .js directly. When the file assoc is not node.exe, it fails to execute. For example on my... |
| og:image:width | 1200 |
| og:image:height | 600 |
| og:site_name | GitHub |
| og:type | object |
| og:author:username | imba-tjd |
| hostname | github.com |
| expected-hostname | github.com |
| None | a5632af64f7fed7bff1d6a428d1aca1b94fa7a48f760de2d39d9b1effdbf0082 |
| turbo-cache-control | no-preview |
| go-import | github.com/tinyhttp/cli git https://github.com/tinyhttp/cli.git |
| octolytics-dimension-user_id | 85759314 |
| octolytics-dimension-user_login | tinyhttp |
| octolytics-dimension-repository_id | 378450504 |
| octolytics-dimension-repository_nwo | tinyhttp/cli |
| octolytics-dimension-repository_public | true |
| octolytics-dimension-repository_is_fork | false |
| octolytics-dimension-repository_network_root_id | 378450504 |
| octolytics-dimension-repository_network_root_nwo | tinyhttp/cli |
| turbo-body-classes | logged-out env-production page-responsive |
| disable-turbo | false |
| browser-stats-url | https://api.github.com/_private/browser/stats |
| browser-errors-url | https://api.github.com/_private/browser/errors |
| release | aa1fa9100f85cd8b602c63c7e337f9151e70024f |
| ui-target | full |
| theme-color | #1e2327 |
| color-scheme | light dark |
Links:
Viewport: width=device-width