From bcf1edca7b174220c78cf339dc5c7262bbb73a30 Mon Sep 17 00:00:00 2001 From: thePR0M3TH3AN <53631862+PR0M3TH3AN@users.noreply.github.com> Date: Sun, 15 Mar 2026 21:04:36 -0400 Subject: [PATCH] Improve install scripts: auto-add to PATH and clear command instructions setup.py: - Automatically adds lbry-downloader to PATH in .bashrc/.zshrc - Shows clear 'QUICK START' section with numbered steps - Explicitly states the command to run: 'lbry-downloader' - Shows config and download locations - Better formatting with emojis and sections remote-install.sh: - Instructs user to 'source ~/.bashrc' to reload shell - Shows numbered next steps clearly - Explains what to do if command not found - Shows config file location Users now get clear instructions: 1. Reload shell: source ~/.bashrc 2. Start daemon: lbrynet start 3. Test: lbry-downloader --dry-run 4. Download: lbry-downloader --- remote-install.sh | 23 +++++++++++--- setup.py | 80 ++++++++++++++++++++++++++++------------------- 2 files changed, 67 insertions(+), 36 deletions(-) diff --git a/remote-install.sh b/remote-install.sh index eb68092..c4e8093 100755 --- a/remote-install.sh +++ b/remote-install.sh @@ -109,9 +109,24 @@ echo "==========================================" print_status "Installation complete!" echo "==========================================" echo "" -echo "You can now run LBRY Downloader:" -echo " cd $INSTALL_DIR && ./bin/lbry-downloader" +echo "🎉 Setup finished! The command 'lbry-downloader' has been added to your PATH." echo "" -echo "Or add to your PATH:" -echo " echo 'export PATH=\"$INSTALL_DIR/bin:\$PATH\"' >> ~/.bashrc" +echo "📋 NEXT STEPS:" +echo "" +echo "1ī¸âƒŖ Reload your shell (IMPORTANT):" +echo " source ~/.bashrc" +echo "" +echo "2ī¸âƒŖ Start the LBRY daemon:" +echo " lbrynet start" +echo "" +echo "3ī¸âƒŖ Test the downloader:" +echo " lbry-downloader --dry-run" +echo "" +echo "4ī¸âƒŖ Download content:" +echo " lbry-downloader" +echo "" +echo "💡 If 'lbry-downloader' command not found after reload, use:" +echo " ~/Documents/LBRY-Downloader/bin/lbry-downloader" +echo "" +echo "📁 Config file: ~/Documents/lbry-downloads/config.yaml" echo "" diff --git a/setup.py b/setup.py index 5d162f0..499e1af 100755 --- a/setup.py +++ b/setup.py @@ -442,16 +442,26 @@ python main.py --dry-run "$@" test_script.chmod(0o755) print_success(f"Created test script: {test_script}") - # Check if we should add to PATH + # Automatically add to PATH and reload shell shell_rc = Path.home() / ".bashrc" if not shell_rc.exists(): shell_rc = Path.home() / ".zshrc" if shell_rc.exists(): - print_info( - f"To use 'lbry-downloader' from anywhere, add this to your {shell_rc.name}:" - ) - print(f' export PATH="{bin_dir}:$PATH"') + # Check if already in PATH + path_line = f'export PATH="{bin_dir}:$PATH"' + try: + rc_content = shell_rc.read_text() + if str(bin_dir) not in rc_content: + with open(shell_rc, "a") as f: + f.write(f"\n# LBRY Downloader\n{path_line}\n") + print_success(f"Added to PATH in {shell_rc.name}") + else: + print_info(f"Already in PATH ({shell_rc.name})") + except Exception as e: + print_warning(f"Could not update {shell_rc.name}: {e}") + print_info(f"Add this line manually to {shell_rc.name}:") + print(f" {path_line}") def run_setup() -> None: @@ -542,40 +552,46 @@ def run_setup() -> None: ║ Setup Complete! ║ ╚══════════════════════════════════════════════════════════════╝{Colors.END} -Next steps: +🎉 LBRY Downloader is ready to use! -1. Start the LBRY daemon: - lbrynet start - - (If lbrynet is not installed, see LINUX_SETUP.md) +━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━ +📋 QUICK START (Run these commands): +━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━ -2. Test the configuration: - cd {install_dir} - ./bin/lbry-test - - Or run directly: - source venv/bin/activate - python main.py --dry-run +1ī¸âƒŖ Start the LBRY daemon: + lbrynet start -3. Run the downloader: - ./bin/lbry-downloader - - Or: - python main.py +2ī¸âƒŖ Test your configuration: + lbry-downloader --dry-run -Configuration file: - {config_path} +3ī¸âƒŖ Download content: + lbry-downloader -To add more channels later, edit the config file: - nano {config_path} +━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━ +â„šī¸ IMPORTANT NOTES: +━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━ -Documentation: - - README.md - Project overview - - LINUX_SETUP.md - Detailed Linux setup - - QUICKSTART.md - Quick start guide - - config.yaml.example - Configuration examples +â€ĸ Command to run: {Colors.BOLD}lbry-downloader{Colors.END} +â€ĸ Config file: {config_path} +â€ĸ Download location: {download_location} -Happy downloading! +If {Colors.BOLD}lbry-downloader{Colors.END} command not found, run: + source ~/.bashrc + +If lbrynet is not installed, see LINUX_SETUP.md for installation. + +To add more channels later: + nano {config_path} + +━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━ +📚 Documentation: +━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━ +â€ĸ README.md - Project overview +â€ĸ LINUX_SETUP.md - Detailed Linux setup +â€ĸ QUICKSTART.md - Quick reference +â€ĸ config.yaml.example - More examples + +Happy downloading! 🚀 """)