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

feat!: rewrite the postinstall script #192

Merged
merged 12 commits into from
Apr 12, 2024

Conversation

miraclx
Copy link
Contributor

@miraclx miraclx commented Apr 12, 2024

Branched off #191

Swaps out simple-get for fetch, and uses streams instead of buffering the whole binary in memory.

$  DEBUG=youtube-dl-exec* node ./scripts/postinstall.js   
  youtube-dl-exec:install downloading url=https://api.github.com/repos/yt-dlp/yt-dlp/releases/latest
  youtube-dl-exec:install writing path=/git/microlinkhq/youtube-dl-exec/bin/yt-dlp
  youtube-dl-exec:install status=success

Tested with npm, yarn and pnpm, and they all hide std{out,err} logs from post-install scripts on install unless the run fails. You can confirm this as well.

@miraclx miraclx changed the title fix: post-install should fail on error chore: rewrite the postinstall script Apr 12, 2024
@Kikobeats Kikobeats force-pushed the miraclx/dump-simple-get branch from d685773 to 227370a Compare April 12, 2024 09:11
@Kikobeats Kikobeats force-pushed the miraclx/dump-simple-get branch from 227370a to 56d2fda Compare April 12, 2024 09:12
@Kikobeats
Copy link
Member

Thanks for this @miraclx.

I modified your code for using debug-logfmt instead of log since it could be controlled via environment variable (added into docs too).

Also I noted we can drop a filesystem operation so I implemented the changes and dropped some unnecessary lines to make the script easier to maintain 🙂

@Kikobeats Kikobeats changed the title chore: rewrite the postinstall script feat!: rewrite the postinstall script Apr 12, 2024
@Kikobeats Kikobeats merged commit 0d69f1a into microlinkhq:master Apr 12, 2024
1 check passed
@miraclx miraclx deleted the miraclx/dump-simple-get branch April 12, 2024 09:17
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 this pull request may close these issues.

2 participants