Skip to content

Commit

Permalink
new update of dtcw
Browse files Browse the repository at this point in the history
  • Loading branch information
github-action committed Mar 18, 2024
1 parent d690658 commit 5de7c63
Show file tree
Hide file tree
Showing 3 changed files with 20 additions and 7 deletions.
19 changes: 16 additions & 3 deletions dtcw
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,10 @@ set -o pipefail

# See https://github.com/docToolchain/docToolchain/releases for available versions.
# Set DTC_VERSION to "latest" to get the latest, yet unreleased version.
: "${DTC_VERSION:=3.2.2}"
: "${DTC_VERSION:=3.3.1}"

# if not set, public docker hub is used
: "${DTC_DOCKER_PREFIX:=}"

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

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

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

cmd="docker ${docker_args} -c \"doctoolchain . ${*} ${DTC_OPTS} && exit\""
else
Expand All @@ -634,7 +642,12 @@ build_command() {
DTC_OPTS="${DTC_OPTS} '-Dgradle.user.home=${DTC_ROOT}/.gradle'"
fi
if [ "${env}" = local ]; then
cmd="${DTC_HOME}/bin/doctoolchain . ${*} ${DTC_OPTS}"
# is doctoolchain available on the path?
if command -v doctoolchain >/dev/null 2>&1; then
cmd="doctoolchain . ${*} ${DTC_OPTS}"
else
cmd="${DTC_HOME}/bin/doctoolchain . ${*} ${DTC_OPTS}"
fi
else
cmd="$(sdk_home_doctoolchain "${version}")/bin/doctoolchain . ${*} ${DTC_OPTS}"
fi
Expand Down
4 changes: 2 additions & 2 deletions dtcw.bat
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,7 @@ $ErrorActionPreference = "Stop"

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

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

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

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

Expand Down
4 changes: 2 additions & 2 deletions dtcw.ps1
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@ $ErrorActionPreference = "Stop"

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

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

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

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

Expand Down

0 comments on commit 5de7c63

Please sign in to comment.