Skip to content

Commit

Permalink
Created an option to toggle the youtube-pu update checker.
Browse files Browse the repository at this point in the history
  • Loading branch information
ThePirate42 committed Nov 25, 2020
1 parent f41cffd commit a136c2e
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 3 deletions.
4 changes: 2 additions & 2 deletions youtube-pu/youtube-pu.bat
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@ set _version=git
if NOT exist %~dp0youtube-pu.conf echo youtube-pu.conf not found! & goto :end
setlocal EnableDelayedExpansion
for /F "tokens=*" %%g in (%~dp0youtube-pu.conf) do (%%g)
endlocal & set "_buildpath=%_buildpath%" & set "_default_youtube-dl_path=%_default_youtube-dl_path%" & set "_enable_cmdow=%_enable_cmdow%" & set "_update_pyinstaller=%_update_pyinstaller%" & set "_pull_patches=%_pull_patches%" & set "_python_version=%_python_version%"
endlocal & set "_buildpath=%_buildpath%" & set "_default_youtube-dl_path=%_default_youtube-dl_path%" & set "_enable_cmdow=%_enable_cmdow%" & set "_update_pyinstaller=%_update_pyinstaller%" & set "_pull_patches=%_pull_patches%" & set "_python_version=%_python_version%" & set "_check_youtube-pu_version=%_check_youtube-pu_version%"

:: Dependency check

Expand Down Expand Up @@ -41,7 +41,7 @@ if "true"=="%_enable_cmdow%" cmdow @ /MAX
:: Check for youtube-pu updates

for /F "tokens=*" %%h in ('curl -sS -H "Accept: application/vnd.github.v3+json" https://api.github.com/repos/thepirate42/youtube-pu/releases/latest ^| jq -r .tag_name') do (set _currentscriptversion=%%h)
if NOT %_version%==git (if NOT %_version%==%_currentscriptversion% echo A new youtube-pu version [%_currentscriptversion%] is available!)
if "true"=="%_check_youtube-pu_version%" (if NOT %_version%==git (if NOT %_version%==%_currentscriptversion% echo A new youtube-pu version [%_currentscriptversion%] is available!))

:: I know, the following code contains too much goto, sorry!

Expand Down
5 changes: 4 additions & 1 deletion youtube-pu/youtube-pu.conf
Original file line number Diff line number Diff line change
Expand Up @@ -34,4 +34,7 @@ rem X-32 Use the latest 32bit Python X version
rem X.Y-64 Use the specified 64bit Python version
rem X-64 Use the latest 64bit Python X version
rem Example: set _python_version=3.9
set _python_version=
set _python_version=
rem
rem If this option is set to true, the script will display a message when a new version of youtube-pu is available.
set _check_youtube-pu_version=true

0 comments on commit a136c2e

Please sign in to comment.