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 Nov 3, 2023
1 parent fa10943 commit eddde9b
Show file tree
Hide file tree
Showing 3 changed files with 21 additions and 18 deletions.
31 changes: 17 additions & 14 deletions dtcw
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@ 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.0.2}"
: "${DTC_VERSION:=3.1.0}"

# The 'generateSite' and 'copyThemes' tasks support DTC_SITETHEME, an URL of a theme.
# export DTC_SITETHEME=https://....zip
Expand Down Expand Up @@ -54,6 +54,7 @@ main() {
# For debugging purpose at the top of the script
arch=$(uname -m)
os=$(uname -s)
bash=bash

print_version_info

Expand Down Expand Up @@ -103,12 +104,13 @@ main() {

emu=""
if [ "${os}" = "Darwin" ] && [ "${arch}" = "arm64" ]; then
echo "Apple silicon detected, using x86_64 mode"
echo "Apple silicon detected, using x86_64 mode and os native bash"
emu="arch -x86_64"
bash="/bin/bash"
fi

# echo "Command to invoke: ${command}"
exec ${emu} bash -c "${command}"
exec ${emu} ${bash} -c "${command}"
}

assert_argument_exists() {
Expand Down Expand Up @@ -433,17 +435,18 @@ download_file() {

assert_java_version_supported() {
# Defines the order in which Java is searched.
if [ -n "${JAVA_HOME-}" ]; then
JAVA_CMD="${JAVA_HOME}/bin/java"
elif [ -d "${DTC_JAVA_HOME}" ]; then
if [ -d "${DTC_JAVA_HOME}/Contents" ]; then
# JDK for MacOS have a different structure
JAVA_HOME="${DTC_JAVA_HOME}/Contents/Home"
else
JAVA_HOME="${DTC_JAVA_HOME}"
fi
export JAVA_HOME
DTC_OPTS="${DTC_OPTS} '-Dorg.gradle.java.home=${JAVA_HOME}'"
if [ -d "${DTC_JAVA_HOME}" ]; then
echo "Caution: Your JAVA_HOME setting is overriden by DTCs own JDK install (for this execution)"
if [ -d "${DTC_JAVA_HOME}/Contents" ]; then
# JDK for MacOS have a different structure
JAVA_HOME="${DTC_JAVA_HOME}/Contents/Home"
else
JAVA_HOME="${DTC_JAVA_HOME}"
fi
export JAVA_HOME
DTC_OPTS="${DTC_OPTS} '-Dorg.gradle.java.home=${JAVA_HOME}'"
JAVA_CMD="${JAVA_HOME}/bin/java"
elif [ -n "${JAVA_HOME-}" ]; then
JAVA_CMD="${JAVA_HOME}/bin/java"
else
# Don't provide JAVA_HOME if java is used by PATH.
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.0.2"
$DTC_VERSION = "3.1.0"
if ($env:DTC_VERSION) { $DTC_VERSION = $env:DTC_VERSION }

#here you can specify the URL of a theme to use with generateSite-task
Expand Down Expand Up @@ -551,7 +551,7 @@ function build_command($environment, $version, $_args) {
Write-Output ""
exit 1
}
$container_name="doctoolchain-${version}-$(date '+%Y%m%d_%H%M%S')"
$container_name="doctoolchain-${version}-$(date -uFormat '+%Y%m%d_%H%M%S')"
$docker_cmd = Get-Command docker
# TODO: DTC_PROJECT_BRANCH is not passed into the docker environment
# See https://github.com/docToolchain/docToolchain/issues/1087
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.0.2"
$DTC_VERSION = "3.1.0"
if ($env:DTC_VERSION) { $DTC_VERSION = $env:DTC_VERSION }

#here you can specify the URL of a theme to use with generateSite-task
Expand Down Expand Up @@ -542,7 +542,7 @@ function build_command($environment, $version, $_args) {
Write-Output ""
exit 1
}
$container_name="doctoolchain-${version}-$(date '+%Y%m%d_%H%M%S')"
$container_name="doctoolchain-${version}-$(date -uFormat '+%Y%m%d_%H%M%S')"
$docker_cmd = Get-Command docker
# TODO: DTC_PROJECT_BRANCH is not passed into the docker environment
# See https://github.com/docToolchain/docToolchain/issues/1087
Expand Down

0 comments on commit eddde9b

Please sign in to comment.