Skip to content

Commit

Permalink
Revert "Add checkfiles"
Browse files Browse the repository at this point in the history
This reverts commit c9ea966.
  • Loading branch information
KonstantinTyukalov committed Oct 8, 2024
1 parent c9ea966 commit a980bf5
Showing 1 changed file with 8 additions and 35 deletions.
43 changes: 8 additions & 35 deletions src/dev.sh
Original file line number Diff line number Diff line change
Expand Up @@ -85,51 +85,24 @@ restore_dotnet_install_script() {
function restore_sdk_and_runtime() {
heading "Install .NET SDK ${DOTNET_SDK_VERSION} and Runtime ${DOTNET_RUNTIME_VERSION}"

readonly DOTNET_SDK_INSTALL_CHECKFILE="${DOTNET_DIR}/.sdk.${DOTNET_SDK_VERSION}"
readonly DOTNET_RUNTIME_INSTALL_CHECKFILE="${DOTNET_DIR}/.runtime.${DOTNET_RUNTIME_VERSION}"

if [[ "${CURRENT_PLATFORM}" == "windows" ]]; then
echo "Convert ${DOTNET_DIR} to Windows style path"
local dotnet_windows_dir=${DOTNET_DIR:1}
dotnet_windows_dir=${dotnet_windows_dir:0:1}:${dotnet_windows_dir:1}
local architecture
architecture=$(echo "$RUNTIME_ID" | cut -d "-" -f2)

if [[ (! -e "${DOTNET_SDK_INSTALL_CHECKFILE}") ]]; then
printf "\nInstalling SDK...\n"
powershell -NoLogo -Sta -NoProfile -NonInteractive -ExecutionPolicy Unrestricted -Command "& \"${DOTNET_INSTALL_SCRIPT_PATH}\" -Version ${DOTNET_SDK_VERSION} -InstallDir \"${dotnet_windows_dir}\" -Architecture ${architecture} -NoPath; exit \$LastExitCode;" || checkRC "${DOTNET_INSTALL_SCRIPT_NAME} (SDK)"

echo "${DOTNET_SDK_VERSION}" >"${DOTNET_SDK_INSTALL_CHECKFILE}"
else
printf "\nSDK already installed.\n"
fi
printf "\nInstalling SDK...\n"
powershell -NoLogo -Sta -NoProfile -NonInteractive -ExecutionPolicy Unrestricted -Command "& \"${DOTNET_INSTALL_SCRIPT_PATH}\" -Version ${DOTNET_SDK_VERSION} -InstallDir \"${dotnet_windows_dir}\" -Architecture ${architecture} -NoPath; exit \$LastExitCode;" || checkRC "${DOTNET_INSTALL_SCRIPT_NAME} (SDK)"

if [[ (! -e "${DOTNET_RUNTIME_INSTALL_CHECKFILE}") ]]; then
printf "\nInstalling Runtime...\n"
powershell -NoLogo -Sta -NoProfile -NonInteractive -ExecutionPolicy Unrestricted -Command "& \"${DOTNET_INSTALL_SCRIPT_PATH}\" -Runtime dotnet -Version ${DOTNET_RUNTIME_VERSION} -InstallDir \"${dotnet_windows_dir}\" -Architecture ${architecture} -NoPath; exit \$LastExitCode;" || checkRC "${DOTNET_INSTALL_SCRIPT_NAME} (Runtime)"

echo "${DOTNET_RUNTIME_VERSION}" >"${DOTNET_RUNTIME_INSTALL_CHECKFILE}"
else
printf "n\Runtime already installed.\n"
fi
printf "\nInstalling Runtime...\n"
powershell -NoLogo -Sta -NoProfile -NonInteractive -ExecutionPolicy Unrestricted -Command "& \"${DOTNET_INSTALL_SCRIPT_PATH}\" -Runtime dotnet -Version ${DOTNET_RUNTIME_VERSION} -InstallDir \"${dotnet_windows_dir}\" -Architecture ${architecture} -NoPath; exit \$LastExitCode;" || checkRC "${DOTNET_INSTALL_SCRIPT_NAME} (Runtime)"
else
if [[ (! -e "${DOTNET_SDK_INSTALL_CHECKFILE}") ]]; then
printf "\nInstalling SDK...\n"
bash "${DOTNET_INSTALL_SCRIPT_PATH}" --version "${DOTNET_SDK_VERSION}" --install-dir "${DOTNET_DIR}" --no-path || checkRC "${DOTNET_INSTALL_SCRIPT_NAME} (SDK)"
printf "\nInstalling SDK...\n"
bash "${DOTNET_INSTALL_SCRIPT_PATH}" --version "${DOTNET_SDK_VERSION}" --install-dir "${DOTNET_DIR}" --no-path || checkRC "${DOTNET_INSTALL_SCRIPT_NAME} (SDK)"

echo "${DOTNET_SDK_VERSION}" >"${DOTNET_SDK_INSTALL_CHECKFILE}"
else
printf "\nSDK already installed.\n"
fi

if [[ (! -e "${DOTNET_RUNTIME_INSTALL_CHECKFILE}") ]]; then
printf "\nInstalling Runtime...\n"
bash "${DOTNET_INSTALL_SCRIPT_PATH}" --runtime dotnet --version "${DOTNET_RUNTIME_VERSION}" --install-dir "${DOTNET_DIR}" --no-path || checkRC "${DOTNET_INSTALL_SCRIPT_NAME} (Runtime)"

echo "${DOTNET_RUNTIME_VERSION}" >"${DOTNET_RUNTIME_INSTALL_CHECKFILE}"
else
printf "n\Runtime already installed.\n"
fi
printf "\nInstalling Runtime...\n"
bash "${DOTNET_INSTALL_SCRIPT_PATH}" --runtime dotnet --version "${DOTNET_RUNTIME_VERSION}" --install-dir "${DOTNET_DIR}" --no-path || checkRC "${DOTNET_INSTALL_SCRIPT_NAME} (Runtime)"
fi
}

Expand Down

0 comments on commit a980bf5

Please sign in to comment.