Last active
August 16, 2022 01:53
-
-
Save quienn/cee1332c17f6cf32e2928f92cdd023c1 to your computer and use it in GitHub Desktop.
lite's Plugin Manager for Windows
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
@ECHO OFF | |
SET GITHUB_URL=https://raw.githubusercontent.com/rxi/lite-plugins/master/plugins | |
SET PLUGIN_DIR=%ProgramFiles%\lite\data\plugins | |
SET /A DOWNLOAD_COUNT=0 | |
:main | |
FOR /F "tokens=*" %%A in (%USERPROFILE%\.lite_plugins) do ( | |
IF EXIST "%PLUGIN_DIR%\%%A.lua" ( | |
IF "%~1"=="" ( | |
ECHO Skipping %%A... | |
) ELSE ( | |
IF "%~1"=="refresh" ( | |
CALL :download_file "%%A" "%GITHUB_URL%/%%A.lua" "%PLUGIN_DIR%\%%A.lua" | |
) ELSE ( | |
ECHO Unknown command %~1 | |
EXIT /B 1 | |
) | |
) | |
) ELSE ( | |
CALL :download_file "%%A" "%GITHUB_URL%/%%A.lua" "%PLUGIN_DIR%\%%A.lua" | |
) | |
) | |
IF "%~1%"=="refresh" ( | |
ECHO Refreshed %DOWNLOAD_COUNT% plugins. | |
) ELSE ( | |
ECHO Installed %DOWNLOAD_COUNT% plugins. | |
) | |
EXIT /B | |
:download_file | |
bitsadmin /TRANSFER %~1 /DOWNLOAD /PRIORITY normal %~2 "%~3" | |
SET /A DOWNLOAD_COUNT=%DOWNLOAD_COUNT%+1 | |
EXIT /B |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Limitations: It only supports plugins from rxi's repo. I'm planning on adding third-party repos support. I'm currently using this for my own lite setup and I haven't found any issues yet. 😁