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

Added command line hook scripts(done/exit). #389

Merged
merged 4 commits into from Jul 30, 2015
Merged

Conversation

@solderzzc
Copy link
Contributor

solderzzc commented Jul 29, 2015

Give a chance for the programs use webtorrent cli to run scripts when download done or exit.

For example:
exit.sh

!/bin/bash

echo "exiting" > info.txt
echo "Torrent filename : $1" >> info.txt
echo "Torrent path : $2" >> info.txt
echo "Torrent magentURI : $3" >> info.txt

solderzzc added 4 commits Jul 29, 2015
Give a chance for the programs use webtorrent cli to run scripts when download done or exit.
feross added a commit that referenced this pull request Jul 30, 2015
Added command line hook scripts(done/exit).
@feross feross merged commit ff526c9 into webtorrent:master Jul 30, 2015
1 check passed
1 check passed
continuous-integration/travis-ci/pr The Travis CI build passed
Details
@feross

This comment has been minimized.

Copy link
Member

feross commented Jul 30, 2015

Thanks for the PR! Released as 0.55.0.

I renamed --exit to --on-exit and --done to --on-done for clarity and removed the shorthands -e and -d since these won't be commonly used options. Also, I don't think cmd.js is the right place to be saving the .torrent file, so I removed that code for now.

Out of curiosity, what do you plan to use these hooks for?

@solderzzc

This comment has been minimized.

Copy link
Contributor Author

solderzzc commented Jul 30, 2015

These hooks are designed for running on single board computer(such as
Raspberry Pi or some TV boxes with Linux running in container).
Such environment has limited resource. For 512M memory, it's not suitable
to run multiple webtorrent instances.
The --on-done script can be used to move/link/copy the downloaded files to
'Transmission' for seeding to save memory. Transmission can serve multiple
torrents easily.
And the --on-exit script can be used to clean up downloaded folder if
there's storage limitation(Same as popcornTime Android behavior).

On Thu, Jul 30, 2015 at 2:32 AM, Feross Aboukhadijeh <
notifications@github.com> wrote:

Thanks for the PR! Released as 0.55.0.

I renamed --exit to --on-exit and --done to --on-done for clarity and
removed the shorthands -e and -d since these won't be commonly used
options. Also, I don't think cmd.js is the right place to be saving the
.torrent file, so I removed that code for now.

Out of curiosity, what do you plan to use these hooks for?


Reply to this email directly or view it on GitHub
#389 (comment).

@lock lock bot locked as resolved and limited conversation to collaborators May 6, 2018
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Linked issues

Successfully merging this pull request may close these issues.

None yet

2 participants
You can’t perform that action at this time.