@@ -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.0 "
21+ $DTC_VERSION = " 3.2.1 "
2222if ($env:DTC_VERSION) { $DTC_VERSION = $env:DTC_VERSION }
2323
2424#here you can specify the URL of a theme to use with generateSite-task
@@ -45,7 +45,7 @@ $distribution_url = "https://github.com/docToolchain/docToolchain/releases/downl
4545$GITHUB_PROJECT_URL = " https://github.com/docToolchain/docToolchain"
4646
4747# Bump this version up if something is changed in the wrapper script
48- $DTCW_VERSION = " 0.52 "
48+ $DTCW_VERSION = " 0.53 "
4949# Template replaced by the GitHub value upon releasing dtcw
5050$DTCW_GIT_HASH = " ##DTCW_GIT_HASH##"
5151
@@ -100,17 +100,29 @@ function main($_args) {
100100 }
101101 # No install command, so forward call to docToolchain but first we check if
102102 # everything is there.
103+ $docker_image_name = " "
103104 if ($environment -ne " docker" )
104105 {
105106 assert_doctoolchain_installed " $environment" " $DTC_VERSION"
106107 assert_java_version_supported
107108 # TODO: what if 'doctoolchain' found by $PATH does not match the one from the local environment?
108109 # The version provided by $DTC_VERSION could be a different one.
110+ } else {
111+ $docker_image_name = " doctoolchain/doctoolchain"
112+ if ( $_args[0] -eq " install" ) {
113+ # shift 1
114+ $null, $_args = $_args
115+ $docker_image_name = $_args[0]
116+ # shift 1
117+ $null, $_args = $_args
118+ assert_argument_exists $_args
119+ }
120+ Write-Output " Using docker image: $docker_image_name"
109121 }
110122 # TODO: can generateDeck, bakePreview be used in combination with other commands?
111123 # The code below assumes we have just one task.
112124
113- $global:command = build_command " $environment" " $DTC_VERSION" $_args
125+ $global:command = build_command " $environment" " $DTC_VERSION" " $docker_image_name " $_args
114126
115127 #TODO: implement HEADLESS mode
116128 # [[ " ${DTC_HEADLESS}" = true ]] && echo " Using headless mode since there is no (terminal) interaction possible"
@@ -550,7 +562,7 @@ Java runtime (major version 11, 14 or 17) installed on your host.
550562" @
551563}
552564
553- function build_command($environment, $version, $_args) {
565+ function build_command($environment, $version, $docker_image, $ _args) {
554566 $cmd = " "
555567 if ( $environment -eq " docker" ) {
556568 if (-not (Invoke-Expression " docker ps" )) {
@@ -568,7 +580,7 @@ function build_command($environment, $version, $_args) {
568580
569581 # TODO: DTC_PROJECT_BRANCH is not passed into the docker environment
570582 # See https://github.com/docToolchain/docToolchain/issues/1087
571- $docker_args = " run --rm -i --name ${container_name} -e DTC_HEADLESS=1 -e DTC_SITETHEME -e DTC_PROJECT_BRANCH=${DTC_PROJECT_BRANCH} --entrypoint /bin/bash -v '${PWD}:/project' doctoolchain/doctoolchain :v${version}"
583+ $docker_args = " run --rm -i --name ${container_name} -e DTC_HEADLESS=1 -e DTC_SITETHEME -e DTC_PROJECT_BRANCH=${DTC_PROJECT_BRANCH} --entrypoint /bin/bash -v '${PWD}:/project' ${docker_image} :v${version}"
572584 $cmd = " $docker_cmd ${docker_args} -c " " doctoolchain . $_args ${DTC_OPTS} && exit " " "
573585
574586 } else {
0 commit comments