Skip to content

Commit 5de7c63

Browse files
author
github-action
committed
new update of dtcw
1 parent d690658 commit 5de7c63

3 files changed

Lines changed: 20 additions & 7 deletions

File tree

dtcw

Lines changed: 16 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -12,7 +12,10 @@ set -o pipefail
1212

1313
# See https://github.com/docToolchain/docToolchain/releases for available versions.
1414
# Set DTC_VERSION to "latest" to get the latest, yet unreleased version.
15-
: "${DTC_VERSION:=3.2.2}"
15+
: "${DTC_VERSION:=3.3.1}"
16+
17+
# if not set, public docker hub is used
18+
: "${DTC_DOCKER_PREFIX:=}"
1619

1720
# The 'generateSite' and 'copyThemes' tasks support DTC_SITETHEME, an URL of a theme.
1821
# export DTC_SITETHEME=https://....zip
@@ -219,6 +222,11 @@ get_dtc_installations() {
219222

220223
if [ -x "${DTC_HOME}/bin/doctoolchain" ]; then
221224
installations+=" local"
225+
else
226+
# maybe it is just available in the path
227+
if command -v doctoolchain >/dev/null 2>&1; then
228+
installations+=" local"
229+
fi
222230
fi
223231

224232
if [[ "${envs}" =~ sdk ]] && sdk_home_doctoolchain "${version}" &> /dev/null ; then
@@ -624,7 +632,7 @@ build_command() {
624632
docker_args="run --rm -i --platform linux/amd64 -u $(id -u):$(id -g) --name ${container_name} \
625633
-e DTC_HEADLESS=true -e DTC_SITETHEME -e DTC_PROJECT_BRANCH=${DTC_PROJECT_BRANCH} \
626634
${docker_extra_arguments} ${env_file_option} \
627-
--entrypoint /bin/bash -v '${pwd}:/project' ${docker_image}:v${version}"
635+
--entrypoint /bin/bash -v '${pwd}:/project' ${DTC_DOCKER_PREFIX}${docker_image}:v${version}"
628636

629637
cmd="docker ${docker_args} -c \"doctoolchain . ${*} ${DTC_OPTS} && exit\""
630638
else
@@ -634,7 +642,12 @@ build_command() {
634642
DTC_OPTS="${DTC_OPTS} '-Dgradle.user.home=${DTC_ROOT}/.gradle'"
635643
fi
636644
if [ "${env}" = local ]; then
637-
cmd="${DTC_HOME}/bin/doctoolchain . ${*} ${DTC_OPTS}"
645+
# is doctoolchain available on the path?
646+
if command -v doctoolchain >/dev/null 2>&1; then
647+
cmd="doctoolchain . ${*} ${DTC_OPTS}"
648+
else
649+
cmd="${DTC_HOME}/bin/doctoolchain . ${*} ${DTC_OPTS}"
650+
fi
638651
else
639652
cmd="$(sdk_home_doctoolchain "${version}")/bin/doctoolchain . ${*} ${DTC_OPTS}"
640653
fi

dtcw.bat

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -18,7 +18,7 @@ $ErrorActionPreference = "Stop"
1818

1919
# See https://github.com/docToolchain/docToolchain/releases for available versions.
2020
# Set DTC_VERSION to "latest" to get the latest, yet unreleased version.
21-
$DTC_VERSION = "3.2.2"
21+
$DTC_VERSION = "3.3.1"
2222
if ($env:DTC_VERSION) { $DTC_VERSION = $env:DTC_VERSION }
2323

2424
#here you can specify the URL of a theme to use with generateSite-task
@@ -37,7 +37,7 @@ if ($env:DTC_CONFIG_FILE) { $DTC_CONFIG_FILE = $env:DTC_CONFIG_FILE }
3737
if (Test-Path ".git" ) { $env:DTCW_PROJECT_BRANCH = (git branch --show-current) } else { $env:DTCW_PROJECT_BRANCH = "" }
3838

3939
# Options passed to docToolchain
40-
$DTC_OPTS = "$env:DTC_OPTS -PmainConfigFile='$DTC_CONFIG_FILE' --warning-mode=none --no-daemon -Dfile.encoding=UTF-8 "
40+
$DTC_OPTS = "$env:DTC_OPTS -PmainConfigFile='$DTC_CONFIG_FILE' --warning-mode=none --no-daemon '-Dfile.encoding=UTF-8' "
4141

4242
$distribution_url = "https://github.com/docToolchain/docToolchain/releases/download/v$DTC_VERSION/docToolchain-$DTC_VERSION.zip"
4343

dtcw.ps1

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -9,7 +9,7 @@ $ErrorActionPreference = "Stop"
99

1010
# See https://github.com/docToolchain/docToolchain/releases for available versions.
1111
# Set DTC_VERSION to "latest" to get the latest, yet unreleased version.
12-
$DTC_VERSION = "3.2.2"
12+
$DTC_VERSION = "3.3.1"
1313
if ($env:DTC_VERSION) { $DTC_VERSION = $env:DTC_VERSION }
1414

1515
#here you can specify the URL of a theme to use with generateSite-task
@@ -28,7 +28,7 @@ if ($env:DTC_CONFIG_FILE) { $DTC_CONFIG_FILE = $env:DTC_CONFIG_FILE }
2828
if (Test-Path ".git" ) { $env:DTCW_PROJECT_BRANCH = (git branch --show-current) } else { $env:DTCW_PROJECT_BRANCH = "" }
2929

3030
# Options passed to docToolchain
31-
$DTC_OPTS = "$env:DTC_OPTS -PmainConfigFile='$DTC_CONFIG_FILE' --warning-mode=none --no-daemon -Dfile.encoding=UTF-8 "
31+
$DTC_OPTS = "$env:DTC_OPTS -PmainConfigFile='$DTC_CONFIG_FILE' --warning-mode=none --no-daemon '-Dfile.encoding=UTF-8' "
3232

3333
$distribution_url = "https://github.com/docToolchain/docToolchain/releases/download/v$DTC_VERSION/docToolchain-$DTC_VERSION.zip"
3434

0 commit comments

Comments
 (0)