mirror of
https://github.com/DrewThomasson/ebook2audiobook.git
synced 2026-01-09 13:58:14 -05:00
v25.12.27
This commit is contained in:
@@ -1 +1 @@
|
||||
25.12.25
|
||||
25.12.27
|
||||
@@ -528,13 +528,6 @@ exit /b 0
|
||||
|
||||
:build_docker_image
|
||||
set "ARG=%~1"
|
||||
if "%DEVICE_TAG%"=="" (
|
||||
for /f "usebackq delims=" %%A in (`powershell -NoLogo -Command "(ConvertFrom-Json '%ARG%').tag"`) do (
|
||||
set "TAG=%%A"
|
||||
)
|
||||
) else (
|
||||
set "TAG=%DEVICE_TAG%"
|
||||
)
|
||||
"%PS_EXE%" %PS_ARGS% -command "if (!(Get-Command docker -ErrorAction SilentlyContinue)) { Write-Host '=============== Error: Docker must be installed and running!' -ForegroundColor Red; exit 1 }"
|
||||
if errorlevel 1 exit /b 1
|
||||
"%PS_EXE%" %PS_ARGS% -command "if (docker compose version > $null 2>&1) { exit 0 } else { exit 1 }"
|
||||
@@ -635,15 +628,22 @@ if defined arguments.help (
|
||||
)
|
||||
call :check_docker
|
||||
if errorlevel 1 goto :failed
|
||||
call docker image inspect "%DOCKER_IMG_NAME%" >nul 2>&1
|
||||
if errorlevel 0 (
|
||||
echo [STOP] Docker image '%DOCKER_IMG_NAME%' already exists. Aborting build.
|
||||
echo Delete it using: docker rmi %DOCKER_IMG_NAME%
|
||||
goto :failed
|
||||
)
|
||||
call :check_device_info "%SCRIPT_MODE%"
|
||||
set "deviceinfo=%errorlevel%"
|
||||
if errorlevel 1 goto :failed
|
||||
if "%DEVICE_TAG%"=="" (
|
||||
for /f "usebackq delims=" %%A in (`powershell -NoLogo -Command "(ConvertFrom-Json '%deviceinfo%').tag"`) do (
|
||||
set "TAG=%%A"
|
||||
)
|
||||
) else (
|
||||
set "TAG=%DEVICE_TAG%"
|
||||
)
|
||||
call docker image inspect "%DOCKER_IMG_NAME%:%TAG%" >nul 2>&1
|
||||
if errorlevel 0 (
|
||||
echo [STOP] Docker image '%DOCKER_IMG_NAME%:%TAG%' already exists. Aborting build.
|
||||
echo Delete it using: docker rmi %DOCKER_IMG_NAME%:%TAG% --force
|
||||
goto :failed
|
||||
)
|
||||
call :build_docker_image "%deviceinfo%"
|
||||
if errorlevel 1 goto :failed
|
||||
) else (
|
||||
|
||||
@@ -716,11 +716,6 @@ function build_docker_image {
|
||||
echo "build_docker_image() error: ARG is empty"
|
||||
return 1
|
||||
fi
|
||||
if ! command -v docker >/dev/null 2>&1; then
|
||||
echo -e "\e[31m=============== Error: Docker must be installed and running!.\e[0m"
|
||||
return 1
|
||||
fi
|
||||
local TAG=${DEVICE_TAG:-$(python3 -c 'import json,sys; print(json.loads(sys.argv[1])["tag"])' "$ARG")}
|
||||
local cmd_options=""
|
||||
local cmd_extra=""
|
||||
local py_vers="$PYTHON_VERSION"
|
||||
@@ -784,16 +779,17 @@ else
|
||||
if [[ "$SCRIPT_MODE" == "$BUILD_DOCKER" ]]; then
|
||||
if [[ "$DOCKER_DEVICE_STR" == "" ]]; then
|
||||
check_docker || exit 1
|
||||
if docker image inspect "$DOCKER_IMG_NAME" >/dev/null 2>&1; then
|
||||
echo "[STOP] Docker image '$DOCKER_IMG_NAME' already exists. Aborting build."
|
||||
echo "Delete it using: docker rmi $DOCKER_IMG_NAME"
|
||||
exit 1
|
||||
fi
|
||||
device_info_str="$(check_device_info "${SCRIPT_MODE}")"
|
||||
if [[ "$device_info_str" == "" ]]; then
|
||||
echo "check_device_info() error: result is empty"
|
||||
exit 1
|
||||
fi
|
||||
TAG=${DEVICE_TAG:-$(python3 -c 'import json,sys; print(json.loads(sys.argv[1])["tag"])' "$device_info_str")}
|
||||
if docker image inspect "${DOCKER_IMG_NAME}:${TAG}" >/dev/null 2>&1; then
|
||||
echo "[STOP] Docker image '${DOCKER_IMG_NAME}:${TAG}' already exists. Aborting build."
|
||||
echo "Delete it using: docker rmi ${DOCKER_IMG_NAME}:${TAG} --force"
|
||||
exit 1
|
||||
fi
|
||||
build_docker_image "$device_info_str" || exit 1
|
||||
elif [[ "$DOCKER_DEVICE_STR" != "" ]];then
|
||||
install_python_packages || exit 1
|
||||
|
||||
Reference in New Issue
Block a user