Skip to content

Tools provided for Scoop, replace with a specified proxy URL when downloading apps to improve download speed.

License

Notifications You must be signed in to change notification settings

abgox/scoop-tools

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

43 Commits
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

scoop-tools

简体中文 | English | Github | Gitee

github stars license code size repo size created


Star ⭐️ or Donate 💰 if you like it!

Introduction

  • Tools provided for Scoop that allow you to use a replaced URL instead of the original URL when downloading applications via Scoop.
  • You can use them to replace URLs in a specified format, thereby optimizing the download through a proxy address.
  • Typical case: Replace https://github.com and https://raw.githubusercontent.com with proxy addresses, refer to Usage.

Installation

  • Add the abyss bucket via Github or Gitee.

    scoop bucket add abyss https://gitee.com/abgox/abyss
    scoop bucket add abyss https://github.com/abgox/abyss
  • Install scoop-install

    scoop install abyss/abgox.scoop-install
  • Install scoop-update

    scoop install abyss/abgox.scoop-update

Usage

Tip

Scoop Config

  • abgox-scoop-install-url-replace-from: The URL to replace, use regular expressions. Use ^ to match the beginning of the URL.
  • abgox-scoop-install-url-replace-to: The replacement URL that corresponds to abgox-scoop-install-url-replace-from.
  1. Set URL replacement configurations. Use ||| as a delimiter if there are multiple values.

    scoop config abgox-scoop-install-url-replace-from "^https://github.com|||^https://raw.githubusercontent.com"
    scoop config abgox-scoop-install-url-replace-to "https://gh-proxy.com/github.com|||https://gh-proxy.com/raw.githubusercontent.com"
  2. Install PSCompletions to add command completion.

    scoop install abyss/abgox.PSCompletions
    Import-Module PSCompletions
    psc add scoop-install scoop-update
  3. Install apps using the scoop-install command.

    scoop-install abyss/abgox.scoop-i18n
  4. Update apps using the scoop-update command.

    scoop-update abyss/abgox.scoop-i18n

  • scoop-install supports the -reset parameter and all parameters of the scoop install command.

  • scoop-update supports the -reset parameter and all parameters of the scoop update command.

  • Examples:

    • If you want to undo all local file changes in the buckets to avoid synchronization conflicts during scoop update.

      • It uses git stash to undo.

      • If you still need these changes, you can use git stash pop.

      • For details, refer to git stash.

        scoop-install -reset
    • If you want to install abyss/abgox.InputTip-zip without updating Scoop, you can use -u or --no-update-scoop.

      scoop-install abyss/abgox.scoop-i18n -u
    • If you don't also want to use the download cache, you can use -k or --no-cache.

      scoop-install abyss/abgox.scoop-i18n -u --no-cache

How It Works

Tip

  • Take scoop-install as an example.
  • When you run scoop-install abyss/abgox.scoop-i18n, it goes through the following process:
  1. scoop-install reads the following two configuration values:

    • abgox-scoop-install-url-replace-from
    • abgox-scoop-install-url-replace-to
  2. It replaces url in the manifest file of abyss/abgox.scoop-i18n based on these configurations.

    • For example, if you use the following configuration:

      • abgox-scoop-install-url-replace-from is set to ^https://github.com|||^https://raw.githubusercontent.com
      • abgox-scoop-install-url-replace-to is set to https://gh-proxy.com/github.com|||https://gh-proxy.com/raw.githubusercontent.com
    • It will split the values by ||| and replace the url accordingly:

      • ^https://github.com matches url starting with https://github.com and replaces them with https://gh-proxy.com/github.com.
      • ^https://raw.githubusercontent.com is replaced with https://gh-proxy.com/raw.githubusercontent.com.
  3. After replacement, scoop-install runs the actual scoop install command.

    • Since url of the manifest have been replaced with https://gh-proxy.com, Scoop will download the installation packages from https://gh-proxy.com.
  4. Once the installation is complete (or interrupted with Ctrl + C), scoop-install automatically undos the changes made to the manifest file.

    • If you close the terminal during installation, it cannot undo the changes.

    • This may cause issues with scoop update due to local file modifications conflicting with the remote bucket.

    • In that case, you can run scoop-install -reset, which will undo local file changes in all buckets via git stash.

      • It uses git stash to undo.
      • If you still need these changes, you can use git stash pop.
      • For details, refer to git stash

About

Tools provided for Scoop, replace with a specified proxy URL when downloading apps to improve download speed.

Topics

Resources

License

Code of conduct

Stars

Watchers

Forks

Releases

No releases published

Sponsor this project