From 522af536c18f6e7bf8b9a174d5252f15cedd8dce Mon Sep 17 00:00:00 2001 From: "(Holloway) Chew, Kean Ho" Date: Fri, 21 Jun 2024 17:17:04 +0800 Subject: [PATCH] root: added DOTNET's nupkg implementations Since DOTNET's nupkg is quite simple to create and to upstream, it's best we support it from the start. Besides, the Chocolatey is one of the nupkg implementations so no worries. This patch adds DOTNET's nupkg implementations in root repository. Co-authored-by: Shuralyov, Jean Co-authored-by: Galyna, Cory Co-authored-by: (Holloway) Chew, Kean Ho Signed-off-by: (Holloway) Chew, Kean Ho --- CONFIG.toml | 56 ++- automataCI/SECRETS-template.toml | 11 + automataCI/_package-chocolatey_unix-any.sh | 30 +- .../_package-chocolatey_windows-any.ps1 | 21 +- automataCI/_release-citation_unix-any.sh | 4 +- automataCI/_release-citation_windows-any.ps1 | 4 +- automataCI/_release-lib_unix-any.sh | 16 +- automataCI/_release-lib_windows-any.ps1 | 18 +- automataCI/_release-nupkg_unix-any.sh | 56 +++ automataCI/_release-nupkg_windows-any.ps1 | 60 +++ automataCI/_release-research_unix-any.sh | 1 + automataCI/_release-research_windows-any.ps1 | 1 + automataCI/release_unix-any.sh | 7 + automataCI/release_windows-any.ps1 | 6 + automataCI/services/compilers/deb.ps1 | 4 +- automataCI/services/compilers/deb.sh | 6 +- automataCI/services/hestiaCONSOLE/Log.sh.ps1 | 210 +++++++++ .../services/hestiaCONSOLE/Log_Publish.sh.ps1 | 96 ++++ .../hestiaCONSOLE/Log_Publish_Failed.sh.ps1 | 98 ++++ .../hestiaCONSOLE/Log_Publish_Simulate.sh.ps1 | 98 ++++ .../services/hestiaCONSOLE/Vanilla.sh.ps1 | 60 +++ automataCI/services/hestiaFS/Get_File.sh.ps1 | 97 ++++ automataCI/services/hestiaFS/Vanilla.sh.ps1 | 54 +++ .../services/hestiaHTTP/Is_Available.sh.ps1 | 84 ++++ automataCI/services/hestiaHTTP/Vanilla.sh.ps1 | 54 +++ ...anslate_All_Components_Description.sh.ps1} | 0 ... => Translate_All_Components_Title.sh.ps1} | 0 ...> Translate_Already_Latest_Version.sh.ps1} | 0 ...anslate_Bin_Components_Description.sh.ps1} | 0 ... => Translate_Bin_Components_Title.sh.ps1} | 0 ...late_Config_Components_Description.sh.ps1} | 0 ... Translate_Config_Components_Title.sh.ps1} | 0 ...nslate_Docs_Components_Description.sh.ps1} | 0 ...=> Translate_Docs_Components_Title.sh.ps1} | 0 .../services/hestiaI18N/Translate_Done.sh.ps1 | 88 ++++ .../hestiaI18N/Translate_Error.sh.ps1 | 88 ++++ .../services/hestiaI18N/Translate_Info.sh.ps1 | 88 ++++ ...anslate_Lib_Components_Description.sh.ps1} | 0 ... => Translate_Lib_Components_Title.sh.ps1} | 0 ...nslate_Main_Components_Description.sh.ps1} | 0 ...=> Translate_Main_Components_Title.sh.ps1} | 0 .../services/hestiaI18N/Translate_Note.sh.ps1 | 88 ++++ .../services/hestiaI18N/Translate_OK.sh.ps1 | 88 ++++ ... Translate_Only_Install_On_Windows.sh.ps1} | 0 .../hestiaI18N/Translate_Publish.sh.ps1 | 94 ++++ .../Translate_Publish_Failed.sh.ps1 | 92 ++++ .../Translate_Publish_Simulate.sh.ps1 | 93 ++++ .../hestiaI18N/Translate_Success.sh.ps1 | 88 ++++ .../hestiaI18N/Translate_Warning.sh.ps1 | 88 ++++ automataCI/services/hestiaI18N/Vanilla.sh.ps1 | 70 +-- .../services/hestiaKERNEL/Error_Codes.sh.ps1 | 422 ++++++++++++++++++ .../services/hestiaKERNEL/Vanilla.sh.ps1 | 54 +++ .../{Get-LCID.sh.ps1 => Get_LCID.sh.ps1} | 0 .../services/hestiaLOCALE/Get_Lang.sh.ps1 | 106 +++++ .../services/hestiaLOCALE/Vanilla.sh.ps1 | 6 +- .../hestiaNUPKG/Is_Target_Valid.sh.ps1 | 122 +++++ .../services/hestiaNUPKG/Publish.sh.ps1 | 133 ++++++ .../services/hestiaNUPKG/Vanilla.sh.ps1 | 56 +++ automataCI/services/hestiaOS/Exec.sh.ps1 | 206 +++++++++ .../hestiaOS/Is_Command_Available.sh.ps1 | 111 +++++ .../hestiaOS/Is_Simulation_Mode.sh.ps1 | 84 ++++ automataCI/services/hestiaOS/Vanilla.sh.ps1 | 58 +++ .../services/hestiaSTRING/Is_Empty.sh.ps1 | 92 ++++ .../services/hestiaSTRING/Vanilla.sh.ps1 | 54 +++ .../services/hestiaZIP/Is_Target_Valid.sh.ps1 | 126 ++++++ automataCI/services/hestiaZIP/Vanilla.sh.ps1 | 54 +++ automataCI/services/io/fs.sh | 2 + automataCI/services/publishers/chocolatey.ps1 | 8 +- src/.ci/_package-chocolatey_unix-any.sh | 46 +- src/.ci/_package-chocolatey_windows-any.ps1 | 43 +- src/.ci/_package-lib_unix-any.sh | 41 +- src/.ci/_package-lib_windows-any.ps1 | 59 ++- 72 files changed, 3875 insertions(+), 125 deletions(-) create mode 100644 automataCI/_release-nupkg_unix-any.sh create mode 100644 automataCI/_release-nupkg_windows-any.ps1 create mode 100755 automataCI/services/hestiaCONSOLE/Log.sh.ps1 create mode 100755 automataCI/services/hestiaCONSOLE/Log_Publish.sh.ps1 create mode 100755 automataCI/services/hestiaCONSOLE/Log_Publish_Failed.sh.ps1 create mode 100755 automataCI/services/hestiaCONSOLE/Log_Publish_Simulate.sh.ps1 create mode 100755 automataCI/services/hestiaCONSOLE/Vanilla.sh.ps1 create mode 100755 automataCI/services/hestiaFS/Get_File.sh.ps1 create mode 100755 automataCI/services/hestiaFS/Vanilla.sh.ps1 create mode 100755 automataCI/services/hestiaHTTP/Is_Available.sh.ps1 create mode 100755 automataCI/services/hestiaHTTP/Vanilla.sh.ps1 rename automataCI/services/hestiaI18N/{Translate-All-Components-Description.sh.ps1 => Translate_All_Components_Description.sh.ps1} (100%) rename automataCI/services/hestiaI18N/{Translate-All-Components-Title.sh.ps1 => Translate_All_Components_Title.sh.ps1} (100%) rename automataCI/services/hestiaI18N/{Translate-Already-Latest-Version.sh.ps1 => Translate_Already_Latest_Version.sh.ps1} (100%) rename automataCI/services/hestiaI18N/{Translate-Bin-Components-Description.sh.ps1 => Translate_Bin_Components_Description.sh.ps1} (100%) rename automataCI/services/hestiaI18N/{Translate-Bin-Components-Title.sh.ps1 => Translate_Bin_Components_Title.sh.ps1} (100%) rename automataCI/services/hestiaI18N/{Translate-Config-Components-Description.sh.ps1 => Translate_Config_Components_Description.sh.ps1} (100%) rename automataCI/services/hestiaI18N/{Translate-Config-Components-Title.sh.ps1 => Translate_Config_Components_Title.sh.ps1} (100%) rename automataCI/services/hestiaI18N/{Translate-Docs-Components-Description.sh.ps1 => Translate_Docs_Components_Description.sh.ps1} (100%) rename automataCI/services/hestiaI18N/{Translate-Docs-Components-Title.sh.ps1 => Translate_Docs_Components_Title.sh.ps1} (100%) create mode 100755 automataCI/services/hestiaI18N/Translate_Done.sh.ps1 create mode 100755 automataCI/services/hestiaI18N/Translate_Error.sh.ps1 create mode 100755 automataCI/services/hestiaI18N/Translate_Info.sh.ps1 rename automataCI/services/hestiaI18N/{Translate-Lib-Components-Description.sh.ps1 => Translate_Lib_Components_Description.sh.ps1} (100%) rename automataCI/services/hestiaI18N/{Translate-Lib-Components-Title.sh.ps1 => Translate_Lib_Components_Title.sh.ps1} (100%) rename automataCI/services/hestiaI18N/{Translate-Main-Components-Description.sh.ps1 => Translate_Main_Components_Description.sh.ps1} (100%) rename automataCI/services/hestiaI18N/{Translate-Main-Components-Title.sh.ps1 => Translate_Main_Components_Title.sh.ps1} (100%) create mode 100755 automataCI/services/hestiaI18N/Translate_Note.sh.ps1 create mode 100755 automataCI/services/hestiaI18N/Translate_OK.sh.ps1 rename automataCI/services/hestiaI18N/{Translate-Only-Install-On-Windows.sh.ps1 => Translate_Only_Install_On_Windows.sh.ps1} (100%) create mode 100755 automataCI/services/hestiaI18N/Translate_Publish.sh.ps1 create mode 100755 automataCI/services/hestiaI18N/Translate_Publish_Failed.sh.ps1 create mode 100755 automataCI/services/hestiaI18N/Translate_Publish_Simulate.sh.ps1 create mode 100755 automataCI/services/hestiaI18N/Translate_Success.sh.ps1 create mode 100755 automataCI/services/hestiaI18N/Translate_Warning.sh.ps1 create mode 100755 automataCI/services/hestiaKERNEL/Error_Codes.sh.ps1 create mode 100755 automataCI/services/hestiaKERNEL/Vanilla.sh.ps1 rename automataCI/services/hestiaLOCALE/{Get-LCID.sh.ps1 => Get_LCID.sh.ps1} (100%) create mode 100755 automataCI/services/hestiaLOCALE/Get_Lang.sh.ps1 create mode 100755 automataCI/services/hestiaNUPKG/Is_Target_Valid.sh.ps1 create mode 100755 automataCI/services/hestiaNUPKG/Publish.sh.ps1 create mode 100755 automataCI/services/hestiaNUPKG/Vanilla.sh.ps1 create mode 100755 automataCI/services/hestiaOS/Exec.sh.ps1 create mode 100755 automataCI/services/hestiaOS/Is_Command_Available.sh.ps1 create mode 100755 automataCI/services/hestiaOS/Is_Simulation_Mode.sh.ps1 create mode 100755 automataCI/services/hestiaOS/Vanilla.sh.ps1 create mode 100755 automataCI/services/hestiaSTRING/Is_Empty.sh.ps1 create mode 100755 automataCI/services/hestiaSTRING/Vanilla.sh.ps1 create mode 100755 automataCI/services/hestiaZIP/Is_Target_Valid.sh.ps1 create mode 100755 automataCI/services/hestiaZIP/Vanilla.sh.ps1 diff --git a/CONFIG.toml b/CONFIG.toml index da0396e..5a496b6 100644 --- a/CONFIG.toml +++ b/CONFIG.toml @@ -268,14 +268,15 @@ PROJECT_BOOK = 'srcBOOK' PROJECT_C = 'srcC' -# PROJECT_C_BRANCH_TAG +# PROJECT_C_ID # This is for technology tagging purposes such as but not limited to release # branches identification. The value shall always be lowercase, short, and -# directly identify it is C technology. +# directly identify as a C-based technology. +# +# This field shall not be EMPTY. # # Default is: 'c' -# To disable: set it empty '' -PROJECT_C_BRANCH_TAG = 'c' +PROJECT_C_ID = 'c' @@ -628,14 +629,15 @@ PROJECT_NODE_VERSION = 'v22.2.0' PROJECT_NODE_NPM_REGISTRY = 'https://npm.pkg.github.com' -# PROJECT_NODE_BRANCH_TAG +# PROJECT_NODE_NPM_ID # This is for technology tagging purposes such as but not limited to release # branches identification. The value shall always be lowercase, short, and -# directly identify it is Node technology. +# directly identify as a Node NPM technology. +# +# This field shall not be EMPTY. # # Default is: 'npm' -# To disable: set it empty '' -PROJECT_NODE_BRANCH_TAG = 'npm' +PROJECT_NODE_NPM_ID = 'npm' @@ -888,8 +890,6 @@ PROJECT_RELEASE_IPK = 'enabled' PROJECT_CHOCOLATEY_URL = 'https://github.com/ChewKeanHo/AutomataCI/releases/latest/download' - - # PROJECT_CHOCOLATEY_VERSION # The Chocolatey version as a dependency. This field SHALL NOT BE EMPTY. # @@ -897,6 +897,18 @@ PROJECT_CHOCOLATEY_URL = 'https://github.com/ChewKeanHo/AutomataCI/releases/late PROJECT_CHOCOLATEY_VERSION = '0.9.8.21' +# PROJECT_CHOCOLATEY_ID +# This is for technology tagging purposes such as but not limited to release +# branches identification. The value shall always be lowercase, short, and +# directly identify as Chocolatey technology (including away from the original +# DOTNET nupkg). +# +# This field shall not be EMPTY. +# +# Default is: 'chocolatey' +PROJECT_CHOCOLATEY_ID = 'chocolatey' + + ############################# @@ -1664,6 +1676,30 @@ PROJECT_MSI_DOCS_COMPONENT_GUID = '7E665EAF-446B-7738-84D9-FE18BE039404' +########################## +# DISTRIBUTION - NUPKG # +########################## +# PROJECT_NUPKG_URL +# The registry url for publishing the DOTNET .nupkg package file. More info: +# (1) https://docs.github.com/en/packages/working-with-a-github-packages-registry/working-with-the-nuget-registry +# (2) https://learn.microsoft.com/en-us/nuget/api/package-publish-resource +# (3) https://learn.microsoft.com/en-us/nuget/api/overview +# +# Some examples: +# (1) GitHub Package: 'https://nuget.pkg.github.com/[USERNAME]' +# (2) Nuget.org : 'https://www.nuget.org/api/v2/package' +# +# This field also acts as the flag for enabling or disabling the nupkg pipeline. +# +# To enable : fill in the end-user downloadable URL without ending slash. +# To disable: leave this field empty (''). +# +# !! IMPORTANT !! - Please avoid ending with the URL slash. +PROJECT_NUPKG_URL = 'https://nuget.pkg.github.com/ChewKeanHo' + + + + ########################## # DISTRIBUTION - RPM # ########################## diff --git a/automataCI/SECRETS-template.toml b/automataCI/SECRETS-template.toml index f45f490..ad8263c 100644 --- a/automataCI/SECRETS-template.toml +++ b/automataCI/SECRETS-template.toml @@ -124,6 +124,17 @@ NPM_TOKEN = "" +###################### +# NUPKG TECHNOLOGY # +###################### +# NUPKG_TOKEN +# The Authentication token (e.g. 'Authentication: ' or 'X-NuGet-ApiKey: ') for +# logging into the corresponding NUPKG registry defined in the CONFIG.toml. +NUPKG_TOKEN = "" + + + + ###################### # PYTHON TECHNOLOGY # ###################### diff --git a/automataCI/_package-chocolatey_unix-any.sh b/automataCI/_package-chocolatey_unix-any.sh index 87d0639..e0e4066 100644 --- a/automataCI/_package-chocolatey_unix-any.sh +++ b/automataCI/_package-chocolatey_unix-any.sh @@ -62,9 +62,10 @@ PACKAGE_Run_CHOCOLATEY() { # prepare workspace and required values I18N_Create_Package "CHOCOLATEY" - _src="${_target_filename}_${PROJECT_VERSION}_${_target_os}-${_target_arch}" + _src="${PROJECT_CHOCOLATEY_ID}-${_target_filename}" + _src="${_src}_${PROJECT_VERSION}_${_target_os}-${_target_arch}" _target_path="${_dest}/${_src}" - _src="${PROJECT_PATH_ROOT}/${PROJECT_PATH_TEMP}/packagers-choco-${_src}" + _src="${PROJECT_PATH_ROOT}/${PROJECT_PATH_TEMP}/packagers-${_src}" I18N_Remake "$_src" FS_Remake_Directory "$_src" if [ $? -ne 0 ]; then @@ -91,6 +92,7 @@ PACKAGE_Run_CHOCOLATEY() { return 0 ;; 0) + # accepted ;; *) I18N_Assemble_Failed @@ -102,17 +104,19 @@ PACKAGE_Run_CHOCOLATEY() { # check nuspec file is available I18N_Check ".nuspec" __name="" - for __file in "${_src}/"*.nuspec; do - FS_Is_File "${__file}" - if [ $? -eq 0 ]; then - if [ $(STRINGS_Is_Empty "$__name") -ne 0 ]; then - I18N_Check_Failed - return 1 - fi - - __name="${__file##*/}" - __name="${__name%.nuspec*}" + for __file in "${_src}/"*; do + FS_Is_File "$__file" + if [ $? -ne 0 ]; then + continue + fi + + if [ "$__file" = "${_src}/.nuspec" ]; then + continue fi + + __name="$(FS_Get_File "$__file")" + __name="${__name%.nuspec*}" + break done if [ $(STRINGS_Is_Empty "$__name") -eq 0 ]; then @@ -122,7 +126,7 @@ PACKAGE_Run_CHOCOLATEY() { # archive the assembled payload - __name="${__name}-chocolatey_${PROJECT_VERSION}_${_target_os}-${_target_arch}.nupkg" + __name="${__name}_${PROJECT_VERSION}_${_target_os}-${_target_arch}.nupkg" __name="${_dest}/${__name}" I18N_Archive "$__name" CHOCOLATEY_Archive "$__name" "$_src" diff --git a/automataCI/_package-chocolatey_windows-any.ps1 b/automataCI/_package-chocolatey_windows-any.ps1 index 7b158d9..62ca22c 100644 --- a/automataCI/_package-chocolatey_windows-any.ps1 +++ b/automataCI/_package-chocolatey_windows-any.ps1 @@ -53,9 +53,10 @@ function PACKAGE-Run-CHOCOLATEY { # prepare workspace and required values $null = I18N-Create-Package "CHOCOLATEY" - $_src = "${_target_filename}_${env:PROJECT_VERSION}_${_target_os}-${_target_arch}" + $_src = "${env:PROJECT_CHOCOLATEY_ID}-${_target_filename}" + $_src = "${_src}_${env:PROJECT_VERSION}_${_target_os}-${_target_arch}" $_target_path = "${_dest}\${_src}" - $_src = "${env:PROJECT_PATH_ROOT}\${env:PROJECT_PATH_TEMP}\packagers-choco-${_src}" + $_src = "${env:PROJECT_PATH_ROOT}\${env:PROJECT_PATH_TEMP}\packagers-${_src}" $null = I18N-Remake "${_src}" $___process = FS-Remake-Directory "${_src}" if ($___process -ne 0) { @@ -94,15 +95,21 @@ function PACKAGE-Run-CHOCOLATEY { # check nuspec is available - $null = I18N-Check ".nuspec metadata" + $null = I18N-Check ".nuspec" + $___process = FS-Is-File "${__file}" + if ($___process -ne 0) { + $null = I18N-Check-Failed + return 1 + } + $__name = "" foreach ($__file in (Get-ChildItem -File -Path "${_src}\*.nuspec")) { - if ($(STRINGS-Is-Empty "${__name}") -ne 0) { - $null = I18N-Check-Failed - return 1 + if ($__file.Name -eq ".nuspec") { + continue } $__name = $__file.Name -replace '\.nuspec.*$', '' + break } if ($(STRINGS-Is-Empty "${__name}") -eq 0) { @@ -112,7 +119,7 @@ function PACKAGE-Run-CHOCOLATEY { # archive the assembled payload - $__name = "${__name}-chocolatey_${env:PROJECT_VERSION}_${_target_os}-${_target_arch}.nupkg" + $__name = "${__name}_${env:PROJECT_VERSION}_${_target_os}-${_target_arch}.nupkg" $__name = "${_dest}\${__name}" $null = I18N-Archive "${__name}" $___process = CHOCOLATEY-Archive "${__name}" "${_src}" diff --git a/automataCI/_release-citation_unix-any.sh b/automataCI/_release-citation_unix-any.sh index 2b950d2..f71132c 100644 --- a/automataCI/_release-citation_unix-any.sh +++ b/automataCI/_release-citation_unix-any.sh @@ -43,7 +43,9 @@ RELEASE_Run_CITATION_CFF() { # execute I18N_Publish "CITATION.cff" if [ $(OS_Is_Run_Simulated) -ne 0 ]; then - FS_Copy_File "$1" "${PROJECT_PATH_ROOT}/CITATION.cff" + __dest="${PROJECT_PATH_ROOT}/CITATION.cff" + FS_Remove_Silently "$__dest" + FS_Copy_File "$1" "$__dest" if [ $? -ne 0 ]; then I18N_Publish_Failed return 1 diff --git a/automataCI/_release-citation_windows-any.ps1 b/automataCI/_release-citation_windows-any.ps1 index 261a7f4..ab4be3b 100644 --- a/automataCI/_release-citation_windows-any.ps1 +++ b/automataCI/_release-citation_windows-any.ps1 @@ -45,7 +45,9 @@ function RELEASE-Run-CITATION-CFF { # execute $null = I18N-Publish "CITATION.cff" if ($(OS-Is-Run-Simulated) -ne 0) { - $___process = FS-Copy-File "${__target}" "${env:PROJECT_PATH_ROOT}\CITATION.cff" + $__dest = "${env:PROJECT_PATH_ROOT}\CITATION.cff" + $null = FS-Remove-Silently "${__dest}" + $___process = FS-Copy-File "${__target}" "${__dest}" if ($___process -ne 0) { $null = I18N-Publish-Failed return 1 diff --git a/automataCI/_release-lib_unix-any.sh b/automataCI/_release-lib_unix-any.sh index cd7f60e..db7c6c1 100644 --- a/automataCI/_release-lib_unix-any.sh +++ b/automataCI/_release-lib_unix-any.sh @@ -47,6 +47,12 @@ RELEASE_Run_LIBS() { return 0 fi + if [ $(FS_Is_Target_A_TARGZ "$1") -ne 0 ] || + [ $(FS_Is_Target_A_TARXZ "$1") -ne 0 ] || + [ $(FS_Is_Target_A_ZIP "$1") -ne 0 ]; then + return 0 + fi + GIT_Is_Available if [ $? -ne 0 ]; then return 0 @@ -56,17 +62,17 @@ RELEASE_Run_LIBS() { # execute __branch="v${PROJECT_VERSION}" if [ $(FS_Is_Target_A_NPM "$1") -eq 0 ]; then - if [ $(STRINGS_Is_Empty "$PROJECT_NODE_BRANCH_TAG") -eq 0 ]; then + if [ $(STRINGS_Is_Empty "$PROJECT_NODE_NPM_ID") -eq 0 ]; then return 0 fi - __branch="${__branch}_${PROJECT_NODE_BRANCH_TAG}" + __branch="${__branch}_${PROJECT_NODE_NPM_ID}" elif [ $(FS_Is_Target_A_C "$1") -eq 0 ]; then - if [ $(STRINGS_Is_Empty "$PROJECT_C_BRANCH_TAG") -eq 0 ]; then + if [ $(STRINGS_Is_Empty "$PROJECT_C_ID") -eq 0 ]; then return 0 fi - __branch="${__branch}_${PROJECT_C_BRANCH_TAG}" + __branch="${__branch}_${PROJECT_C_ID}" else return 0 fi @@ -97,7 +103,7 @@ RELEASE_Run_LIBS() { elif [ $(FS_Is_Target_A_ZIP "$1") -eq 0 ]; then ZIP_Extract "$__workspace" "$1" else - FS_Copy_File "$1" "${__workspace}" + FS_Copy_File "$1" "${__workspace}/$(FS_Get_File "$1")" fi if [ $? -ne 0 ]; then diff --git a/automataCI/_release-lib_windows-any.ps1 b/automataCI/_release-lib_windows-any.ps1 index 0801736..5e08c75 100644 --- a/automataCI/_release-lib_windows-any.ps1 +++ b/automataCI/_release-lib_windows-any.ps1 @@ -49,6 +49,12 @@ function RELEASE-Run-LIBS { return 0 } + if (($(FS-Is-Target-A-TARGZ "${__target}") -ne 0) -or + ($(FS-Is-Target-A-TARXZ "${__target}") -ne 0) -or + ($(FS-Is-Target-A-ZIP "${__target}") -ne 0)) { + return 0 + } + $___process = GIT-Is-Available if ($___process -ne 0) { return 0 @@ -58,17 +64,17 @@ function RELEASE-Run-LIBS { # execute $__branch = "v${env:PROJECT_VERSION}" if ($(FS-Is-Target-A-NPM "${__target}") -eq 0) { - if ($(STRINGS-Is-Empty "${env:PROJECT_NODE_BRANCH_TAG}") -eq 0) { + if ($(STRINGS-Is-Empty "${env:PROJECT_NODE_NPM_ID}") -eq 0) { return 0 } - $__branch = "${__branch}_${env:PROJECT_NODE_BRANCH_TAG}" + $__branch = "${__branch}_${env:PROJECT_NODE_NPM_ID}" } elseif ($(FS-Is-Target-A-C "${__target}") -eq 0) { - if ($(STRINGS-Is-Empty "${env:PROJECT_C_BRANCH_TAG}") -eq 0) { + if ($(STRINGS-Is-Empty "${env:PROJECT_C_ID}") -eq 0) { return 0 } - $__branch = "${__branch}_${env:PROJECT_C_BRANCH_TAG}" + $__branch = "${__branch}_${env:PROJECT_C_ID}" } else { return 0 } @@ -102,7 +108,9 @@ function RELEASE-Run-LIBS { } elseif ($(FS-Is-Target-A-ZIP "${__target}") -eq 0) { $___process = ZIP-Extract "${__workspace}" "${__target}" } else { - $___process = FS-Copy-File "${__target}" "${__workspace}" + $___process = FS-Copy-File ` + "${__target}" ` + "${__workspace}\$(FS-Get-File "${__target}")" } if ($___process -ne 0) { diff --git a/automataCI/_release-nupkg_unix-any.sh b/automataCI/_release-nupkg_unix-any.sh new file mode 100644 index 0000000..4966e3e --- /dev/null +++ b/automataCI/_release-nupkg_unix-any.sh @@ -0,0 +1,56 @@ +#!/bin/sh +# Copyright 2024 (Holloway) Chew, Kean Ho +# +# Licensed under the Apache License, Version 2.0 (the "License"); you may not +# use this file except in compliance with the License. You may obtain a copy of +# the License at: +# http://www.apache.org/licenses/LICENSE-2.0 +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, WITHOUT +# WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the +# License for the specific language governing permissions and limitations under +# the License. +. "${LIBS_AUTOMATACI}/services/hestiaOS/Vanilla.sh.ps1" +. "${LIBS_AUTOMATACI}/services/hestiaCONSOLE/Vanilla.sh.ps1" +. "${LIBS_AUTOMATACI}/services/hestiaKERNEL/Vanilla.sh.ps1" +. "${LIBS_AUTOMATACI}/services/hestiaNUPKG/Vanilla.sh.ps1" + + + + +# initialize +if [ "$PROJECT_PATH_ROOT" = "" ]; then + >&2 printf "[ ERROR ] - Please run me from automataCI/ci.sh.ps1 instead!\n" + return 1 +fi + + + + +RELEASE_Run_NUPKG() { + #__target="$1" + + + # validate input + if [ $(hestiaNUPKG_Is_Target_Valid "$1") -ne $hestiaKERNEL_ERROR_OK ]; then + return $hestiaKERNEL_ERROR_OK + fi + + + # execute + hestiaCONSOLE_Log_Publish "NUPKG" + if [ $(hestiaOS_Is_Simulation_Mode) -ne 0 ]; then + hestiaNUPKG_Publish "$PROJECT_NUPKG_URL" "$NUPKG_TOKEN" "$__target" + if [ $? -ne 0 ]; then + hestiaCONSOLE_Log_Publish_Failed + return $hestiaKERNEL_ERROR_BAD_EXEC + fi + else + # always simulate in case of error or mishaps before any point of no return + hestiaCONSOLE_Log_Publish_Simulate "NUPKG" + fi + + + # report status + return $hestiaKERNEL_ERROR_OK +} diff --git a/automataCI/_release-nupkg_windows-any.ps1 b/automataCI/_release-nupkg_windows-any.ps1 new file mode 100644 index 0000000..ae4e431 --- /dev/null +++ b/automataCI/_release-nupkg_windows-any.ps1 @@ -0,0 +1,60 @@ +# Copyright 2024 (Holloway) Chew, Kean Ho +# +# Licensed under the Apache License, Version 2.0 (the "License"); you may not +# use this file except in compliance with the License. You may obtain a copy +# of the License at: +# http://www.apache.org/licenses/LICENSE-2.0 +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, WITHOUT +# WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the +# License for the specific language governing permissions and limitations +# under the License. +. "${env:LIBS_AUTOMATACI}\services\hestiaOS\Vanilla.ps1" +. "${env:LIBS_AUTOMATACI}\services\hestiaCONSOLE\Vanilla.ps1" +. "${env:LIBS_AUTOMATACI}\services\hestiaKERNEL\Vanilla.ps1" +. "${env:LIBS_AUTOMATACI}\services\hestiaNUPKG\Vanilla.ps1" + + + + +# initialize +if (-not (Test-Path -Path $env:PROJECT_PATH_ROOT)) { + Write-Error "[ ERROR ] - Please run from automataCI\ci.sh.ps1 instead!`n" + return +} + + + + +function RELEASE-Run-NUPKG { + param( + [string]$__target + ) + + + # validate input + if ($(hestiaNUPKG-Is-Target-Valid "${__target}") -ne ${env:hestiaKERNEL_ERROR_OK}) { + return ${env:hestiaKERNEL_ERROR_OK} + } + + + # execute + $null = hestiaCONSOLE-Log-Publish "NUPKG" + if ($(hestiaOS-Is-Simulation-Mode) -ne 0) { + $___process = hestiaNUPKG-Publish ` + "${env:PROJECT_NUPKG_URL}" ` + "${env:NUPKG_TOKEN}" ` + "${__target}" + if ($___process -ne 0) { + $null = hestiaCONSOLE-Log-Publish-Failed + return ${env:hestiaKERNEL_ERROR_BAD_EXEC} + } + } else { + # always simulate in case of error or mishaps before any point of no return + $null = hestiaCONSOLE-Log-Publish-Simulate "NPM" + } + + + # report status + return ${env:hestiaKERNEL_ERROR_OK} +} diff --git a/automataCI/_release-research_unix-any.sh b/automataCI/_release-research_unix-any.sh index 77bc2c0..a0e6d98 100644 --- a/automataCI/_release-research_unix-any.sh +++ b/automataCI/_release-research_unix-any.sh @@ -46,6 +46,7 @@ RELEASE_Run_RESEARCH() { __dest="PAPER.pdf" __dest="${PROJECT_PATH_ROOT}/${__dest}" I18N_Publish "$__dest" + FS_Remove_Silently "$__dest" FS_Copy_File "$1" "$__dest" if [ $? -ne 0 ]; then I18N_Publish_Failed diff --git a/automataCI/_release-research_windows-any.ps1 b/automataCI/_release-research_windows-any.ps1 index 405d074..cbf0ff7 100644 --- a/automataCI/_release-research_windows-any.ps1 +++ b/automataCI/_release-research_windows-any.ps1 @@ -48,6 +48,7 @@ function RELEASE-Run-RESEARCH { $__dest = "PAPER.pdf" $null = I18N-Publish "${__dest}" $__dest = "${env:PROJECT_PATH_ROOT}\${__dest}" + $null = FS-Remove-Silently "${__dest}" $___process = FS-Copy-File "${__target}" "${__dest}" if ($___process -ne 0) { $null = I18N-Publish-Failed diff --git a/automataCI/release_unix-any.sh b/automataCI/release_unix-any.sh index 3562d3e..9614a77 100644 --- a/automataCI/release_unix-any.sh +++ b/automataCI/release_unix-any.sh @@ -34,6 +34,7 @@ fi . "${LIBS_AUTOMATACI}/_release-homebrew_unix-any.sh" . "${LIBS_AUTOMATACI}/_release-lib_unix-any.sh" . "${LIBS_AUTOMATACI}/_release-npm_unix-any.sh" +. "${LIBS_AUTOMATACI}/_release-nupkg_unix-any.sh" . "${LIBS_AUTOMATACI}/_release-project_unix-any.sh" . "${LIBS_AUTOMATACI}/_release-pypi_unix-any.sh" . "${LIBS_AUTOMATACI}/_release-research_unix-any.sh" @@ -169,6 +170,12 @@ for TARGET in "$PACKAGE_DIRECTORY"/*; do fi + RELEASE_Run_NUPKG "$TARGET" + if [ $? -ne 0 ]; then + return 1 + fi + + RELEASE_Run_PYPI "$TARGET" if [ $? -ne 0 ]; then return 1 diff --git a/automataCI/release_windows-any.ps1 b/automataCI/release_windows-any.ps1 index 69dd698..c833a93 100644 --- a/automataCI/release_windows-any.ps1 +++ b/automataCI/release_windows-any.ps1 @@ -33,6 +33,7 @@ if (-not (Test-Path -Path $env:PROJECT_PATH_ROOT)) { . "${env:LIBS_AUTOMATACI}\_release-homebrew_windows-any.ps1" . "${env:LIBS_AUTOMATACI}\_release-lib_windows-any.ps1" . "${env:LIBS_AUTOMATACI}\_release-npm_windows-any.ps1" +. "${env:LIBS_AUTOMATACI}\_release-nupkg_windows-any.ps1" . "${env:LIBS_AUTOMATACI}\_release-project_windows-any.ps1" . "${env:LIBS_AUTOMATACI}\_release-pypi_windows-any.ps1" . "${env:LIBS_AUTOMATACI}\_release-research_windows-any.ps1" @@ -160,6 +161,11 @@ foreach ($TARGET in (Get-ChildItem -Path "${PACKAGE_DIRECTORY}")) { $TARGET = $T return 1 } + $___process = RELEASE-Run-NUPKG "$TARGET" + if ($___process -ne 0) { + return 1 + } + $___process = RELEASE-Run-PYPI "$TARGET" if ($___process -ne 0) { return 1 diff --git a/automataCI/services/compilers/deb.ps1 b/automataCI/services/compilers/deb.ps1 index faf5cec..944b89b 100644 --- a/automataCI/services/compilers/deb.ps1 +++ b/automataCI/services/compilers/deb.ps1 @@ -1104,7 +1104,9 @@ function DEB-Unpack { # execute # copy target into directory - $___process = FS-Copy-File "${___target}" "${___directory}" + $___process = FS-Copy-File ` + "${___target}" ` + "${___directory}\$(FS-Get-File "${___target}")" if ($___process -ne 0) { return 1 } diff --git a/automataCI/services/compilers/deb.sh b/automataCI/services/compilers/deb.sh index 4642f01..ce5e3d6 100644 --- a/automataCI/services/compilers/deb.sh +++ b/automataCI/services/compilers/deb.sh @@ -1063,10 +1063,6 @@ DEB_Unpack() { # validate input - if [ $(STRINGS_Is_Empty "$___directory") -eq 0 ]; then - return 1 - fi - FS_Is_Directory "$___directory" if [ $? -ne 0 ]; then return 1 @@ -1095,7 +1091,7 @@ DEB_Unpack() { # execute # copy target into directory - FS_Copy_File "$___target" "$___directory" + FS_Copy_File "$___target" "${___directory}/$(FS_Get_File "$___target")" if [ $? -ne 0 ]; then return 1 fi diff --git a/automataCI/services/hestiaCONSOLE/Log.sh.ps1 b/automataCI/services/hestiaCONSOLE/Log.sh.ps1 new file mode 100755 index 0000000..98e4361 --- /dev/null +++ b/automataCI/services/hestiaCONSOLE/Log.sh.ps1 @@ -0,0 +1,210 @@ +echo \" <<'RUN_AS_BATCH' >/dev/null ">NUL "\" \`" <#" +@ECHO OFF +REM LICENSE CLAUSES HERE +REM ---------------------------------------------------------------------------- + + + + +REM ############################################################################ +REM # Windows BATCH Codes # +REM ############################################################################ +where /q powershell +if errorlevel 1 ( + echo "ERROR: missing powershell facility." + exit /b 1 +) + +copy /Y "%~nx0" "%~n0.ps1" >nul +timeout /t 1 /nobreak >nul +powershell -executionpolicy remotesigned -Command "& '.\%~n0.ps1' %*" +start /b "" cmd /c del "%~f0" & exit /b %errorcode% +REM ############################################################################ +REM # Windows BATCH Codes # +REM ############################################################################ +RUN_AS_BATCH +#> | Out-Null + + + + +echo \" <<'RUN_AS_POWERSHELL' >/dev/null # " | Out-Null +################################################################################ +# Windows POWERSHELL Codes # +################################################################################ +. "${env:LIBS_HESTIA}\hestiaLOCALE\Get_Lang.sh.ps1" +. "${env:LIBS_HESTIA}\hestiaI18N\Translate_Done.sh.ps1" +. "${env:LIBS_HESTIA}\hestiaI18N\Translate_Error.sh.ps1" +. "${env:LIBS_HESTIA}\hestiaI18N\Translate_Info.sh.ps1" +. "${env:LIBS_HESTIA}\hestiaI18N\Translate_Note.sh.ps1" +. "${env:LIBS_HESTIA}\hestiaI18N\Translate_OK.sh.ps1" +. "${env:LIBS_HESTIA}\hestiaI18N\Translate_Success.sh.ps1" +. "${env:LIBS_HESTIA}\hestiaI18N\Translate_Warning.sh.ps1" + + + + +function hestiaCONSOLE-Log { + param( + [string]$___mode, + [string]$___message, + [string]$___lang + ) + + + # execute + $___lang = hestiaLOCALE-Get-Lang "${___lang}" + $___color = "" + $___foreground_color = "Gray" + switch ($___mode) { + error { + $___tag = hestiaI18N-Translate-Error "${___lang}" + $___color = "31" + $___foreground_color = "Red" + } warning { + $___tag = hestiaI18N-Translate-Warning "${___lang}" + $___color = "33" + $___foreground_color = "Yellow" + } info { + $___tag = hestiaI18N-Translate-Info "${___lang}" + $___color = "36" + $___foreground_color = "Cyan" + } note { + $___tag = hestiaI18N-Translate-Note "${___lang}" + $___color = "35" + $___foreground_color = "Magenta" + } success { + $___tag = hestiaI18N-Translate-Success "${___lang}" + $___color = "32" + $___foreground_color = "Green" + } ok { + $___tag = hestiaI18N-Translate-OK "${___lang}" + $___color = "36" + $___foreground_color = "Cyan" + } done { + $___tag = hestiaI18N-Translate-Done "${___lang}" + $___color = "36" + $___foreground_color = "Cyan" + } default { + # do nothing + }} + + if (-not [string]::IsNullOrEmpty($___tag)) { + $___tag = "⦗ $($___tag.ToUpper()) ⦘" + $___tag = "$("{0,-14} " -f $___tag)" + } + + if (($Host.UI.RawUI.ForegroundColor -ge "DarkGray") -or + ("$env:TERM" -eq "xterm-256color") -or + ("$env:COLORTERM" -eq "truecolor", "24bit")) { + # terminal supports color mode + if ((-not ([string]::IsNullOrEmpty($___color))) -and + (-not ([string]::IsNullOrEmpty($___foreground_color)))) { + $null = Write-Host ` + -NoNewLine ` + -ForegroundColor $___foreground_color ` + "$([char]0x1b)[1;${___color}m${___tag}$([char]0x1b)[0;${___color}m${___message}$([char]0x1b)[0m" + } else { + $null = Write-Host -NoNewLine "${___tag}${___message}" + } + } else { + $null = Write-Host -NoNewLine "${___tag}${___message}" + } +} +################################################################################ +# Windows POWERSHELL Codes # +################################################################################ +return +<# +RUN_AS_POWERSHELL + + + + +################################################################################ +# Unix Main Codes # +################################################################################ +. "${LIBS_HESTIA}/hestiaLOCALE/Get_Lang.sh.ps1" +. "${LIBS_HESTIA}/hestiaI18N/Translate_Done.sh.ps1" +. "${LIBS_HESTIA}/hestiaI18N/Translate_Error.sh.ps1" +. "${LIBS_HESTIA}/hestiaI18N/Translate_Info.sh.ps1" +. "${LIBS_HESTIA}/hestiaI18N/Translate_Note.sh.ps1" +. "${LIBS_HESTIA}/hestiaI18N/Translate_OK.sh.ps1" +. "${LIBS_HESTIA}/hestiaI18N/Translate_Success.sh.ps1" +. "${LIBS_HESTIA}/hestiaI18N/Translate_Warning.sh.ps1" + + + + +hestiaCONSOLE_Log() { + #___mode="$1" + #___message="$2" + ___lang="$3" + + + # execute + ___lang="$(hestiaLOCALE_Get_Lang "$___lang")" + ___color="" + case "$1" in + error) + ___tag="$(hestiaI18N_Translate_Error "$___lang")" + ___color="31" + ;; + warning) + ___tag="$(hestiaI18N_Translate_Warning "$___lang")" + ___color="33" + ;; + info) + ___tag="$(hestiaI18N_Translate_Info "$___lang")" + ___color="36" + ;; + note) + ___tag="$(hestiaI18N_Translate_Note "$___lang")" + ___color="35" + ;; + success) + ___tag="$(hestiaI18N_Translate_Success "$___lang")" + ___color="32" + ;; + ok) + ___tag="$(hestiaI18N_Translate_OK "$___lang")" + ___color="36" + ;; + done) + ___tag="$(hestiaI18N_Translate_Done "$___lang")" + ___color="36" + ;; + *) + # do nothing + ;; + esac + + if [ ! "$___tag" = "" ]; then + ___tag="⦗ $(printf -- "%s" "$___tag" | tr '[:lower:]' '[:upper:]') ⦘" + ___tag="$(printf -- "%-14s " "$___tag")" + fi + + if [ ! -z "$COLORTERM" ] || [ "$TERM" = "xterm-256color" ]; then + # terminal supports color mode + if [ ! -z "$___color" ]; then + 1>&2 printf -- "\033[1;${___color}m%s\033[0;${___color}m %b\033[0m" \ + "$___tag" \ + "$2" + else + 1>&2 printf -- "%s%b" "$___tag" "$2" + fi + else + 1>&2 printf -- "%s%b" "$___tag" "$2" + fi + + unset ___color ___tag ___lang + + + # report status + return 0 +} +################################################################################ +# Unix Main Codes # +################################################################################ +return 0 +#> diff --git a/automataCI/services/hestiaCONSOLE/Log_Publish.sh.ps1 b/automataCI/services/hestiaCONSOLE/Log_Publish.sh.ps1 new file mode 100755 index 0000000..4c57c00 --- /dev/null +++ b/automataCI/services/hestiaCONSOLE/Log_Publish.sh.ps1 @@ -0,0 +1,96 @@ +echo \" <<'RUN_AS_BATCH' >/dev/null ">NUL "\" \`" <#" +@ECHO OFF +REM LICENSE CLAUSES HERE +REM ---------------------------------------------------------------------------- + + + + +REM ############################################################################ +REM # Windows BATCH Codes # +REM ############################################################################ +where /q powershell +if errorlevel 1 ( + echo "ERROR: missing powershell facility." + exit /b 1 +) + +copy /Y "%~nx0" "%~n0.ps1" >nul +timeout /t 1 /nobreak >nul +powershell -executionpolicy remotesigned -Command "& '.\%~n0.ps1' %*" +start /b "" cmd /c del "%~f0" & exit /b %errorcode% +REM ############################################################################ +REM # Windows BATCH Codes # +REM ############################################################################ +RUN_AS_BATCH +#> | Out-Null + + + + +echo \" <<'RUN_AS_POWERSHELL' >/dev/null # " | Out-Null +################################################################################ +# Windows POWERSHELL Codes # +################################################################################ +. "${env:LIBS_HESTIA}\hestiaCONSOLE\Log.sh.ps1" +. "${env:LIBS_HESTIA}\hestiaLOCALE\Get_Lang.sh.ps1" +. "${env:LIBS_HESTIA}\hestiaI18N\Translate_Publish.sh.ps1" + + + + +function hestiaCONSOLE-Log-Publish { + param( + [string]___subject, + [string]___lang + ) + + + # execute + $___lang = "$(hestiaLOCALE-Get-Lang "${___lang}")" + $null = hestiaCONSOLE-Log info ` + "$(hestiaI18N-Translate-Publish "${___lang}" "${___subject}")`n" ` + "${___lang}" + + + # report status + return 0 +} +################################################################################ +# Windows POWERSHELL Codes # +################################################################################ +return +<# +RUN_AS_POWERSHELL + + + + +################################################################################ +# Unix Main Codes # +################################################################################ +. "${LIBS_HESTIA}/hestiaCONSOLE/Log.sh.ps1" +. "${LIBS_HESTIA}/hestiaLOCALE/Get_Lang.sh.ps1" +. "${LIBS_HESTIA}/hestiaI18N/Translate_Publish.sh.ps1" + + + + +hestiaCONSOLE_Log_Publish() { + #___subject="$1" + #___lang="$2" + + + # execute + ___lang="$(hestiaLOCALE_Get_Lang "$___lang")" + hestiaCONSOLE_Log info "$(hestiaI18N_Translate_Publish "$___lang" "$1")\n" "$___lang" + + + # report status + return 0 +} +################################################################################ +# Unix Main Codes # +################################################################################ +return 0 +#> diff --git a/automataCI/services/hestiaCONSOLE/Log_Publish_Failed.sh.ps1 b/automataCI/services/hestiaCONSOLE/Log_Publish_Failed.sh.ps1 new file mode 100755 index 0000000..4fd639c --- /dev/null +++ b/automataCI/services/hestiaCONSOLE/Log_Publish_Failed.sh.ps1 @@ -0,0 +1,98 @@ +echo \" <<'RUN_AS_BATCH' >/dev/null ">NUL "\" \`" <#" +@ECHO OFF +REM LICENSE CLAUSES HERE +REM ---------------------------------------------------------------------------- + + + + +REM ############################################################################ +REM # Windows BATCH Codes # +REM ############################################################################ +where /q powershell +if errorlevel 1 ( + echo "ERROR: missing powershell facility." + exit /b 1 +) + +copy /Y "%~nx0" "%~n0.ps1" >nul +timeout /t 1 /nobreak >nul +powershell -executionpolicy remotesigned -Command "& '.\%~n0.ps1' %*" +start /b "" cmd /c del "%~f0" & exit /b %errorcode% +REM ############################################################################ +REM # Windows BATCH Codes # +REM ############################################################################ +RUN_AS_BATCH +#> | Out-Null + + + + +echo \" <<'RUN_AS_POWERSHELL' >/dev/null # " | Out-Null +################################################################################ +# Windows POWERSHELL Codes # +################################################################################ +. "${env:LIBS_HESTIA}\hestiaCONSOLE\Log.sh.ps1" +. "${env:LIBS_HESTIA}\hestiaLOCALE\Get_Lang.sh.ps1" +. "${env:LIBS_HESTIA}\hestiaI18N\Translate_Publish_Failed.sh.ps1" + + + + +function hestiaCONSOLE-Log-Publish-Failed { + param( + [string]___subject, + [string]___lang + ) + + + # execute + $___lang = "$(hestiaLOCALE-Get-Lang "${___lang}")" + $null = hestiaCONSOLE-Log error ` + "$(hestiaI18N-Translate-Publish-Failed "${___lang}" "${___subject}")`n" ` + "${___lang}" + + + # report status + return 0 +} +################################################################################ +# Windows POWERSHELL Codes # +################################################################################ +return +<# +RUN_AS_POWERSHELL + + + + +################################################################################ +# Unix Main Codes # +################################################################################ +. "${LIBS_HESTIA}/hestiaCONSOLE/Log.sh.ps1" +. "${LIBS_HESTIA}/hestiaLOCALE/Get_Lang.sh.ps1" +. "${LIBS_HESTIA}/hestiaI18N/Translate_Publish_Failed.sh.ps1" + + + + +hestiaCONSOLE_Log_Publish_Failed() { + #___subject="$1" + #___lang="$2" + + + # execute + ___lang="$(hestiaLOCALE_Get_Lang "$___lang")" + hestiaCONSOLE_Log error \ + "$(hestiaI18N_Translate_Publish_Failed "$___lang" "$1")\n" \ + "$___lang" + + + # report status + return 0 +} +################################################################################ +# Unix Main Codes # +################################################################################ +return 0 +#> diff --git a/automataCI/services/hestiaCONSOLE/Log_Publish_Simulate.sh.ps1 b/automataCI/services/hestiaCONSOLE/Log_Publish_Simulate.sh.ps1 new file mode 100755 index 0000000..8515309 --- /dev/null +++ b/automataCI/services/hestiaCONSOLE/Log_Publish_Simulate.sh.ps1 @@ -0,0 +1,98 @@ +echo \" <<'RUN_AS_BATCH' >/dev/null ">NUL "\" \`" <#" +@ECHO OFF +REM LICENSE CLAUSES HERE +REM ---------------------------------------------------------------------------- + + + + +REM ############################################################################ +REM # Windows BATCH Codes # +REM ############################################################################ +where /q powershell +if errorlevel 1 ( + echo "ERROR: missing powershell facility." + exit /b 1 +) + +copy /Y "%~nx0" "%~n0.ps1" >nul +timeout /t 1 /nobreak >nul +powershell -executionpolicy remotesigned -Command "& '.\%~n0.ps1' %*" +start /b "" cmd /c del "%~f0" & exit /b %errorcode% +REM ############################################################################ +REM # Windows BATCH Codes # +REM ############################################################################ +RUN_AS_BATCH +#> | Out-Null + + + + +echo \" <<'RUN_AS_POWERSHELL' >/dev/null # " | Out-Null +################################################################################ +# Windows POWERSHELL Codes # +################################################################################ +. "${env:LIBS_HESTIA}\hestiaCONSOLE\Log.sh.ps1" +. "${env:LIBS_HESTIA}\hestiaLOCALE\Get_Lang.sh.ps1" +. "${env:LIBS_HESTIA}\hestiaI18N\Translate_Publish_Simulate.sh.ps1" + + + + +function hestiaCONSOLE-Log-Publish-Simulate { + param( + [string]___subject, + [string]___lang + ) + + + # execute + $___lang = "$(hestiaLOCALE-Get-Lang "${___lang}")" + $null = hestiaCONSOLE-Log warning ` + "$(hestiaI18N-Translate-Publish-Simulate "${___lang}" "${___subject}")`n" ` + "${___lang}" + + + # report status + return 0 +} +################################################################################ +# Windows POWERSHELL Codes # +################################################################################ +return +<# +RUN_AS_POWERSHELL + + + + +################################################################################ +# Unix Main Codes # +################################################################################ +. "${LIBS_HESTIA}/hestiaCONSOLE/Log.sh.ps1" +. "${LIBS_HESTIA}/hestiaLOCALE/Get_Lang.sh.ps1" +. "${LIBS_HESTIA}/hestiaI18N/Translate_Publish_Simulate.sh.ps1" + + + + +hestiaCONSOLE_Log_Publish_Simulate() { + #___subject="$1" + #___lang="$2" + + + # execute + ___lang="$(hestiaLOCALE_Get_Lang "$___lang")" + hestiaCONSOLE_Log info \ + "$(hestiaI18N_Translate_Publish_Simulate "$___lang" "$1")\n" \ + "$___lang" + + + # report status + return 0 +} +################################################################################ +# Unix Main Codes # +################################################################################ +return 0 +#> diff --git a/automataCI/services/hestiaCONSOLE/Vanilla.sh.ps1 b/automataCI/services/hestiaCONSOLE/Vanilla.sh.ps1 new file mode 100755 index 0000000..3d2e240 --- /dev/null +++ b/automataCI/services/hestiaCONSOLE/Vanilla.sh.ps1 @@ -0,0 +1,60 @@ +echo \" <<'RUN_AS_BATCH' >/dev/null ">NUL "\" \`" <#" +@ECHO OFF +REM LICENSE CLAUSES HERE +REM ---------------------------------------------------------------------------- + + + + +REM ############################################################################ +REM # Windows BATCH Codes # +REM ############################################################################ +where /q powershell +if errorlevel 1 ( + echo "ERROR: missing powershell facility." + exit /b 1 +) + +copy /Y "%~nx0" "%~n0.ps1" >nul +timeout /t 1 /nobreak >nul +powershell -executionpolicy remotesigned -Command "& '.\%~n0.ps1' %*" +start /b "" cmd /c del "%~f0" & exit /b %errorcode% +REM ############################################################################ +REM # Windows BATCH Codes # +REM ############################################################################ +RUN_AS_BATCH +#> | Out-Null + + + + +echo \" <<'RUN_AS_POWERSHELL' >/dev/null # " | Out-Null +################################################################################ +# Windows POWERSHELL Codes # +################################################################################ +. "${env:LIBS_HESTIA}\hestiaCONSOLE\Log.ps1" +. "${env:LIBS_HESTIA}\hestiaCONSOLE\Log_Publish.ps1" +. "${env:LIBS_HESTIA}\hestiaCONSOLE\Log_Publish_Failed.ps1" +. "${env:LIBS_HESTIA}\hestiaCONSOLE\Log_Publish_Simulate.ps1" +################################################################################ +# Windows POWERSHELL Codes # +################################################################################ +return +<# +RUN_AS_POWERSHELL + + + + +################################################################################ +# Unix Main Codes # +################################################################################ +. "${LIBS_HESTIA}/hestiaCONSOLE/Log.sh.ps1" +. "${LIBS_HESTIA}/hestiaCONSOLE/Log_Publish.sh.ps1" +. "${LIBS_HESTIA}/hestiaCONSOLE/Log_Publish_Failed.sh.ps1" +. "${LIBS_HESTIA}/hestiaCONSOLE/Log_Publish_Simulate.sh.ps1" +################################################################################ +# Unix Main Codes # +################################################################################ +return 0 +#> diff --git a/automataCI/services/hestiaFS/Get_File.sh.ps1 b/automataCI/services/hestiaFS/Get_File.sh.ps1 new file mode 100755 index 0000000..4d5d705 --- /dev/null +++ b/automataCI/services/hestiaFS/Get_File.sh.ps1 @@ -0,0 +1,97 @@ +echo \" <<'RUN_AS_BATCH' >/dev/null ">NUL "\" \`" <#" +@ECHO OFF +REM LICENSE CLAUSES HERE +REM ---------------------------------------------------------------------------- + + + + +REM ############################################################################ +REM # Windows BATCH Codes # +REM ############################################################################ +where /q powershell +if errorlevel 1 ( + echo "ERROR: missing powershell facility." + exit /b 1 +) + +copy /Y "%~nx0" "%~n0.ps1" >nul +timeout /t 1 /nobreak >nul +powershell -executionpolicy remotesigned -Command "& '.\%~n0.ps1' %*" +start /b "" cmd /c del "%~f0" & exit /b %errorcode% +REM ############################################################################ +REM # Windows BATCH Codes # +REM ############################################################################ +RUN_AS_BATCH +#> | Out-Null + + + + +echo \" <<'RUN_AS_POWERSHELL' >/dev/null # " | Out-Null +################################################################################ +# Windows POWERSHELL Codes # +################################################################################ +. "${env:LIBS_HESTIA}\hestiaKERNEL\Vanilla.sh.ps1" +. "${env:LIBS_HESTIA}\hestiaSTRING\Vanilla.sh.ps1" + + + + +function hestiaFS-Get-File { + param ( + [string]$___filepath + ) + + + # validate input + if ($(hestiaSTRING-Is-Empty "${___filepath}") -eq ${env:hestiaKERNEL_ERROR_OK}) { + return "" + } + + + # execute + return "$(Split-Path -Leaf -Path "${___target}")" +} +################################################################################ +# Windows POWERSHELL Codes # +################################################################################ +return +<# +RUN_AS_POWERSHELL + + + + +################################################################################ +# Unix Main Codes # +################################################################################ +. "${LIBS_HESTIA}/hestiaKERNEL/Vanilla.sh.ps1" +. "${LIBS_HESTIA}/hestiaSTRING/Vanilla.sh.ps1" + + + + +hestiaFS_Get_File() { + #___filepath="$1" + + + # validate input + if [ $(hestiaSTRING_Is_Empty "$1") -eq $hestiaKERNEL_ERROR_OK ]; then + printf -- "" + return $hestiaKERNEL_ERROR_DATA_MISSING + fi + + + # execute + printf -- "%b" "${1##*/}" + + + # report status + return $hestiaKERNEL_ERROR_OK +} +################################################################################ +# Unix Main Codes # +################################################################################ +return 0 +#> diff --git a/automataCI/services/hestiaFS/Vanilla.sh.ps1 b/automataCI/services/hestiaFS/Vanilla.sh.ps1 new file mode 100755 index 0000000..b5384f2 --- /dev/null +++ b/automataCI/services/hestiaFS/Vanilla.sh.ps1 @@ -0,0 +1,54 @@ +echo \" <<'RUN_AS_BATCH' >/dev/null ">NUL "\" \`" <#" +@ECHO OFF +REM LICENSE CLAUSES HERE +REM ---------------------------------------------------------------------------- + + + + +REM ############################################################################ +REM # Windows BATCH Codes # +REM ############################################################################ +where /q powershell +if errorlevel 1 ( + echo "ERROR: missing powershell facility." + exit /b 1 +) + +copy /Y "%~nx0" "%~n0.ps1" >nul +timeout /t 1 /nobreak >nul +powershell -executionpolicy remotesigned -Command "& '.\%~n0.ps1' %*" +start /b "" cmd /c del "%~f0" & exit /b %errorcode% +REM ############################################################################ +REM # Windows BATCH Codes # +REM ############################################################################ +RUN_AS_BATCH +#> | Out-Null + + + + +echo \" <<'RUN_AS_POWERSHELL' >/dev/null # " | Out-Null +################################################################################ +# Windows POWERSHELL Codes # +################################################################################ +. "${env:LIBS_HESTIA}\hestiaFS\Get_File.ps1" +################################################################################ +# Windows POWERSHELL Codes # +################################################################################ +return +<# +RUN_AS_POWERSHELL + + + + +################################################################################ +# Unix Main Codes # +################################################################################ +. "${LIBS_HESTIA}/hestiaFS/Get_File.sh.ps1" +################################################################################ +# Unix Main Codes # +################################################################################ +return 0 +#> diff --git a/automataCI/services/hestiaHTTP/Is_Available.sh.ps1 b/automataCI/services/hestiaHTTP/Is_Available.sh.ps1 new file mode 100755 index 0000000..1cc9274 --- /dev/null +++ b/automataCI/services/hestiaHTTP/Is_Available.sh.ps1 @@ -0,0 +1,84 @@ +echo \" <<'RUN_AS_BATCH' >/dev/null ">NUL "\" \`" <#" +@ECHO OFF +REM LICENSE CLAUSES HERE +REM ---------------------------------------------------------------------------- + + + + +REM ############################################################################ +REM # Windows BATCH Codes # +REM ############################################################################ +where /q powershell +if errorlevel 1 ( + echo "ERROR: missing powershell facility." + exit /b 1 +) + +copy /Y "%~nx0" "%~n0.ps1" >nul +timeout /t 1 /nobreak >nul +powershell -executionpolicy remotesigned -Command "& '.\%~n0.ps1' %*" +start /b "" cmd /c del "%~f0" & exit /b %errorcode% +REM ############################################################################ +REM # Windows BATCH Codes # +REM ############################################################################ +RUN_AS_BATCH +#> | Out-Null + + + + +echo \" <<'RUN_AS_POWERSHELL' >/dev/null # " | Out-Null +################################################################################ +# Windows POWERSHELL Codes # +################################################################################ +. "${env:LIBS_HESTIA}\hestiaKERNEL\Vanilla.sh.ps1" + + + + +function hestiaHTTP-Is-Available { + # execute + if (Get-Command curl -ErrorAction SilentlyContinue) { + return ${env:hestiaKERNEL_ERROR_OK} + } + + + # report status + return ${env:hestiaKERNEL_ERROR_DATA_EMPTY} +} +################################################################################ +# Windows POWERSHELL Codes # +################################################################################ +return +<# +RUN_AS_POWERSHELL + + + + +################################################################################ +# Unix Main Codes # +################################################################################ +. "${LIBS_HESTIA}/hestiaKERNEL/Vanilla.sh.ps1" + + + + +hestiaHTTP_Is_Available() { + # execute + if [ ! -z "$(type -t "curl")" ]; then + printf -- "%d" $hestiaKERNEL_ERROR_OK + return $hestiaKERNEL_ERROR_OK + fi + + + # report status + printf -- "%d" $hestiaKERNEL_ERROR_DATA_EMPTY + return $hestiaKERNEL_ERROR_DATA_EMPTY +} +################################################################################ +# Unix Main Codes # +################################################################################ +return 0 +#> diff --git a/automataCI/services/hestiaHTTP/Vanilla.sh.ps1 b/automataCI/services/hestiaHTTP/Vanilla.sh.ps1 new file mode 100755 index 0000000..10d2dcf --- /dev/null +++ b/automataCI/services/hestiaHTTP/Vanilla.sh.ps1 @@ -0,0 +1,54 @@ +echo \" <<'RUN_AS_BATCH' >/dev/null ">NUL "\" \`" <#" +@ECHO OFF +REM LICENSE CLAUSES HERE +REM ---------------------------------------------------------------------------- + + + + +REM ############################################################################ +REM # Windows BATCH Codes # +REM ############################################################################ +where /q powershell +if errorlevel 1 ( + echo "ERROR: missing powershell facility." + exit /b 1 +) + +copy /Y "%~nx0" "%~n0.ps1" >nul +timeout /t 1 /nobreak >nul +powershell -executionpolicy remotesigned -Command "& '.\%~n0.ps1' %*" +start /b "" cmd /c del "%~f0" & exit /b %errorcode% +REM ############################################################################ +REM # Windows BATCH Codes # +REM ############################################################################ +RUN_AS_BATCH +#> | Out-Null + + + + +echo \" <<'RUN_AS_POWERSHELL' >/dev/null # " | Out-Null +################################################################################ +# Windows POWERSHELL Codes # +################################################################################ +. "${env:LIBS_HESTIA}\hestiaHTTP\Is_Available.sh.ps1" +################################################################################ +# Windows POWERSHELL Codes # +################################################################################ +return +<# +RUN_AS_POWERSHELL + + + + +################################################################################ +# Unix Main Codes # +################################################################################ +. "${LIBS_HESTIA}/hestiaHTTP/Is_Available.sh.ps1" +################################################################################ +# Unix Main Codes # +################################################################################ +return 0 +#> diff --git a/automataCI/services/hestiaI18N/Translate-All-Components-Description.sh.ps1 b/automataCI/services/hestiaI18N/Translate_All_Components_Description.sh.ps1 similarity index 100% rename from automataCI/services/hestiaI18N/Translate-All-Components-Description.sh.ps1 rename to automataCI/services/hestiaI18N/Translate_All_Components_Description.sh.ps1 diff --git a/automataCI/services/hestiaI18N/Translate-All-Components-Title.sh.ps1 b/automataCI/services/hestiaI18N/Translate_All_Components_Title.sh.ps1 similarity index 100% rename from automataCI/services/hestiaI18N/Translate-All-Components-Title.sh.ps1 rename to automataCI/services/hestiaI18N/Translate_All_Components_Title.sh.ps1 diff --git a/automataCI/services/hestiaI18N/Translate-Already-Latest-Version.sh.ps1 b/automataCI/services/hestiaI18N/Translate_Already_Latest_Version.sh.ps1 similarity index 100% rename from automataCI/services/hestiaI18N/Translate-Already-Latest-Version.sh.ps1 rename to automataCI/services/hestiaI18N/Translate_Already_Latest_Version.sh.ps1 diff --git a/automataCI/services/hestiaI18N/Translate-Bin-Components-Description.sh.ps1 b/automataCI/services/hestiaI18N/Translate_Bin_Components_Description.sh.ps1 similarity index 100% rename from automataCI/services/hestiaI18N/Translate-Bin-Components-Description.sh.ps1 rename to automataCI/services/hestiaI18N/Translate_Bin_Components_Description.sh.ps1 diff --git a/automataCI/services/hestiaI18N/Translate-Bin-Components-Title.sh.ps1 b/automataCI/services/hestiaI18N/Translate_Bin_Components_Title.sh.ps1 similarity index 100% rename from automataCI/services/hestiaI18N/Translate-Bin-Components-Title.sh.ps1 rename to automataCI/services/hestiaI18N/Translate_Bin_Components_Title.sh.ps1 diff --git a/automataCI/services/hestiaI18N/Translate-Config-Components-Description.sh.ps1 b/automataCI/services/hestiaI18N/Translate_Config_Components_Description.sh.ps1 similarity index 100% rename from automataCI/services/hestiaI18N/Translate-Config-Components-Description.sh.ps1 rename to automataCI/services/hestiaI18N/Translate_Config_Components_Description.sh.ps1 diff --git a/automataCI/services/hestiaI18N/Translate-Config-Components-Title.sh.ps1 b/automataCI/services/hestiaI18N/Translate_Config_Components_Title.sh.ps1 similarity index 100% rename from automataCI/services/hestiaI18N/Translate-Config-Components-Title.sh.ps1 rename to automataCI/services/hestiaI18N/Translate_Config_Components_Title.sh.ps1 diff --git a/automataCI/services/hestiaI18N/Translate-Docs-Components-Description.sh.ps1 b/automataCI/services/hestiaI18N/Translate_Docs_Components_Description.sh.ps1 similarity index 100% rename from automataCI/services/hestiaI18N/Translate-Docs-Components-Description.sh.ps1 rename to automataCI/services/hestiaI18N/Translate_Docs_Components_Description.sh.ps1 diff --git a/automataCI/services/hestiaI18N/Translate-Docs-Components-Title.sh.ps1 b/automataCI/services/hestiaI18N/Translate_Docs_Components_Title.sh.ps1 similarity index 100% rename from automataCI/services/hestiaI18N/Translate-Docs-Components-Title.sh.ps1 rename to automataCI/services/hestiaI18N/Translate_Docs_Components_Title.sh.ps1 diff --git a/automataCI/services/hestiaI18N/Translate_Done.sh.ps1 b/automataCI/services/hestiaI18N/Translate_Done.sh.ps1 new file mode 100755 index 0000000..4e36be0 --- /dev/null +++ b/automataCI/services/hestiaI18N/Translate_Done.sh.ps1 @@ -0,0 +1,88 @@ +echo \" <<'RUN_AS_BATCH' >/dev/null ">NUL "\" \`" <#" +@ECHO OFF +REM LICENSE CLAUSES HERE +REM ---------------------------------------------------------------------------- + + + + +REM ############################################################################ +REM # Windows BATCH Codes # +REM ############################################################################ +where /q powershell +if errorlevel 1 ( + echo "ERROR: missing powershell facility." + exit /b 1 +) + +copy /Y "%~nx0" "%~n0.ps1" >nul +timeout /t 1 /nobreak >nul +powershell -executionpolicy remotesigned -Command "& '.\%~n0.ps1' %*" +start /b "" cmd /c del "%~f0" & exit /b %errorcode% +REM ############################################################################ +REM # Windows BATCH Codes # +REM ############################################################################ +RUN_AS_BATCH +#> | Out-Null + + + + +echo \" <<'RUN_AS_POWERSHELL' >/dev/null # " | Out-Null +################################################################################ +# Windows POWERSHELL Codes # +################################################################################ +function hestiaI18N-Translate-Done() { + param( + [string]$___locale + ) + + + # execute + switch (${___locale}) { + "zh-hans" { + # 简体中文 + return "搞定" + } default { + # fallback to default english + return "done" + }} +} +################################################################################ +# Windows POWERSHELL Codes # +################################################################################ +return +<# +RUN_AS_POWERSHELL + + + + +################################################################################ +# Unix Main Codes # +################################################################################ +hestiaI18N_Translate_Done() { + #___locale="$1" + + + # execute + case "$1" in + zh-hans) + # 简体中文 + printf -- "搞定" + ;; + *) + # fallback to default english + printf -- "done" + ;; + esac + + + # report status + return 0 +} +################################################################################ +# Unix Main Codes # +################################################################################ +return 0 +#> diff --git a/automataCI/services/hestiaI18N/Translate_Error.sh.ps1 b/automataCI/services/hestiaI18N/Translate_Error.sh.ps1 new file mode 100755 index 0000000..99f3db1 --- /dev/null +++ b/automataCI/services/hestiaI18N/Translate_Error.sh.ps1 @@ -0,0 +1,88 @@ +echo \" <<'RUN_AS_BATCH' >/dev/null ">NUL "\" \`" <#" +@ECHO OFF +REM LICENSE CLAUSES HERE +REM ---------------------------------------------------------------------------- + + + + +REM ############################################################################ +REM # Windows BATCH Codes # +REM ############################################################################ +where /q powershell +if errorlevel 1 ( + echo "ERROR: missing powershell facility." + exit /b 1 +) + +copy /Y "%~nx0" "%~n0.ps1" >nul +timeout /t 1 /nobreak >nul +powershell -executionpolicy remotesigned -Command "& '.\%~n0.ps1' %*" +start /b "" cmd /c del "%~f0" & exit /b %errorcode% +REM ############################################################################ +REM # Windows BATCH Codes # +REM ############################################################################ +RUN_AS_BATCH +#> | Out-Null + + + + +echo \" <<'RUN_AS_POWERSHELL' >/dev/null # " | Out-Null +################################################################################ +# Windows POWERSHELL Codes # +################################################################################ +function hestiaI18N-Translate-Error() { + param( + [string]$___locale + ) + + + # execute + switch (${___locale}) { + "zh-hans" { + # 简体中文 + return "错误" + } default { + # fallback to default english + return "error" + }} +} +################################################################################ +# Windows POWERSHELL Codes # +################################################################################ +return +<# +RUN_AS_POWERSHELL + + + + +################################################################################ +# Unix Main Codes # +################################################################################ +hestiaI18N_Translate_Error() { + #___locale="$1" + + + # execute + case "$1" in + zh-hans) + # 简体中文 + printf -- "错误" + ;; + *) + # fallback to default english + printf -- "error" + ;; + esac + + + # report status + return 0 +} +################################################################################ +# Unix Main Codes # +################################################################################ +return 0 +#> diff --git a/automataCI/services/hestiaI18N/Translate_Info.sh.ps1 b/automataCI/services/hestiaI18N/Translate_Info.sh.ps1 new file mode 100755 index 0000000..261d3b5 --- /dev/null +++ b/automataCI/services/hestiaI18N/Translate_Info.sh.ps1 @@ -0,0 +1,88 @@ +echo \" <<'RUN_AS_BATCH' >/dev/null ">NUL "\" \`" <#" +@ECHO OFF +REM LICENSE CLAUSES HERE +REM ---------------------------------------------------------------------------- + + + + +REM ############################################################################ +REM # Windows BATCH Codes # +REM ############################################################################ +where /q powershell +if errorlevel 1 ( + echo "ERROR: missing powershell facility." + exit /b 1 +) + +copy /Y "%~nx0" "%~n0.ps1" >nul +timeout /t 1 /nobreak >nul +powershell -executionpolicy remotesigned -Command "& '.\%~n0.ps1' %*" +start /b "" cmd /c del "%~f0" & exit /b %errorcode% +REM ############################################################################ +REM # Windows BATCH Codes # +REM ############################################################################ +RUN_AS_BATCH +#> | Out-Null + + + + +echo \" <<'RUN_AS_POWERSHELL' >/dev/null # " | Out-Null +################################################################################ +# Windows POWERSHELL Codes # +################################################################################ +function hestiaI18N-Translate-Info() { + param( + [string]$___locale + ) + + + # execute + switch (${___locale}) { + "zh-hans" { + # 简体中文 + return "详情" + } default { + # fallback to default english + return "info" + }} +} +################################################################################ +# Windows POWERSHELL Codes # +################################################################################ +return +<# +RUN_AS_POWERSHELL + + + + +################################################################################ +# Unix Main Codes # +################################################################################ +hestiaI18N_Translate_Info() { + #___locale="$1" + + + # execute + case "$1" in + zh-hans) + # 简体中文 + printf -- "详情" + ;; + *) + # fallback to default english + printf -- "info" + ;; + esac + + + # report status + return 0 +} +################################################################################ +# Unix Main Codes # +################################################################################ +return 0 +#> diff --git a/automataCI/services/hestiaI18N/Translate-Lib-Components-Description.sh.ps1 b/automataCI/services/hestiaI18N/Translate_Lib_Components_Description.sh.ps1 similarity index 100% rename from automataCI/services/hestiaI18N/Translate-Lib-Components-Description.sh.ps1 rename to automataCI/services/hestiaI18N/Translate_Lib_Components_Description.sh.ps1 diff --git a/automataCI/services/hestiaI18N/Translate-Lib-Components-Title.sh.ps1 b/automataCI/services/hestiaI18N/Translate_Lib_Components_Title.sh.ps1 similarity index 100% rename from automataCI/services/hestiaI18N/Translate-Lib-Components-Title.sh.ps1 rename to automataCI/services/hestiaI18N/Translate_Lib_Components_Title.sh.ps1 diff --git a/automataCI/services/hestiaI18N/Translate-Main-Components-Description.sh.ps1 b/automataCI/services/hestiaI18N/Translate_Main_Components_Description.sh.ps1 similarity index 100% rename from automataCI/services/hestiaI18N/Translate-Main-Components-Description.sh.ps1 rename to automataCI/services/hestiaI18N/Translate_Main_Components_Description.sh.ps1 diff --git a/automataCI/services/hestiaI18N/Translate-Main-Components-Title.sh.ps1 b/automataCI/services/hestiaI18N/Translate_Main_Components_Title.sh.ps1 similarity index 100% rename from automataCI/services/hestiaI18N/Translate-Main-Components-Title.sh.ps1 rename to automataCI/services/hestiaI18N/Translate_Main_Components_Title.sh.ps1 diff --git a/automataCI/services/hestiaI18N/Translate_Note.sh.ps1 b/automataCI/services/hestiaI18N/Translate_Note.sh.ps1 new file mode 100755 index 0000000..eea3fbd --- /dev/null +++ b/automataCI/services/hestiaI18N/Translate_Note.sh.ps1 @@ -0,0 +1,88 @@ +echo \" <<'RUN_AS_BATCH' >/dev/null ">NUL "\" \`" <#" +@ECHO OFF +REM LICENSE CLAUSES HERE +REM ---------------------------------------------------------------------------- + + + + +REM ############################################################################ +REM # Windows BATCH Codes # +REM ############################################################################ +where /q powershell +if errorlevel 1 ( + echo "ERROR: missing powershell facility." + exit /b 1 +) + +copy /Y "%~nx0" "%~n0.ps1" >nul +timeout /t 1 /nobreak >nul +powershell -executionpolicy remotesigned -Command "& '.\%~n0.ps1' %*" +start /b "" cmd /c del "%~f0" & exit /b %errorcode% +REM ############################################################################ +REM # Windows BATCH Codes # +REM ############################################################################ +RUN_AS_BATCH +#> | Out-Null + + + + +echo \" <<'RUN_AS_POWERSHELL' >/dev/null # " | Out-Null +################################################################################ +# Windows POWERSHELL Codes # +################################################################################ +function hestiaI18N-Translate-Note() { + param( + [string]$___locale + ) + + + # execute + switch (${___locale}) { + "zh-hans" { + # 简体中文 + return "信息" + } default { + # fallback to default english + return "note" + }} +} +################################################################################ +# Windows POWERSHELL Codes # +################################################################################ +return +<# +RUN_AS_POWERSHELL + + + + +################################################################################ +# Unix Main Codes # +################################################################################ +hestiaI18N_Translate_Note() { + #___locale="$1" + + + # execute + case "$1" in + zh-hans) + # 简体中文 + printf -- "信息" + ;; + *) + # fallback to default english + printf -- "note" + ;; + esac + + + # report status + return 0 +} +################################################################################ +# Unix Main Codes # +################################################################################ +return 0 +#> diff --git a/automataCI/services/hestiaI18N/Translate_OK.sh.ps1 b/automataCI/services/hestiaI18N/Translate_OK.sh.ps1 new file mode 100755 index 0000000..554444b --- /dev/null +++ b/automataCI/services/hestiaI18N/Translate_OK.sh.ps1 @@ -0,0 +1,88 @@ +echo \" <<'RUN_AS_BATCH' >/dev/null ">NUL "\" \`" <#" +@ECHO OFF +REM LICENSE CLAUSES HERE +REM ---------------------------------------------------------------------------- + + + + +REM ############################################################################ +REM # Windows BATCH Codes # +REM ############################################################################ +where /q powershell +if errorlevel 1 ( + echo "ERROR: missing powershell facility." + exit /b 1 +) + +copy /Y "%~nx0" "%~n0.ps1" >nul +timeout /t 1 /nobreak >nul +powershell -executionpolicy remotesigned -Command "& '.\%~n0.ps1' %*" +start /b "" cmd /c del "%~f0" & exit /b %errorcode% +REM ############################################################################ +REM # Windows BATCH Codes # +REM ############################################################################ +RUN_AS_BATCH +#> | Out-Null + + + + +echo \" <<'RUN_AS_POWERSHELL' >/dev/null # " | Out-Null +################################################################################ +# Windows POWERSHELL Codes # +################################################################################ +function hestiaI18N-Translate-OK() { + param( + [string]$___locale + ) + + + # execute + switch (${___locale}) { + "zh-hans" { + # 简体中文 + return "可行" + } default { + # fallback to default english + return "ok" + }} +} +################################################################################ +# Windows POWERSHELL Codes # +################################################################################ +return +<# +RUN_AS_POWERSHELL + + + + +################################################################################ +# Unix Main Codes # +################################################################################ +hestiaI18N_Translate_OK() { + #___locale="$1" + + + # execute + case "$1" in + zh-hans) + # 简体中文 + printf -- "可行" + ;; + *) + # fallback to default english + printf -- "ok" + ;; + esac + + + # report status + return 0 +} +################################################################################ +# Unix Main Codes # +################################################################################ +return 0 +#> diff --git a/automataCI/services/hestiaI18N/Translate-Only-Install-On-Windows.sh.ps1 b/automataCI/services/hestiaI18N/Translate_Only_Install_On_Windows.sh.ps1 similarity index 100% rename from automataCI/services/hestiaI18N/Translate-Only-Install-On-Windows.sh.ps1 rename to automataCI/services/hestiaI18N/Translate_Only_Install_On_Windows.sh.ps1 diff --git a/automataCI/services/hestiaI18N/Translate_Publish.sh.ps1 b/automataCI/services/hestiaI18N/Translate_Publish.sh.ps1 new file mode 100755 index 0000000..4dfa92a --- /dev/null +++ b/automataCI/services/hestiaI18N/Translate_Publish.sh.ps1 @@ -0,0 +1,94 @@ +echo \" <<'RUN_AS_BATCH' >/dev/null ">NUL "\" \`" <#" +@ECHO OFF +REM LICENSE CLAUSES HERE +REM ---------------------------------------------------------------------------- + + + + +REM ############################################################################ +REM # Windows BATCH Codes # +REM ############################################################################ +where /q powershell +if errorlevel 1 ( + echo "ERROR: missing powershell facility." + exit /b 1 +) + +copy /Y "%~nx0" "%~n0.ps1" >nul +timeout /t 1 /nobreak >nul +powershell -executionpolicy remotesigned -Command "& '.\%~n0.ps1' %*" +start /b "" cmd /c del "%~f0" & exit /b %errorcode% +REM ############################################################################ +REM # Windows BATCH Codes # +REM ############################################################################ +RUN_AS_BATCH +#> | Out-Null + + + + +echo \" <<'RUN_AS_POWERSHELL' >/dev/null # " | Out-Null +################################################################################ +# Windows POWERSHELL Codes # +################################################################################ +function hestiaI18N-Translate-Publish() { + param( + [string]$___locale, + [string]$___subject + ) + + + # execute + switch (${___locale}) { + "zh-hans" { + # 简体中文 + return "正在发布‘${___subject}’。。。" + } default { + # fallback to default english + return "Publishing '${___subject}'..." + }} + + + # report status + return 0 +} +################################################################################ +# Windows POWERSHELL Codes # +################################################################################ +return +<# +RUN_AS_POWERSHELL + + + + +################################################################################ +# Unix Main Codes # +################################################################################ +hestiaI18N_Translate_Publish() { + #___locale="$1" + #___subject="$2" + + + # execute + case "$1" in + zh-hans) + # 简体中文 + printf -- "%b" "正在发布‘${___subject}’。。。" + ;; + *) + # fallback to default english + printf -- "%b" "Publishing '${___subject}'..." + ;; + esac + + + # report status + return 0 +} +################################################################################ +# Unix Main Codes # +################################################################################ +return 0 +#> diff --git a/automataCI/services/hestiaI18N/Translate_Publish_Failed.sh.ps1 b/automataCI/services/hestiaI18N/Translate_Publish_Failed.sh.ps1 new file mode 100755 index 0000000..f22ef58 --- /dev/null +++ b/automataCI/services/hestiaI18N/Translate_Publish_Failed.sh.ps1 @@ -0,0 +1,92 @@ +echo \" <<'RUN_AS_BATCH' >/dev/null ">NUL "\" \`" <#" +@ECHO OFF +REM LICENSE CLAUSES HERE +REM ---------------------------------------------------------------------------- + + + + +REM ############################################################################ +REM # Windows BATCH Codes # +REM ############################################################################ +where /q powershell +if errorlevel 1 ( + echo "ERROR: missing powershell facility." + exit /b 1 +) + +copy /Y "%~nx0" "%~n0.ps1" >nul +timeout /t 1 /nobreak >nul +powershell -executionpolicy remotesigned -Command "& '.\%~n0.ps1' %*" +start /b "" cmd /c del "%~f0" & exit /b %errorcode% +REM ############################################################################ +REM # Windows BATCH Codes # +REM ############################################################################ +RUN_AS_BATCH +#> | Out-Null + + + + +echo \" <<'RUN_AS_POWERSHELL' >/dev/null # " | Out-Null +################################################################################ +# Windows POWERSHELL Codes # +################################################################################ +function hestiaI18N-Translate-Publish-Failed() { + param( + [string]$___locale + ) + + + # execute + switch (${___locale}) { + "zh-hans" { + # 简体中文 + return "发布失败!" + } default { + # fallback to default english + return "publish failed!" + }} + + + # report status + return 0 +} +################################################################################ +# Windows POWERSHELL Codes # +################################################################################ +return +<# +RUN_AS_POWERSHELL + + + + +################################################################################ +# Unix Main Codes # +################################################################################ +hestiaI18N_Translate_Publish_Failed() { + #___locale="$1" + + + # execute + case "$1" in + zh-hans) + # 简体中文 + printf -- "发布失败!" + ;; + *) + # fallback to default english + printf -- "publish failed!" + ;; + esac + + + # report status + return 0 +} +################################################################################ +# Unix Main Codes # +################################################################################ +return 0 +#> diff --git a/automataCI/services/hestiaI18N/Translate_Publish_Simulate.sh.ps1 b/automataCI/services/hestiaI18N/Translate_Publish_Simulate.sh.ps1 new file mode 100755 index 0000000..f6ac3c8 --- /dev/null +++ b/automataCI/services/hestiaI18N/Translate_Publish_Simulate.sh.ps1 @@ -0,0 +1,93 @@ +echo \" <<'RUN_AS_BATCH' >/dev/null ">NUL "\" \`" <#" +@ECHO OFF +REM LICENSE CLAUSES HERE +REM ---------------------------------------------------------------------------- + + + + +REM ############################################################################ +REM # Windows BATCH Codes # +REM ############################################################################ +where /q powershell +if errorlevel 1 ( + echo "ERROR: missing powershell facility." + exit /b 1 +) + +copy /Y "%~nx0" "%~n0.ps1" >nul +timeout /t 1 /nobreak >nul +powershell -executionpolicy remotesigned -Command "& '.\%~n0.ps1' %*" +start /b "" cmd /c del "%~f0" & exit /b %errorcode% +REM ############################################################################ +REM # Windows BATCH Codes # +REM ############################################################################ +RUN_AS_BATCH +#> | Out-Null + + + + +echo \" <<'RUN_AS_POWERSHELL' >/dev/null # " | Out-Null +################################################################################ +# Windows POWERSHELL Codes # +################################################################################ +function hestiaI18N-Translate-Publish_Simulate() { + param( + [string]$___locale, + [string]$___subject + ) + + + # execute + switch (${___locale}) { + "zh-hans" { + # 简体中文 + return "正在仿真着发布‘${___subject}’。。。" + } default { + # fallback to default english + return "Simulate Publishing '${___subject}'..." + }} + + + # report status + return 0 +} +################################################################################ +# Windows POWERSHELL Codes # +################################################################################ +return +<# +RUN_AS_POWERSHELL + + + + +################################################################################ +# Unix Main Codes # +################################################################################ +hestiaI18N_Translate_Publish_Simulate() { + #___locale="$1" + #___subject="$2" + + + # execute + case "$1" in + zh-hans) + # 简体中文 + printf -- "%b" "正在仿真着发布‘${___subject}’。。。" + ;; + *) + # fallback to default english + printf -- "%b" "Simulate Publishing '${___subject}'..." + esac + + + # report status + return 0 +} +################################################################################ +# Unix Main Codes # +################################################################################ +return 0 +#> diff --git a/automataCI/services/hestiaI18N/Translate_Success.sh.ps1 b/automataCI/services/hestiaI18N/Translate_Success.sh.ps1 new file mode 100755 index 0000000..52f97f4 --- /dev/null +++ b/automataCI/services/hestiaI18N/Translate_Success.sh.ps1 @@ -0,0 +1,88 @@ +echo \" <<'RUN_AS_BATCH' >/dev/null ">NUL "\" \`" <#" +@ECHO OFF +REM LICENSE CLAUSES HERE +REM ---------------------------------------------------------------------------- + + + + +REM ############################################################################ +REM # Windows BATCH Codes # +REM ############################################################################ +where /q powershell +if errorlevel 1 ( + echo "ERROR: missing powershell facility." + exit /b 1 +) + +copy /Y "%~nx0" "%~n0.ps1" >nul +timeout /t 1 /nobreak >nul +powershell -executionpolicy remotesigned -Command "& '.\%~n0.ps1' %*" +start /b "" cmd /c del "%~f0" & exit /b %errorcode% +REM ############################################################################ +REM # Windows BATCH Codes # +REM ############################################################################ +RUN_AS_BATCH +#> | Out-Null + + + + +echo \" <<'RUN_AS_POWERSHELL' >/dev/null # " | Out-Null +################################################################################ +# Windows POWERSHELL Codes # +################################################################################ +function hestiaI18N-Translate-Success() { + param( + [string]$___locale + ) + + + # execute + switch (${___locale}) { + "zh-hans" { + # 简体中文 + return "成功" + } default { + # fallback to default english + return "success" + }} +} +################################################################################ +# Windows POWERSHELL Codes # +################################################################################ +return +<# +RUN_AS_POWERSHELL + + + + +################################################################################ +# Unix Main Codes # +################################################################################ +hestiaI18N_Translate_Success() { + #___locale="$1" + + + # execute + case "$1" in + zh-hans) + # 简体中文 + printf -- "成功" + ;; + *) + # fallback to default english + printf -- "success" + ;; + esac + + + # report status + return 0 +} +################################################################################ +# Unix Main Codes # +################################################################################ +return 0 +#> diff --git a/automataCI/services/hestiaI18N/Translate_Warning.sh.ps1 b/automataCI/services/hestiaI18N/Translate_Warning.sh.ps1 new file mode 100755 index 0000000..989fc02 --- /dev/null +++ b/automataCI/services/hestiaI18N/Translate_Warning.sh.ps1 @@ -0,0 +1,88 @@ +echo \" <<'RUN_AS_BATCH' >/dev/null ">NUL "\" \`" <#" +@ECHO OFF +REM LICENSE CLAUSES HERE +REM ---------------------------------------------------------------------------- + + + + +REM ############################################################################ +REM # Windows BATCH Codes # +REM ############################################################################ +where /q powershell +if errorlevel 1 ( + echo "ERROR: missing powershell facility." + exit /b 1 +) + +copy /Y "%~nx0" "%~n0.ps1" >nul +timeout /t 1 /nobreak >nul +powershell -executionpolicy remotesigned -Command "& '.\%~n0.ps1' %*" +start /b "" cmd /c del "%~f0" & exit /b %errorcode% +REM ############################################################################ +REM # Windows BATCH Codes # +REM ############################################################################ +RUN_AS_BATCH +#> | Out-Null + + + + +echo \" <<'RUN_AS_POWERSHELL' >/dev/null # " | Out-Null +################################################################################ +# Windows POWERSHELL Codes # +################################################################################ +function hestiaI18N-Translate-Warning() { + param( + [string]$___locale + ) + + + # execute + switch (${___locale}) { + "zh-hans" { + # 简体中文 + return "注意" + } default { + # fallback to default english + return "warning" + }} +} +################################################################################ +# Windows POWERSHELL Codes # +################################################################################ +return +<# +RUN_AS_POWERSHELL + + + + +################################################################################ +# Unix Main Codes # +################################################################################ +hestiaI18N_Translate_Warning() { + #___locale="$1" + + + # execute + case "$1" in + zh-hans) + # 简体中文 + printf -- "注意" + ;; + *) + # fallback to default english + printf -- "warning" + ;; + esac + + + # report status + return 0 +} +################################################################################ +# Unix Main Codes # +################################################################################ +return 0 +#> diff --git a/automataCI/services/hestiaI18N/Vanilla.sh.ps1 b/automataCI/services/hestiaI18N/Vanilla.sh.ps1 index 2dc2478..31ba547 100755 --- a/automataCI/services/hestiaI18N/Vanilla.sh.ps1 +++ b/automataCI/services/hestiaI18N/Vanilla.sh.ps1 @@ -33,20 +33,27 @@ echo \" <<'RUN_AS_POWERSHELL' >/dev/null # " | Out-Null # Windows POWERSHELL Codes # ################################################################################ . "${env:LIBS_HESTIA}\hestiaI18N\Get_Languages_List.sh.ps1" -. "${env:LIBS_HESTIA}\hestiaI18N\Translate-Already-Latest-Version.sh.ps1" -. "${env:LIBS_HESTIA}\hestiaI18N\Translate-All-Components-Description.sh.ps1" -. "${env:LIBS_HESTIA}\hestiaI18N\Translate-All-Components-Title.sh.ps1" -. "${env:LIBS_HESTIA}\hestiaI18N\Translate-Bin-Components-Description.sh.ps1" -. "${env:LIBS_HESTIA}\hestiaI18N\Translate-Bin-Components-Title.sh.ps1" -. "${env:LIBS_HESTIA}\hestiaI18N\Translate-Docs-Components-Description.sh.ps1" -. "${env:LIBS_HESTIA}\hestiaI18N\Translate-Docs-Components-Title.sh.ps1" -. "${env:LIBS_HESTIA}\hestiaI18N\Translate-Config-Components-Description.sh.ps1" -. "${env:LIBS_HESTIA}\hestiaI18N\Translate-Config-Components-Title.sh.ps1" -. "${env:LIBS_HESTIA}\hestiaI18N\Translate-Lib-Components-Description.sh.ps1" -. "${env:LIBS_HESTIA}\hestiaI18N\Translate-Lib-Components-Title.sh.ps1" -. "${env:LIBS_HESTIA}\hestiaI18N\Translate-Main-Components-Description.sh.ps1" -. "${env:LIBS_HESTIA}\hestiaI18N\Translate-Main-Components-Title.sh.ps1" -. "${env:LIBS_HESTIA}\hestiaI18N\Translate-Only-Install-On-Windows.sh.ps1" +. "${env:LIBS_HESTIA}\hestiaI18N\Translate_Already_Latest_Version.sh.ps1" +. "${env:LIBS_HESTIA}\hestiaI18N\Translate_All_Components_Description.sh.ps1" +. "${env:LIBS_HESTIA}\hestiaI18N\Translate_All_Components_Title.sh.ps1" +. "${env:LIBS_HESTIA}\hestiaI18N\Translate_Bin_Components_Description.sh.ps1" +. "${env:LIBS_HESTIA}\hestiaI18N\Translate_Bin_Components_Title.sh.ps1" +. "${env:LIBS_HESTIA}\hestiaI18N\Translate_Docs_Components_Description.sh.ps1" +. "${env:LIBS_HESTIA}\hestiaI18N\Translate_Docs_Components_Title.sh.ps1" +. "${env:LIBS_HESTIA}\hestiaI18N\Translate_Done.sh.ps1" +. "${env:LIBS_HESTIA}\hestiaI18N\Translate_Error.sh.ps1" +. "${env:LIBS_HESTIA}\hestiaI18N\Translate_Config_Components_Description.sh.ps1" +. "${env:LIBS_HESTIA}\hestiaI18N\Translate_Config_Components_Title.sh.ps1" +. "${env:LIBS_HESTIA}\hestiaI18N\Translate_Info.sh.ps1" +. "${env:LIBS_HESTIA}\hestiaI18N\Translate_Lib_Components_Description.sh.ps1" +. "${env:LIBS_HESTIA}\hestiaI18N\Translate_Lib_Components_Title.sh.ps1" +. "${env:LIBS_HESTIA}\hestiaI18N\Translate_Main_Components_Description.sh.ps1" +. "${env:LIBS_HESTIA}\hestiaI18N\Translate_Main_Components_Title.sh.ps1" +. "${env:LIBS_HESTIA}\hestiaI18N\Translate_Note.sh.ps1" +. "${env:LIBS_HESTIA}\hestiaI18N\Translate_Only_Install_On_Windows.sh.ps1" +. "${env:LIBS_HESTIA}\hestiaI18N\Translate_OK.sh.ps1" +. "${env:LIBS_HESTIA}\hestiaI18N\Translate_Success.sh.ps1" +. "${env:LIBS_HESTIA}\hestiaI18N\Translate_Warning.sh.ps1" ################################################################################ # Windows POWERSHELL Codes # ################################################################################ @@ -61,20 +68,27 @@ RUN_AS_POWERSHELL # Unix Main Codes # ################################################################################ . "${LIBS_HESTIA}/hestiaI18N/Get_Languages_List.sh.ps1" -. "${LIBS_HESTIA}/hestiaI18N/Translate-Already-Latest-Version.sh.ps1" -. "${LIBS_HESTIA}/hestiaI18N/Translate-All-Components-Description.sh.ps1" -. "${LIBS_HESTIA}/hestiaI18N/Translate-All-Components-Title.sh.ps1" -. "${LIBS_HESTIA}/hestiaI18N/Translate-Bin-Components-Description.sh.ps1" -. "${LIBS_HESTIA}/hestiaI18N/Translate-Bin-Components-Title.sh.ps1" -. "${LIBS_HESTIA}/hestiaI18N/Translate-Docs-Components-Description.sh.ps1" -. "${LIBS_HESTIA}/hestiaI18N/Translate-Docs-Components-Title.sh.ps1" -. "${LIBS_HESTIA}/hestiaI18N/Translate-Config-Components-Description.sh.ps1" -. "${LIBS_HESTIA}/hestiaI18N/Translate-Config-Components-Title.sh.ps1" -. "${LIBS_HESTIA}/hestiaI18N/Translate-Lib-Components-Description.sh.ps1" -. "${LIBS_HESTIA}/hestiaI18N/Translate-Lib-Components-Title.sh.ps1" -. "${LIBS_HESTIA}/hestiaI18N/Translate-Main-Components-Description.sh.ps1" -. "${LIBS_HESTIA}/hestiaI18N/Translate-Main-Components-Title.sh.ps1" -. "${LIBS_HESTIA}/hestiaI18N/Translate-Only-Install-On-Windows.sh.ps1" +. "${LIBS_HESTIA}/hestiaI18N/Translate_Already_Latest_Version.sh.ps1" +. "${LIBS_HESTIA}/hestiaI18N/Translate_All_Components_Description.sh.ps1" +. "${LIBS_HESTIA}/hestiaI18N/Translate_All_Components_Title.sh.ps1" +. "${LIBS_HESTIA}/hestiaI18N/Translate_Bin_Components_Description.sh.ps1" +. "${LIBS_HESTIA}/hestiaI18N/Translate_Bin_Components_Title.sh.ps1" +. "${LIBS_HESTIA}/hestiaI18N/Translate_Docs_Components_Description.sh.ps1" +. "${LIBS_HESTIA}/hestiaI18N/Translate_Docs_Components_Title.sh.ps1" +. "${LIBS_HESTIA}/hestiaI18N/Translate_Done.sh.ps1" +. "${LIBS_HESTIA}/hestiaI18N/Translate_Error.sh.ps1" +. "${LIBS_HESTIA}/hestiaI18N/Translate_Config_Components_Description.sh.ps1" +. "${LIBS_HESTIA}/hestiaI18N/Translate_Config_Components_Title.sh.ps1" +. "${LIBS_HESTIA}/hestiaI18N/Translate_Info.sh.ps1" +. "${LIBS_HESTIA}/hestiaI18N/Translate_Lib_Components_Description.sh.ps1" +. "${LIBS_HESTIA}/hestiaI18N/Translate_Lib_Components_Title.sh.ps1" +. "${LIBS_HESTIA}/hestiaI18N/Translate_Main_Components_Description.sh.ps1" +. "${LIBS_HESTIA}/hestiaI18N/Translate_Main_Components_Title.sh.ps1" +. "${LIBS_HESTIA}/hestiaI18N/Translate_Note.sh.ps1" +. "${LIBS_HESTIA}/hestiaI18N/Translate_OK.sh.ps1" +. "${LIBS_HESTIA}/hestiaI18N/Translate_Only_Install_On_Windows.sh.ps1" +. "${LIBS_HESTIA}/hestiaI18N/Translate_Success.sh.ps1" +. "${LIBS_HESTIA}/hestiaI18N/Translate_Warning.sh.ps1" ################################################################################ # Unix Main Codes # ################################################################################ diff --git a/automataCI/services/hestiaKERNEL/Error_Codes.sh.ps1 b/automataCI/services/hestiaKERNEL/Error_Codes.sh.ps1 new file mode 100755 index 0000000..4085c1c --- /dev/null +++ b/automataCI/services/hestiaKERNEL/Error_Codes.sh.ps1 @@ -0,0 +1,422 @@ +echo \" <<'RUN_AS_BATCH' >/dev/null ">NUL "\" \`" <#" +@ECHO OFF +REM LICENSE CLAUSES HERE +REM ---------------------------------------------------------------------------- + + + + +REM ############################################################################ +REM # Windows BATCH Codes # +REM ############################################################################ +where /q powershell +if errorlevel 1 ( + echo "ERROR: missing powershell facility." + exit /b 1 +) + +copy /Y "%~nx0" "%~n0.ps1" >nul +timeout /t 1 /nobreak >nul +powershell -executionpolicy remotesigned -Command "& '.\%~n0.ps1' %*" +start /b "" cmd /c del "%~f0" & exit /b %errorcode% +REM ############################################################################ +REM # Windows BATCH Codes # +REM ############################################################################ +RUN_AS_BATCH +#> | Out-Null + + + + +echo \" <<'RUN_AS_POWERSHELL' >/dev/null # " | Out-Null +################################################################################ +# Windows POWERSHELL Codes # +################################################################################ +${env:hestiaKERNEL_ERROR_OK} = 0 +${env:hestiaKERNEL_ERROR_BAD_EXEC} = 1 +${env:hestiaKERNEL_ERROR_BAD_DESCRIPTOR} = 2 +${env:hestiaKERNEL_ERROR_BAD_EXCHANGE} = 3 +${env:hestiaKERNEL_ERROR_BAD_MOUNT} = 4 +${env:hestiaKERNEL_ERROR_BAD_PIPE} = 5 +${env:hestiaKERNEL_ERROR_BAD_REQUEST} = 6 +${env:hestiaKERNEL_ERROR_BAD_STREAM_PIPE} = 7 +${env:hestiaKERNEL_ERROR_CANCELED} = 8 +${env:hestiaKERNEL_ERROR_CLEANING_REQUIRED} = 9 +${env:hestiaKERNEL_ERROR_DEADLOCK} = 10 +${env:hestiaKERNEL_ERROR_EXPIRED} = 11 +${env:hestiaKERNEL_ERROR_ILLEGAL_BYTE_SEQUENCE} = 12 +${env:hestiaKERNEL_ERROR_ILLEGAL_SEEK} = 13 +${env:hestiaKERNEL_ERROR_INVALID_ARGUMENT} = 14 +${env:hestiaKERNEL_ERROR_IS_EMPTY} = 15 +${env:hestiaKERNEL_ERROR_MAXED_EXCHANGE} = 16 +${env:hestiaKERNEL_ERROR_MAXED_QUOTA} = 17 +${env:hestiaKERNEL_ERROR_MISSING_LOCK} = 18 +${env:hestiaKERNEL_ERROR_NOT_EMPTY} = 19 +${env:hestiaKERNEL_ERROR_NOT_PERMITTED} = 20 +${env:hestiaKERNEL_ERROR_NOT_POSSIBLE} = 21 +${env:hestiaKERNEL_ERROR_NOT_POSSIBLE_BY_RFKILL} = 22 +${env:hestiaKERNEL_ERROR_NOT_RECOVERABLE} = 23 +${env:hestiaKERNEL_ERROR_OUT_OF_RANGE} = 24 +${env:hestiaKERNEL_ERROR_PERMISSION_DENIED} = 25 +${env:hestiaKERNEL_ERROR_TIMEOUT} = 26 +${env:hestiaKERNEL_ERROR_TOO_MANY_READ} = 27 +${env:hestiaKERNEL_ERROR_TOO_MANY_LOOP} = 28 +${env:hestiaKERNEL_ERROR_TOO_MANY_REFERENCES} = 29 +${env:hestiaKERNEL_ERROR_TOO_MANY_LINK} = 30 +${env:hestiaKERNEL_ERROR_TRY_AGAIN} = 31 +${env:hestiaKERNEL_ERROR_UNSUPPORTED} = 32 +${env:hestiaKERNEL_ERROR_WOULD_BLOCK} = 33 + +# lifecycle states +${env:hestiaKERNEL_ERROR_RESTART} = 34 +${env:hestiaKERNEL_ERROR_RESUME} = 35 +${env:hestiaKERNEL_ERROR_SHUTDOWN} = 36 +${env:hestiaKERNEL_ERROR_SLEEP} = 37 +${env:hestiaKERNEL_ERROR_STALLED} = 38 +${env:hestiaKERNEL_ERROR_STANDBY} = 39 +${env:hestiaKERNEL_ERROR_PROGRESS_SCHEDULED} = 40 +${env:hestiaKERNEL_ERROR_PROGRESS_ALREADY_EXECUTING} = 41 +${env:hestiaKERNEL_ERROR_PROGRESS_EXECUTING} = 42 +${env:hestiaKERNEL_ERROR_PROGRESS_COMPLETED} = 43 + +# tri-tier inter-package communications +${env:hestiaKERNEL_ERROR_LV1_NOT_SYNC} = 44 +${env:hestiaKERNEL_ERROR_LV1_PAUSED} = 45 +${env:hestiaKERNEL_ERROR_LV1_RESET} = 46 +${env:hestiaKERNEL_ERROR_LV2_NOT_SYNC} = 47 +${env:hestiaKERNEL_ERROR_LV2_PAUSED} = 48 +${env:hestiaKERNEL_ERROR_LV2_RESET} = 49 +${env:hestiaKERNEL_ERROR_LV3_NOT_SYNC} = 50 +${env:hestiaKERNEL_ERROR_LV3_PAUSED} = 51 +${env:hestiaKERNEL_ERROR_LV3_RESET} = 52 + +# data (input/output parameters type etc) +${env:hestiaKERNEL_ERROR_DATA_BAD} = 53 +${env:hestiaKERNEL_ERROR_DATA_EMPTY} = 54 +${env:hestiaKERNEL_ERROR_DATA_INVALID} = 55 +${env:hestiaKERNEL_ERROR_DATA_IS_UNIQUE} = 56 +${env:hestiaKERNEL_ERROR_DATA_MISSING} = 57 +${env:hestiaKERNEL_ERROR_DATA_NOT_UNIQUE} = 58 +${env:hestiaKERNEL_ERROR_DATA_OVERFLOW} = 59 +${env:hestiaKERNEL_ERROR_DATA_REMOVED} = 60 +${env:hestiaKERNEL_ERROR_DATA_TOO_LONG} = 61 +${env:hestiaKERNEL_ERROR_DATA_MISMATCHED} = 62 + +# entity (device file directory object etc) +${env:hestiaKERNEL_ERROR_ENTITY_BAD} = 63 +${env:hestiaKERNEL_ERROR_ENTITY_BUSY} = 64 +${env:hestiaKERNEL_ERROR_ENTITY_DEAD} = 65 +${env:hestiaKERNEL_ERROR_ENTITY_EXISTS} = 66 +${env:hestiaKERNEL_ERROR_ENTITY_FAULTY} = 67 +${env:hestiaKERNEL_ERROR_ENTITY_MISSING} = 68 +${env:hestiaKERNEL_ERROR_ENTITY_MISSING_CHILD} = 69 +${env:hestiaKERNEL_ERROR_ENTITY_OUT_OF_BUFFER} = 70 +${env:hestiaKERNEL_ERROR_ENTITY_POISONED} = 71 +${env:hestiaKERNEL_ERROR_ENTITY_TOO_BIG} = 72 +${env:hestiaKERNEL_ERROR_ENTITY_TOO_MANY_OPENED} = 73 +${env:hestiaKERNEL_ERROR_ENTITY_UNATTACHED} = 74 +${env:hestiaKERNEL_ERROR_ENTITY_IS_NOT_DIRECTORY} = 75 +${env:hestiaKERNEL_ERROR_ENTITY_IS_NOT_FILE} = 76 +${env:hestiaKERNEL_ERROR_ENTITY_IS_NOT_LINK} = 77 +${env:hestiaKERNEL_ERROR_ENTITY_IS_NOT_SOCKET} = 78 +${env:hestiaKERNEL_ERROR_ENTITY_REMOTE_CHANGED} = 79 +${env:hestiaKERNEL_ERROR_ENTITY_REMOTE_ERROR} = 80 +${env:hestiaKERNEL_ERROR_ENTITY_REMOTE_IO} = 81 +${env:hestiaKERNEL_ERROR_ENTITY_MISSING_STREAMABLE_RESOURCES} = 82 +${env:hestiaKERNEL_ERROR_ENTITY_NOT_STREAMABLE} = 83 +${env:hestiaKERNEL_ERROR_ENTITY_STREAMABLE} = 84 +${env:hestiaKERNEL_ERROR_ENTITY_A_TYPEWRITER} = 85 +${env:hestiaKERNEL_ERROR_ENTITY_NOT_A_TYPEWRITER} = 86 +${env:hestiaKERNEL_ERROR_ENTITY_BAD_DESCRIPTOR} = 87 +${env:hestiaKERNEL_ERROR_ENTITY_FILETABLE_OVERFLOW} = 88 + +# key (cryptography) +${env:hestiaKERNEL_ERROR_KEY_BAD} = 89 +${env:hestiaKERNEL_ERROR_KEY_DESTROYED} = 90 +${env:hestiaKERNEL_ERROR_KEY_EXPIRED} = 91 +${env:hestiaKERNEL_ERROR_KEY_MISSING} = 92 +${env:hestiaKERNEL_ERROR_KEY_REJECTED} = 93 +${env:hestiaKERNEL_ERROR_KEY_REVOKED} = 94 + +# library +${env:hestiaKERNEL_ERROR_LIBRARY_BAD} = 95 +${env:hestiaKERNEL_ERROR_LIBRARY_CORRUPTED} = 96 +${env:hestiaKERNEL_ERROR_LIBRARY_EXEC_FAILED} = 97 +${env:hestiaKERNEL_ERROR_LIBRARY_MAXED} = 98 +${env:hestiaKERNEL_ERROR_LIBRARY_MISSING} = 99 + +# network +${env:hestiaKERNEL_ERROR_NETWORK_BAD} = 100 +${env:hestiaKERNEL_ERROR_NETWORK_BAD_AD} = 101 +${env:hestiaKERNEL_ERROR_NETWORK_DOWN} = 102 +${env:hestiaKERNEL_ERROR_NETWORK_NOT_CONNECTED} = 103 +${env:hestiaKERNEL_ERROR_NETWORK_RESET} = 104 +${env:hestiaKERNEL_ERROR_NETWORK_RFS} = 105 +${env:hestiaKERNEL_ERROR_NETWORK_UNREACHABLE} = 106 + +${env:hestiaKERNEL_ERROR_NETWORK_HOST_DOWN} = 107 +${env:hestiaKERNEL_ERROR_NETWORK_HOST_UNREACHABLE} = 108 +${env:hestiaKERNEL_ERROR_NETWORK_SOCKET_UNSUPPORTED} = 109 + +${env:hestiaKERNEL_ERROR_NETWORK_ADDRESS_IN_USE} = 110 +${env:hestiaKERNEL_ERROR_NETWORK_ADDRESS_UNAVAILABLE} = 111 + +${env:hestiaKERNEL_ERROR_NETWORK_CONN_ABORTED} = 112 +${env:hestiaKERNEL_ERROR_NETWORK_CONN_IS_CONNECTED} = 113 +${env:hestiaKERNEL_ERROR_NETWORK_CONN_MISSING_DEST_ADDRESS} = 114 +${env:hestiaKERNEL_ERROR_NETWORK_CONN_MULTIHOP} = 115 +${env:hestiaKERNEL_ERROR_NETWORK_CONN_NOT_CONNECTED} = 116 +${env:hestiaKERNEL_ERROR_NETWORK_CONN_REFUSED} = 117 +${env:hestiaKERNEL_ERROR_NETWORK_CONN_RESET} = 118 + +${env:hestiaKERNEL_ERROR_NETWORK_PAYLOAD_BAD} = 119 +${env:hestiaKERNEL_ERROR_NETWORK_PAYLOAD_EMPTY} = 120 +${env:hestiaKERNEL_ERROR_NETWORK_PAYLOAD_MISSING} = 121 +${env:hestiaKERNEL_ERROR_NETWORK_PAYLOAD_TOO_LONG} = 122 + +# protocol +${env:hestiaKERNEL_ERROR_PROTOCOL_ADDRESS_UNSUPPORTED} = 123 +${env:hestiaKERNEL_ERROR_PROTOCOL_BAD} = 124 +${env:hestiaKERNEL_ERROR_PROTOCOL_FAMILY_UNSUPPORTED} = 125 +${env:hestiaKERNEL_ERROR_PROTOCOL_MISSING} = 126 +${env:hestiaKERNEL_ERROR_PROTOCOL_UNSUPPORTED} = 127 + +# system (e.g. os interactable system) +${env:hestiaKERNEL_ERROR_SYSTEM_BAD_IO} = 128 +${env:hestiaKERNEL_ERROR_SYSTEM_DEVICE_CROSS_LINK} = 129 +${env:hestiaKERNEL_ERROR_SYSTEM_INTERRUPT_CALL} = 130 +${env:hestiaKERNEL_ERROR_SYSTEM_INVALID} = 131 +${env:hestiaKERNEL_ERROR_SYSTEM_MISSING_BLOCK_DEVICE} = 132 +${env:hestiaKERNEL_ERROR_SYSTEM_MISSING_DEVICE} = 133 +${env:hestiaKERNEL_ERROR_SYSTEM_MISSING_IO} = 134 +${env:hestiaKERNEL_ERROR_SYSTEM_MISSING_PROCESS} = 135 +${env:hestiaKERNEL_ERROR_SYSTEM_OUT_OF_DOMAIN} = 136 +${env:hestiaKERNEL_ERROR_SYSTEM_OUT_OF_MEMORY} = 137 +${env:hestiaKERNEL_ERROR_SYSTEM_OUT_OF_SPACE} = 138 +${env:hestiaKERNEL_ERROR_SYSTEM_READ_ONLY_FILESYSTEM} = 139 + +# user +${env:hestiaKERNEL_ERROR_USER_ACCESS_BANNED} = 140 +${env:hestiaKERNEL_ERROR_USER_ACCESS_LOCKED} = 141 +${env:hestiaKERNEL_ERROR_USER_ACCESS_NOT_VERIFIED} = 142 +${env:hestiaKERNEL_ERROR_USER_ACCESS_REJECTED} = 143 +${env:hestiaKERNEL_ERROR_USER_ACCESS_REVOKED} = 144 +${env:hestiaKERNEL_ERROR_USER_ID_BAD} = 145 +${env:hestiaKERNEL_ERROR_USER_ID_EXISTS} = 146 +${env:hestiaKERNEL_ERROR_USER_ID_MISSING} = 147 +${env:hestiaKERNEL_ERROR_USER_MFA_BAD} = 148 +${env:hestiaKERNEL_ERROR_USER_MFA_EXPIRED} = 149 +${env:hestiaKERNEL_ERROR_USER_MFA_MISSING} = 150 +${env:hestiaKERNEL_ERROR_USER_PASSWORD_BAD} = 151 +${env:hestiaKERNEL_ERROR_USER_PASSWORD_EXPIRED} = 152 +${env:hestiaKERNEL_ERROR_USER_PASSWORD_MISSING} = 153 +${env:hestiaKERNEL_ERROR_USER_KEYFILE_BAD} = 154 +${env:hestiaKERNEL_ERROR_USER_KEYFILE_EXPIRED} = 155 +${env:hestiaKERNEL_ERROR_USER_KEYFILE_MISSING} = 156 +${env:hestiaKERNEL_ERROR_USER_ACCESS_TOKEN_BAD} = 157 +${env:hestiaKERNEL_ERROR_USER_ACCESS_TOKEN_EXPIRED} = 158 +${env:hestiaKERNEL_ERROR_USER_ACCESS_TOKEN_MISSING} = 159 +${env:hestiaKERNEL_ERROR_USER_ACCESS_TOKEN_REVOKED} = 160 +################################################################################ +# Windows POWERSHELL Codes # +################################################################################ +return +<# +RUN_AS_POWERSHELL + + + + +################################################################################ +# Unix Main Codes # +################################################################################ +hestiaKERNEL_ERROR_OK=0; +hestiaKERNEL_ERROR_BAD_EXEC=1; +hestiaKERNEL_ERROR_BAD_DESCRIPTOR=2; +hestiaKERNEL_ERROR_BAD_EXCHANGE=3; +hestiaKERNEL_ERROR_BAD_MOUNT=4; +hestiaKERNEL_ERROR_BAD_PIPE=5; +hestiaKERNEL_ERROR_BAD_REQUEST=6; +hestiaKERNEL_ERROR_BAD_STREAM_PIPE=7; +hestiaKERNEL_ERROR_CANCELED=8; +hestiaKERNEL_ERROR_CLEANING_REQUIRED=9; +hestiaKERNEL_ERROR_DEADLOCK=10; +hestiaKERNEL_ERROR_EXPIRED=11; +hestiaKERNEL_ERROR_ILLEGAL_BYTE_SEQUENCE=12; +hestiaKERNEL_ERROR_ILLEGAL_SEEK=13; +hestiaKERNEL_ERROR_INVALID_ARGUMENT=14; +hestiaKERNEL_ERROR_IS_EMPTY=15; +hestiaKERNEL_ERROR_MAXED_EXCHANGE=16; +hestiaKERNEL_ERROR_MAXED_QUOTA=17; +hestiaKERNEL_ERROR_MISSING_LOCK=18; +hestiaKERNEL_ERROR_NOT_EMPTY=19; +hestiaKERNEL_ERROR_NOT_PERMITTED=20; +hestiaKERNEL_ERROR_NOT_POSSIBLE=21; +hestiaKERNEL_ERROR_NOT_POSSIBLE_BY_RFKILL=22; +hestiaKERNEL_ERROR_NOT_RECOVERABLE=23; +hestiaKERNEL_ERROR_OUT_OF_RANGE=24; +hestiaKERNEL_ERROR_PERMISSION_DENIED=25; +hestiaKERNEL_ERROR_TIMEOUT=26; +hestiaKERNEL_ERROR_TOO_MANY_READ=27; +hestiaKERNEL_ERROR_TOO_MANY_LOOP=28; +hestiaKERNEL_ERROR_TOO_MANY_REFERENCES=29; +hestiaKERNEL_ERROR_TOO_MANY_LINK=30; +hestiaKERNEL_ERROR_TRY_AGAIN=31; +hestiaKERNEL_ERROR_UNSUPPORTED=32; +hestiaKERNEL_ERROR_WOULD_BLOCK=33; + +# lifecycle states +hestiaKERNEL_ERROR_RESTART=34; +hestiaKERNEL_ERROR_RESUME=35; +hestiaKERNEL_ERROR_SHUTDOWN=36; +hestiaKERNEL_ERROR_SLEEP=37; +hestiaKERNEL_ERROR_STALLED=38; +hestiaKERNEL_ERROR_STANDBY=39; +hestiaKERNEL_ERROR_PROGRESS_SCHEDULED=40; +hestiaKERNEL_ERROR_PROGRESS_ALREADY_EXECUTING=41; +hestiaKERNEL_ERROR_PROGRESS_EXECUTING=42; +hestiaKERNEL_ERROR_PROGRESS_COMPLETED=43; + +# tri-tier inter-package communications +hestiaKERNEL_ERROR_LV1_NOT_SYNC=44; +hestiaKERNEL_ERROR_LV1_PAUSED=45; +hestiaKERNEL_ERROR_LV1_RESET=46; +hestiaKERNEL_ERROR_LV2_NOT_SYNC=47; +hestiaKERNEL_ERROR_LV2_PAUSED=48; +hestiaKERNEL_ERROR_LV2_RESET=49; +hestiaKERNEL_ERROR_LV3_NOT_SYNC=50; +hestiaKERNEL_ERROR_LV3_PAUSED=51; +hestiaKERNEL_ERROR_LV3_RESET=52; + +# data (input/output parameters; type; etc) +hestiaKERNEL_ERROR_DATA_BAD=53; +hestiaKERNEL_ERROR_DATA_EMPTY=54; +hestiaKERNEL_ERROR_DATA_INVALID=55; +hestiaKERNEL_ERROR_DATA_IS_UNIQUE=56; +hestiaKERNEL_ERROR_DATA_MISSING=57; +hestiaKERNEL_ERROR_DATA_NOT_UNIQUE=58; +hestiaKERNEL_ERROR_DATA_OVERFLOW=59; +hestiaKERNEL_ERROR_DATA_REMOVED=60; +hestiaKERNEL_ERROR_DATA_TOO_LONG=61; +hestiaKERNEL_ERROR_DATA_MISMATCHED=62; + +# entity (device; file; directory; object; etc) +hestiaKERNEL_ERROR_ENTITY_BAD=63; +hestiaKERNEL_ERROR_ENTITY_BUSY=64; +hestiaKERNEL_ERROR_ENTITY_DEAD=65; +hestiaKERNEL_ERROR_ENTITY_EXISTS=66; +hestiaKERNEL_ERROR_ENTITY_FAULTY=67; +hestiaKERNEL_ERROR_ENTITY_MISSING=68; +hestiaKERNEL_ERROR_ENTITY_MISSING_CHILD=69; +hestiaKERNEL_ERROR_ENTITY_OUT_OF_BUFFER=70; +hestiaKERNEL_ERROR_ENTITY_POISONED=71; +hestiaKERNEL_ERROR_ENTITY_TOO_BIG=72; +hestiaKERNEL_ERROR_ENTITY_TOO_MANY_OPENED=73; +hestiaKERNEL_ERROR_ENTITY_UNATTACHED=74; +hestiaKERNEL_ERROR_ENTITY_IS_NOT_DIRECTORY=75; +hestiaKERNEL_ERROR_ENTITY_IS_NOT_FILE=76; +hestiaKERNEL_ERROR_ENTITY_IS_NOT_LINK=77; +hestiaKERNEL_ERROR_ENTITY_IS_NOT_SOCKET=78; +hestiaKERNEL_ERROR_ENTITY_REMOTE_CHANGED=79; +hestiaKERNEL_ERROR_ENTITY_REMOTE_ERROR=80; +hestiaKERNEL_ERROR_ENTITY_REMOTE_IO=81; +hestiaKERNEL_ERROR_ENTITY_MISSING_STREAMABLE_RESOURCES=82; +hestiaKERNEL_ERROR_ENTITY_NOT_STREAMABLE=83; +hestiaKERNEL_ERROR_ENTITY_STREAMABLE=84; +hestiaKERNEL_ERROR_ENTITY_A_TYPEWRITER=85; +hestiaKERNEL_ERROR_ENTITY_NOT_A_TYPEWRITER=86; +hestiaKERNEL_ERROR_ENTITY_BAD_DESCRIPTOR=87; +hestiaKERNEL_ERROR_ENTITY_FILETABLE_OVERFLOW=88; + +# key (cryptography) +hestiaKERNEL_ERROR_KEY_BAD=89; +hestiaKERNEL_ERROR_KEY_DESTROYED=90; +hestiaKERNEL_ERROR_KEY_EXPIRED=91; +hestiaKERNEL_ERROR_KEY_MISSING=92; +hestiaKERNEL_ERROR_KEY_REJECTED=93; +hestiaKERNEL_ERROR_KEY_REVOKED=94; + +# library +hestiaKERNEL_ERROR_LIBRARY_BAD=95; +hestiaKERNEL_ERROR_LIBRARY_CORRUPTED=96; +hestiaKERNEL_ERROR_LIBRARY_EXEC_FAILED=97; +hestiaKERNEL_ERROR_LIBRARY_MAXED=98; +hestiaKERNEL_ERROR_LIBRARY_MISSING=99; + +# network +hestiaKERNEL_ERROR_NETWORK_BAD=100; +hestiaKERNEL_ERROR_NETWORK_BAD_AD=101; +hestiaKERNEL_ERROR_NETWORK_DOWN=102; +hestiaKERNEL_ERROR_NETWORK_NOT_CONNECTED=103; +hestiaKERNEL_ERROR_NETWORK_RESET=104; +hestiaKERNEL_ERROR_NETWORK_RFS=105; +hestiaKERNEL_ERROR_NETWORK_UNREACHABLE=106; + +hestiaKERNEL_ERROR_NETWORK_HOST_DOWN=107; +hestiaKERNEL_ERROR_NETWORK_HOST_UNREACHABLE=108; +hestiaKERNEL_ERROR_NETWORK_SOCKET_UNSUPPORTED=109; + +hestiaKERNEL_ERROR_NETWORK_ADDRESS_IN_USE=110; +hestiaKERNEL_ERROR_NETWORK_ADDRESS_UNAVAILABLE=111; + +hestiaKERNEL_ERROR_NETWORK_CONN_ABORTED=112; +hestiaKERNEL_ERROR_NETWORK_CONN_IS_CONNECTED=113; +hestiaKERNEL_ERROR_NETWORK_CONN_MISSING_DEST_ADDRESS=114; +hestiaKERNEL_ERROR_NETWORK_CONN_MULTIHOP=115; +hestiaKERNEL_ERROR_NETWORK_CONN_NOT_CONNECTED=116; +hestiaKERNEL_ERROR_NETWORK_CONN_REFUSED=117; +hestiaKERNEL_ERROR_NETWORK_CONN_RESET=118; + +hestiaKERNEL_ERROR_NETWORK_PAYLOAD_BAD=119; +hestiaKERNEL_ERROR_NETWORK_PAYLOAD_EMPTY=120; +hestiaKERNEL_ERROR_NETWORK_PAYLOAD_MISSING=121; +hestiaKERNEL_ERROR_NETWORK_PAYLOAD_TOO_LONG=122; + +# protocol +hestiaKERNEL_ERROR_PROTOCOL_ADDRESS_UNSUPPORTED=123; +hestiaKERNEL_ERROR_PROTOCOL_BAD=124; +hestiaKERNEL_ERROR_PROTOCOL_FAMILY_UNSUPPORTED=125; +hestiaKERNEL_ERROR_PROTOCOL_MISSING=126; +hestiaKERNEL_ERROR_PROTOCOL_UNSUPPORTED=127; + +# system (e.g. os; interactable system) +hestiaKERNEL_ERROR_SYSTEM_BAD_IO=128; +hestiaKERNEL_ERROR_SYSTEM_DEVICE_CROSS_LINK=129; +hestiaKERNEL_ERROR_SYSTEM_INTERRUPT_CALL=130; +hestiaKERNEL_ERROR_SYSTEM_INVALID=131; +hestiaKERNEL_ERROR_SYSTEM_MISSING_BLOCK_DEVICE=132; +hestiaKERNEL_ERROR_SYSTEM_MISSING_DEVICE=133; +hestiaKERNEL_ERROR_SYSTEM_MISSING_IO=134; +hestiaKERNEL_ERROR_SYSTEM_MISSING_PROCESS=135; +hestiaKERNEL_ERROR_SYSTEM_OUT_OF_DOMAIN=136; +hestiaKERNEL_ERROR_SYSTEM_OUT_OF_MEMORY=137; +hestiaKERNEL_ERROR_SYSTEM_OUT_OF_SPACE=138; +hestiaKERNEL_ERROR_SYSTEM_READ_ONLY_FILESYSTEM=139; + +# user +hestiaKERNEL_ERROR_USER_ACCESS_BANNED=140; +hestiaKERNEL_ERROR_USER_ACCESS_LOCKED=141; +hestiaKERNEL_ERROR_USER_ACCESS_NOT_VERIFIED=142; +hestiaKERNEL_ERROR_USER_ACCESS_REJECTED=143; +hestiaKERNEL_ERROR_USER_ACCESS_REVOKED=144; +hestiaKERNEL_ERROR_USER_ID_BAD=145; +hestiaKERNEL_ERROR_USER_ID_EXISTS=146; +hestiaKERNEL_ERROR_USER_ID_MISSING=147; +hestiaKERNEL_ERROR_USER_MFA_BAD=148; +hestiaKERNEL_ERROR_USER_MFA_EXPIRED=149; +hestiaKERNEL_ERROR_USER_MFA_MISSING=150; +hestiaKERNEL_ERROR_USER_PASSWORD_BAD=151; +hestiaKERNEL_ERROR_USER_PASSWORD_EXPIRED=152; +hestiaKERNEL_ERROR_USER_PASSWORD_MISSING=153; +hestiaKERNEL_ERROR_USER_KEYFILE_BAD=154; +hestiaKERNEL_ERROR_USER_KEYFILE_EXPIRED=155; +hestiaKERNEL_ERROR_USER_KEYFILE_MISSING=156; +hestiaKERNEL_ERROR_USER_ACCESS_TOKEN_BAD=157; +hestiaKERNEL_ERROR_USER_ACCESS_TOKEN_EXPIRED=158; +hestiaKERNEL_ERROR_USER_ACCESS_TOKEN_MISSING=159; +hestiaKERNEL_ERROR_USER_ACCESS_TOKEN_REVOKED=160; +################################################################################ +# Unix Main Codes # +################################################################################ +return 0 +#> diff --git a/automataCI/services/hestiaKERNEL/Vanilla.sh.ps1 b/automataCI/services/hestiaKERNEL/Vanilla.sh.ps1 new file mode 100755 index 0000000..582392d --- /dev/null +++ b/automataCI/services/hestiaKERNEL/Vanilla.sh.ps1 @@ -0,0 +1,54 @@ +echo \" <<'RUN_AS_BATCH' >/dev/null ">NUL "\" \`" <#" +@ECHO OFF +REM LICENSE CLAUSES HERE +REM ---------------------------------------------------------------------------- + + + + +REM ############################################################################ +REM # Windows BATCH Codes # +REM ############################################################################ +where /q powershell +if errorlevel 1 ( + echo "ERROR: missing powershell facility." + exit /b 1 +) + +copy /Y "%~nx0" "%~n0.ps1" >nul +timeout /t 1 /nobreak >nul +powershell -executionpolicy remotesigned -Command "& '.\%~n0.ps1' %*" +start /b "" cmd /c del "%~f0" & exit /b %errorcode% +REM ############################################################################ +REM # Windows BATCH Codes # +REM ############################################################################ +RUN_AS_BATCH +#> | Out-Null + + + + +echo \" <<'RUN_AS_POWERSHELL' >/dev/null # " | Out-Null +################################################################################ +# Windows POWERSHELL Codes # +################################################################################ +. "${env:LIBS_HESTIA}\hestiaKERNEL\Error_Codes.ps1" +################################################################################ +# Windows POWERSHELL Codes # +################################################################################ +return +<# +RUN_AS_POWERSHELL + + + + +################################################################################ +# Unix Main Codes # +################################################################################ +. "${LIBS_HESTIA}/hestiaKERNEL/Error_Codes.sh.ps1" +################################################################################ +# Unix Main Codes # +################################################################################ +return 0 +#> diff --git a/automataCI/services/hestiaLOCALE/Get-LCID.sh.ps1 b/automataCI/services/hestiaLOCALE/Get_LCID.sh.ps1 similarity index 100% rename from automataCI/services/hestiaLOCALE/Get-LCID.sh.ps1 rename to automataCI/services/hestiaLOCALE/Get_LCID.sh.ps1 diff --git a/automataCI/services/hestiaLOCALE/Get_Lang.sh.ps1 b/automataCI/services/hestiaLOCALE/Get_Lang.sh.ps1 new file mode 100755 index 0000000..ec9a32f --- /dev/null +++ b/automataCI/services/hestiaLOCALE/Get_Lang.sh.ps1 @@ -0,0 +1,106 @@ +echo \" <<'RUN_AS_BATCH' >/dev/null ">NUL "\" \`" <#" +@ECHO OFF +REM LICENSE CLAUSES HERE +REM ---------------------------------------------------------------------------- + + + + +REM ############################################################################ +REM # Windows BATCH Codes # +REM ############################################################################ +where /q powershell +if errorlevel 1 ( + echo "ERROR: missing powershell facility." + exit /b 1 +) + +copy /Y "%~nx0" "%~n0.ps1" >nul +timeout /t 1 /nobreak >nul +powershell -executionpolicy remotesigned -Command "& '.\%~n0.ps1' %*" +start /b "" cmd /c del "%~f0" & exit /b %errorcode% +REM ############################################################################ +REM # Windows BATCH Codes # +REM ############################################################################ +RUN_AS_BATCH +#> | Out-Null + + + + +echo \" <<'RUN_AS_POWERSHELL' >/dev/null # " | Out-Null +################################################################################ +# Windows POWERSHELL Codes # +################################################################################ +function hestiaLOCALE-Get-Lang { + param( + [string]$___lang + ) + + + # execute + if (-not [string]::IsNullOrEmpty($___lang)) { + return $___lang + } elseif (-not [string]::IsNullOrEmpty(${env:PROJECT_LANG})) { + return "${env:PROJECT_LANG}" + } elseif (-not [string]::IsNullOrEmpty(${env:AUTOMATACI_LANG})) { + return "${env:AUTOMATACI_LANG}" # compatible with AutomataCI + } + + + # fallback to getting from system settings + $___lang = Get-WinSystemLocale + $fullLanguageCode = $___lang.Name + $___lang = $___lang -replace '[_-][A-Z]*$', '' + $___lang = $___lang -replace '_', '-' + return $___lang +} +################################################################################ +# Windows POWERSHELL Codes # +################################################################################ +return +<# +RUN_AS_POWERSHELL + + + + +################################################################################ +# Unix Main Codes # +################################################################################ +hestiaLOCALE_Get_Lang() { + #___lang="$1" + + + # execute + if [ ! "$1" = "" ]; then + printf -- "$1" + return 0 + elif [ ! "$PROJECT_LANG" = "" ]; then + printf -- "$PROJECT_LANG" + return 0 + elif [ ! "$AUTOMATACI_LANG" = "" ]; then + printf -- "$AUTOMATACI_LANG" # comaptible with AutomataCI + return 0 + fi + + + # fallback to getting from system settings + ___lang="${LC_ALL:$LANG}" + ___lang="${___lang%.*}" + ___lang="${___lang%_[A-Z]*}" + ___lang="$(printf -- "%b" "$___lang" | tr '_' '-')" + if [ "$___lang" = "C" ] || [ "$___lang" = "" ]; then + ___lang="en" # fallback to english then + fi + printf -- "$___lang" + + + # report status + return 0 +} +################################################################################ +# Unix Main Codes # +################################################################################ +return 0 +#> diff --git a/automataCI/services/hestiaLOCALE/Vanilla.sh.ps1 b/automataCI/services/hestiaLOCALE/Vanilla.sh.ps1 index eda087c..3074f32 100755 --- a/automataCI/services/hestiaLOCALE/Vanilla.sh.ps1 +++ b/automataCI/services/hestiaLOCALE/Vanilla.sh.ps1 @@ -32,7 +32,8 @@ echo \" <<'RUN_AS_POWERSHELL' >/dev/null # " | Out-Null ################################################################################ # Windows POWERSHELL Codes # ################################################################################ -. "${env:LIBS_HESTIA}\hestiaLOCALE\Get-LCID.sh.ps1" +. "${env:LIBS_HESTIA}\hestiaLOCALE\Get_LCID.sh.ps1" +. "${env:LIBS_HESTIA}\hestiaLOCALE\Get_Lang.sh.ps1" ################################################################################ # Windows POWERSHELL Codes # ################################################################################ @@ -46,7 +47,8 @@ RUN_AS_POWERSHELL ################################################################################ # Unix Main Codes # ################################################################################ -. "${LIBS_HESTIA}/hestiaLOCALE/Get-LCID.sh.ps1" +. "${LIBS_HESTIA}/hestiaLOCALE/Get_LCID.sh.ps1" +. "${LIBS_HESTIA}/hestiaLOCALE/Get_Lang.sh.ps1" ################################################################################ # Unix Main Codes # ################################################################################ diff --git a/automataCI/services/hestiaNUPKG/Is_Target_Valid.sh.ps1 b/automataCI/services/hestiaNUPKG/Is_Target_Valid.sh.ps1 new file mode 100755 index 0000000..7dd0848 --- /dev/null +++ b/automataCI/services/hestiaNUPKG/Is_Target_Valid.sh.ps1 @@ -0,0 +1,122 @@ +echo \" <<'RUN_AS_BATCH' >/dev/null ">NUL "\" \`" <#" +@ECHO OFF +REM LICENSE CLAUSES HERE +REM ---------------------------------------------------------------------------- + + + + +REM ############################################################################ +REM # Windows BATCH Codes # +REM ############################################################################ +where /q powershell +if errorlevel 1 ( + echo "ERROR: missing powershell facility." + exit /b 1 +) + +copy /Y "%~nx0" "%~n0.ps1" >nul +timeout /t 1 /nobreak >nul +powershell -executionpolicy remotesigned -Command "& '.\%~n0.ps1' %*" +start /b "" cmd /c del "%~f0" & exit /b %errorcode% +REM ############################################################################ +REM # Windows BATCH Codes # +REM ############################################################################ +RUN_AS_BATCH +#> | Out-Null + + + + +echo \" <<'RUN_AS_POWERSHELL' >/dev/null # " | Out-Null +################################################################################ +# Windows POWERSHELL Codes # +################################################################################ +. "${env:LIBS_HESTIA}/hestiaKERNEL/Vanilla.sh.ps1" +. "${env:LIBS_HESTIA}/hestiaFS/Vanilla.sh.ps1" +. "${env:LIBS_HESTIA}/hestiaSTRING/Vanilla.sh.ps1" +. "${env:LIBS_HESTIA}/hestiaZIP/Vanilla.sh.ps1" + + + + +function hestiaNUPKG-Is-Target-Valid { + param ( + [string]$___target + ) + + + # validate input + if ($(hestiaSTRING-Is-Empty "$1") -eq 0) { + return ${env:hestiaKERNEL_ERROR_DATA_MISSING} + } + + if ($(hestiaZIP-Is-Target-Valid "$1") -ne 0) { + return ${env:hestiaKERNEL_ERROR_DATA_MISSING} + } + + + # execute + $___subject = hestiaFS-Get-File "${___target}" + if ($("${___subject}" -replace '^.*\.nupkg$', '') -ne "${___subject}") { + return ${env:hestiaKERNEL_ERROR_OK} + } + + + # report status + return ${env:hestiaKERNEL_ERROR_DATA_MISMATCHED} +} +################################################################################ +# Windows POWERSHELL Codes # +################################################################################ +return +<# +RUN_AS_POWERSHELL + + + + +################################################################################ +# Unix Main Codes # +################################################################################ +. "${LIBS_HESTIA}/hestiaKERNEL/Vanilla.sh.ps1" +. "${LIBS_HESTIA}/hestiaFS/Vanilla.sh.ps1" +. "${LIBS_HESTIA}/hestiaSTRING/Vanilla.sh.ps1" +. "${LIBS_HESTIA}/hestiaZIP/Vanilla.sh.ps1" + + + + +hestiaNUPKG_Is_Target_Valid() { + #___target="$1" + + + # validate input + if [ $(hestiaSTRING_Is_Empty "$1") -eq 0 ]; then + printf -- "%d" $hestiaKERNEL_ERROR_DATA_MISSING + return $hestiaKERNEL_ERROR_DATA_MISSING + fi + + if [ $(hestiaZIP_Is_Target_Valid "$1") -ne 0 ]; then + printf -- "%d" $hestiaKERNEL_ERROR_DATA_MISMATCHED + return $hestiaKERNEL_ERROR_DATA_MISMATCHED + fi + + + # execute + ___subject="$(hestiaFS_Get_File "$1")" + if [ ! "${___subject%%.nupkg*}" = "$___subject" ]; then + printf -- "%d" $hestiaKERNEL_ERROR_OK + return $hestiaKERNEL_ERROR_OK + fi + + + # report status + printf -- "%d" $hestiaKERNEL_ERROR_DATA_MISMATCHED + return $hestiaKERNEL_ERROR_DATA_MISMATCHED +} +################################################################################ +# Unix Main Codes # +################################################################################ +return 0 +#> diff --git a/automataCI/services/hestiaNUPKG/Publish.sh.ps1 b/automataCI/services/hestiaNUPKG/Publish.sh.ps1 new file mode 100755 index 0000000..c43cd51 --- /dev/null +++ b/automataCI/services/hestiaNUPKG/Publish.sh.ps1 @@ -0,0 +1,133 @@ +echo \" <<'RUN_AS_BATCH' >/dev/null ">NUL "\" \`" <#" +@ECHO OFF +REM LICENSE CLAUSES HERE +REM ---------------------------------------------------------------------------- + + + + +REM ############################################################################ +REM # Windows BATCH Codes # +REM ############################################################################ +where /q powershell +if errorlevel 1 ( + echo "ERROR: missing powershell facility." + exit /b 1 +) + +copy /Y "%~nx0" "%~n0.ps1" >nul +timeout /t 1 /nobreak >nul +powershell -executionpolicy remotesigned -Command "& '.\%~n0.ps1' %*" +start /b "" cmd /c del "%~f0" & exit /b %errorcode% +REM ############################################################################ +REM # Windows BATCH Codes # +REM ############################################################################ +RUN_AS_BATCH +#> | Out-Null + + + + +echo \" <<'RUN_AS_POWERSHELL' >/dev/null # " | Out-Null +################################################################################ +# Windows POWERSHELL Codes # +################################################################################ +. "${env:LIBS_HESTIA}/hestiaKERNEL/Vanilla.sh.ps1" +. "${env:LIBS_HESTIA}/hestiaSTRING/Vanilla.sh.ps1" +. "${env:LIBS_HESTIA}/hestiaHTTP/Vanilla.sh.ps1" + + + + +function hestiaVENDORS-GITHUB-Publish-NUPKG { + param( + [string]$___url, + [string]$___target, + [string]$___auth_token + ) + + + # validate input + if ($(hestiaHTTP-Is-Available) -ne 0) { + return ${env:hestiaKERNEL_ERROR_ENTITY_MISSING} + } + + if (($(hestiaSTRING-Is-Empty "${___url}") -eq 0) -or + ($(hestiaSTRING-Is-Empty "${___auth_token}") -eq 0) -or + ($(hestiaSTRING-Is-Empty "${___target}") -eq 0)) { + return ${env:hestiaKERNEL_ERROR_DATA_EMPTY} + } + + + # execute + $___arguments = "--request PUT " + + "--header `"X-NuGet-ApiKey: ${___auth_token}`"" + + "--header `"Authorization: ${___auth_token}`"" + + "--form `"package=@${___target}`"" + + "${___url}" + $___process = hestiaOS-Exec "curl" "${___arguments}" + if ($___process -ne ${env:hestiaKERNEL_ERROR_OK}) { + return ${env:hestiaKERNEL_ERROR_BAD_EXEC} + } + + + # report status + return ${env:hestiaKERNEL_ERROR_OK} +} +################################################################################ +# Windows POWERSHELL Codes # +################################################################################ +return +<# +RUN_AS_POWERSHELL + + + + +################################################################################ +# Unix Main Codes # +################################################################################ +. "${LIBS_HESTIA}/hestiaKERNEL/Vanilla.sh.ps1" +. "${LIBS_HESTIA}/hestiaSTRING/Vanilla.sh.ps1" +. "${LIBS_HESTIA}/hestiaHTTP/Vanilla.sh.ps1" + + + + +hestiaNUPKG_Publish() { + ___url="$1" + ___auth_token="$2" + ___target="$3" + + + # validate input + if [ $(hestiaHTTP_Is_Available) -ne 0 ]; then + return $hestiaKERNEL_ERROR_ENTITY_MISSING + fi + + if [ $(hestiaSTRING_Is_Empty "$___url") -eq $hestiaKERNEL_ERROR_OK ] || + [ $(hestiaSTRING_Is_Empty "$___auth_token") -eq $hestiaKERNEL_ERROR_OK ] || + [ $(hestiaSTRING_Is_Empty "$___target") -eq $hestiaKERNEL_ERROR_OK ]; then + return $hestiaKERNEL_ERROR_DATA_EMPTY + fi + + + # execute + curl --request PUT \ + --header "X-NuGet-ApiKey: ${___auth_token}" \ + --header "Authorization: ${___auth_token}" \ + --form "package=@${___target}" \ + "$___url" + if [ $? -ne $hestiaKERNEL_ERROR_OK ]; then + return $hestiaKERNEL_ERROR_BAD_EXEC + fi + + + # report status + return $hestiaKERNEL_ERROR_OK +} +################################################################################ +# Unix Main Codes # +################################################################################ +return 0 +#> diff --git a/automataCI/services/hestiaNUPKG/Vanilla.sh.ps1 b/automataCI/services/hestiaNUPKG/Vanilla.sh.ps1 new file mode 100755 index 0000000..e7369f8 --- /dev/null +++ b/automataCI/services/hestiaNUPKG/Vanilla.sh.ps1 @@ -0,0 +1,56 @@ +echo \" <<'RUN_AS_BATCH' >/dev/null ">NUL "\" \`" <#" +@ECHO OFF +REM LICENSE CLAUSES HERE +REM ---------------------------------------------------------------------------- + + + + +REM ############################################################################ +REM # Windows BATCH Codes # +REM ############################################################################ +where /q powershell +if errorlevel 1 ( + echo "ERROR: missing powershell facility." + exit /b 1 +) + +copy /Y "%~nx0" "%~n0.ps1" >nul +timeout /t 1 /nobreak >nul +powershell -executionpolicy remotesigned -Command "& '.\%~n0.ps1' %*" +start /b "" cmd /c del "%~f0" & exit /b %errorcode% +REM ############################################################################ +REM # Windows BATCH Codes # +REM ############################################################################ +RUN_AS_BATCH +#> | Out-Null + + + + +echo \" <<'RUN_AS_POWERSHELL' >/dev/null # " | Out-Null +################################################################################ +# Windows POWERSHELL Codes # +################################################################################ +. "${env:LIBS_HESTIA}\hestiaNUPKG\Is_Target_Valid.sh.ps1" +. "${env:LIBS_HESTIA}\hestiaNUPKG\Publish.sh.ps1" +################################################################################ +# Windows POWERSHELL Codes # +################################################################################ +return +<# +RUN_AS_POWERSHELL + + + + +################################################################################ +# Unix Main Codes # +################################################################################ +. "${LIBS_HESTIA}/hestiaNUPKG/Is_Target_Valid.sh.ps1" +. "${LIBS_HESTIA}/hestiaNUPKG/Publish.sh.ps1" +################################################################################ +# Unix Main Codes # +################################################################################ +return 0 +#> diff --git a/automataCI/services/hestiaOS/Exec.sh.ps1 b/automataCI/services/hestiaOS/Exec.sh.ps1 new file mode 100755 index 0000000..4fc8c89 --- /dev/null +++ b/automataCI/services/hestiaOS/Exec.sh.ps1 @@ -0,0 +1,206 @@ +echo \" <<'RUN_AS_BATCH' >/dev/null ">NUL "\" \`" <#" +@ECHO OFF +REM LICENSE CLAUSES HERE +REM ---------------------------------------------------------------------------- + + + + +REM ############################################################################ +REM # Windows BATCH Codes # +REM ############################################################################ +where /q powershell +if errorlevel 1 ( + echo "ERROR: missing powershell facility." + exit /b 1 +) + +copy /Y "%~nx0" "%~n0.ps1" >nul +timeout /t 1 /nobreak >nul +powershell -executionpolicy remotesigned -Command "& '.\%~n0.ps1' %*" +start /b "" cmd /c del "%~f0" & exit /b %errorcode% +REM ############################################################################ +REM # Windows BATCH Codes # +REM ############################################################################ +RUN_AS_BATCH +#> | Out-Null + + + + +echo \" <<'RUN_AS_POWERSHELL' >/dev/null # " | Out-Null +################################################################################ +# Windows POWERSHELL Codes # +################################################################################ +. "${env:LIBS_HESTIA}\hestiaKERNEL\Vanilla.sh.ps1" +. "${env:LIBS_HESTIA}\hestiaSTRING\Vanilla.sh.ps1" + + + + +function hestiaOS-Exec { + param ( + [string]$___command, + [string]$___arguments, + [string]$___log_stdout, + [string]$___log_stderr + ) + + + # validate input + if (Test-Path -Path "${___command}" -ErrorAction SilentlyContinue) { + $___program = "${___command}" + } else { + $___program = Get-Command $___command -ErrorAction SilentlyContinue + if (-not ($___program)) { + return ${env:hestiaKERNEL_ERROR_DATA_EMPTY} + } + } + + + # execute command + if ($(hestiaSTRING-Is-Empty "${___arguments}") -eq ${env:hestiaKERNEL_ERROR_OK}) { + if (($(hestiaSTRING-Is-Empty "${___log_stdout}") -ne ${env:hestiaKERNEL_ERROR_OK}) -or + ($(hestiaSTRING-Is-Empty "${___log_stderr}") -ne ${env:hestiaKERNEL_ERROR_OK})) { + $___process = Start-Process -Wait ` + -FilePath "${___program}" ` + -NoNewWindow ` + -PassThru ` + -RedirectStandardOutput "${___log_stdout}" ` + -RedirectStandardError "${___log_stderr}" + } elseif ($(hestiaSTRING-Is-Empty "${___log_stdout}") -ne ${env:hestiaKERNEL_ERROR_OK}) { + $___process = Start-Process -Wait ` + -FilePath "${___program}" ` + -NoNewWindow ` + -PassThru ` + -RedirectStandardOutput "${___log_stdout}" + } elseif ($(hestiaSTRING-Is-Empty "${___log_stderr}") -ne ${env:hestiaKERNEL_ERROR_OK}) { + $___process = Start-Process -Wait ` + -FilePath "${___program}" ` + -NoNewWindow ` + -PassThru ` + -RedirectStandardError "${___log_stderr}" + } else { + $___process = Start-Process -Wait ` + -FilePath "${___program}" ` + -NoNewWindow ` + -PassThru + } + } else { + if (($(hestiaSTRING-Is-Empty "${___log_stdout}") -ne ${env:hestiaKERNEL_ERROR_OK}) -or + ($(hestiaSTRING-Is-Empty "${___log_stderr}") -ne ${env:hestiaKERNEL_ERROR_OK})) { + $___process = Start-Process -Wait ` + -FilePath "${___program}" ` + -NoNewWindow ` + -PassThru ` + -ArgumentList "${___arguments}" ` + -RedirectStandardOutput "${___log_stdout}" ` + -RedirectStandardError "${___log_stderr}" + } elseif ($(hestiaSTRING-Is-Empty "${___log_stdout}") -ne ${env:hestiaKERNEL_ERROR_OK}) { + $___process = Start-Process -Wait ` + -FilePath "${___program}" ` + -NoNewWindow ` + -PassThru ` + -ArgumentList "${___arguments}" ` + -RedirectStandardOutput "${___log_stdout}" + } elseif ($(hestiaSTRING-Is-Empty "${___log_stderr}") -ne ${env:hestiaKERNEL_ERROR_OK}) { + $___process = Start-Process -Wait ` + -FilePath "${___program}" ` + -NoNewWindow ` + -PassThru ` + -ArgumentList "${___arguments}" ` + -RedirectStandardError "${___log_stderr}" + } else { + $___process = Start-Process -Wait ` + -FilePath "${___program}" ` + -NoNewWindow ` + -PassThru ` + -ArgumentList "${___arguments}" + } + } + if ($___process.ExitCode -ne ${env:hestiaKERNEL_ERROR_OK}) { + return ${env:hestiaKERNEL_ERROR_BAD_EXEC} + } + + + # report status + return ${env:hestiaKERNEL_ERROR_OK} +} +################################################################################ +# Windows POWERSHELL Codes # +################################################################################ +return +<# +RUN_AS_POWERSHELL + + + + +################################################################################ +# Unix Main Codes # +################################################################################ +. "${LIBS_HESTIA}/hestiaKERNEL/Vanilla.sh.ps1" +. "${LIBS_HESTIA}/hestiaSTRING/Vanilla.sh.ps1" +. "${LIBS_HESTIA}/hestiaOS/Is_Command_Available.sh.ps1" + + + + +hestiaOS_Exec() { + ___command="$1" + ___argument="$2" + ___log_stdout="$3" + ___log_stderr="$4" + + + # validate input + if [ $(hestiaOS_Is_Command_Available "$___command") -eq $hestiaKERNEL_ERROR_OK ]; then + return $hestiaKERNEL_ERROR_DATA_EMPTY + fi + + + # execute command + if [ $(hestiaSTRING_Is_Empty "$___arguments") -eq $hestiaKERNEL_ERROR_OK ]; then + if [ $(hestiaSTRING_Is_Empty "$___log_stdout") -ne $hestiaKERNEL_ERROR_OK ] || + [ $(hestiaSTRING_Is_Empty "$___log_stderr") -ne $hestiaKERNEL_ERROR_OK ]; then + "$___command" 1>"$___log_stdout" 2>"$___log_stderr" + ___process=$? + elif [ $(hestiaSTRING_Is_Empty "$___log_stdout") -ne $hestiaKERNEL_ERROR_OK ]; then + "$___command" 1>"$___log_stdout" + ___process=$? + elif [ $(hestiaSTRING_Is_Empty "$___log_stderr") -ne $hestiaKERNEL_ERROR_OK ]; then + "$___command" 2>"$___log_stderr" + ___process=$? + else + "$___command" + ___process=$? + fi + else + if [ $(hestiaSTRING_Is_Empty "$___log_stdout") -ne $hestiaKERNEL_ERROR_OK ] || + [ $(hestiaSTRING_Is_Empty "$___log_stderr") -ne $hestiaKERNEL_ERROR_OK ]; then + "$___command" $___arguments 1>"$___log_stdout" 2>"$___log_stderr" + ___process=$? + elif [ $(hestiaSTRING_Is_Empty "$___log_stdout") -ne $hestiaKERNEL_ERROR_OK ]; then + "$___command" $___arguments 1>"$___log_stdout" + ___process=$? + elif [ $(hestiaSTRING_Is_Empty "$___log_stderr") -ne $hestiaKERNEL_ERROR_OK ]; then + "$___command" $___arguments 2>"$___log_stderr" + ___process=$? + else + "$___command" $___arguments + ___process=$? + fi + fi + if [ $___process -ne $hestiaKERNEL_ERROR_OK ]; then + return $hestiaKERNEL_ERROR_BAD_EXEC + fi + + + # report status + return $hestiaKERNEL_ERROR_OK +} +################################################################################ +# Unix Main Codes # +################################################################################ +return 0 +#> diff --git a/automataCI/services/hestiaOS/Is_Command_Available.sh.ps1 b/automataCI/services/hestiaOS/Is_Command_Available.sh.ps1 new file mode 100755 index 0000000..c9db2c1 --- /dev/null +++ b/automataCI/services/hestiaOS/Is_Command_Available.sh.ps1 @@ -0,0 +1,111 @@ +echo \" <<'RUN_AS_BATCH' >/dev/null ">NUL "\" \`" <#" +@ECHO OFF +REM LICENSE CLAUSES HERE +REM ---------------------------------------------------------------------------- + + + + +REM ############################################################################ +REM # Windows BATCH Codes # +REM ############################################################################ +where /q powershell +if errorlevel 1 ( + echo "ERROR: missing powershell facility." + exit /b 1 +) + +copy /Y "%~nx0" "%~n0.ps1" >nul +timeout /t 1 /nobreak >nul +powershell -executionpolicy remotesigned -Command "& '.\%~n0.ps1' %*" +start /b "" cmd /c del "%~f0" & exit /b %errorcode% +REM ############################################################################ +REM # Windows BATCH Codes # +REM ############################################################################ +RUN_AS_BATCH +#> | Out-Null + + + + +echo \" <<'RUN_AS_POWERSHELL' >/dev/null # " | Out-Null +################################################################################ +# Windows POWERSHELL Codes # +################################################################################ +. "${env:LIBS_HESTIA}\hestiaKERNEL\Vanilla.sh.ps1" +. "${env:LIBS_HESTIA}\hestiaSTRING\Vanilla.sh.ps1" + + + + +function hestiaOS-Is-Command-Available { + param ( + [string]$___command + ) + + + # validate input + if ($(hestiaSTRING-Is-Empty "${___command}") -eq ${env:hestiaERROR_OK}) { + return ${env:hestiaKERNEL_ERROR_DATA_MISSING} + } + + + # execute + if (-not Test-Path -Path "${___command}" -ErrorAction SilentlyContinue) { + return ${env:hestiaKERNEL_ERROR_DATA_MISSING} + } + + if (-not Get-Command $___command -ErrorAction SilentlyContinue) { + return ${env:hestiaKERNEL_ERROR_DATA_MISSING} + } + + + # report status + return ${env:hestiaKERNEL_ERROR_OK} +} +################################################################################ +# Windows POWERSHELL Codes # +################################################################################ +return +<# +RUN_AS_POWERSHELL + + + + +################################################################################ +# Unix Main Codes # +################################################################################ +. "${LIBS_HESTIA}/hestiaKERNEL/Vanilla.sh.ps1" +. "${LIBS_HESTIA}/hestiaSTRING/Vanilla.sh.ps1" + + + + +hestiaOS_Is_Command_Available() { + #___command="$1" + + + # validate input + if [ $(hestiaSTRING_Is_Empty "$1") -eq $hestiaKERNEL_ERROR_OK ]; then + printf -- "%d" $hestiaKERNEL_ERROR_DATA_MISSING + return $hestiaKERNEL_ERROR_DATA_MISSING + fi + + + # execute + if [ $(hestiaSTRING_Is_Empty "$(type -t "$1")") -eq $hestiaKERNEL_ERROR_OK ]; then + printf -- "%d" $hestiaKERNEL_ERROR_DATA_MISSING + return $hestiaKERNEL_ERROR_DATA_MISSING + fi + + + # report status + printf -- "%d" $hestiaKERNEL_ERROR_OK + return $hestiaKERNEL_ERROR_OK +} +################################################################################ +# Unix Main Codes # +################################################################################ +return 0 +#> diff --git a/automataCI/services/hestiaOS/Is_Simulation_Mode.sh.ps1 b/automataCI/services/hestiaOS/Is_Simulation_Mode.sh.ps1 new file mode 100755 index 0000000..a2bd7d3 --- /dev/null +++ b/automataCI/services/hestiaOS/Is_Simulation_Mode.sh.ps1 @@ -0,0 +1,84 @@ +echo \" <<'RUN_AS_BATCH' >/dev/null ">NUL "\" \`" <#" +@ECHO OFF +REM LICENSE CLAUSES HERE +REM ---------------------------------------------------------------------------- + + + + +REM ############################################################################ +REM # Windows BATCH Codes # +REM ############################################################################ +where /q powershell +if errorlevel 1 ( + echo "ERROR: missing powershell facility." + exit /b 1 +) + +copy /Y "%~nx0" "%~n0.ps1" >nul +timeout /t 1 /nobreak >nul +powershell -executionpolicy remotesigned -Command "& '.\%~n0.ps1' %*" +start /b "" cmd /c del "%~f0" & exit /b %errorcode% +REM ############################################################################ +REM # Windows BATCH Codes # +REM ############################################################################ +RUN_AS_BATCH +#> | Out-Null + + + + +echo \" <<'RUN_AS_POWERSHELL' >/dev/null # " | Out-Null +################################################################################ +# Windows POWERSHELL Codes # +################################################################################ +. "${env:LIBS_HESTIA}\hestiaKERNEL\Vanilla.sh.ps1" + + + + +function hestiaOS-Is-Simulation-Mode { + # execute + if (-not ([string]::IsNullOrEmpty("${env:PROJECT_SIMULATE_RUN}"))) { + return ${env:hestiaKERNEL_ERROR_OK} + } + + + # report status + return ${env:hestiaKERNEL_ERROR_DATA_MISSING} +} +################################################################################ +# Windows POWERSHELL Codes # +################################################################################ +return +<# +RUN_AS_POWERSHELL + + + + +################################################################################ +# Unix Main Codes # +################################################################################ +. "${LIBS_HESTIA}/hestiaKERNEL/Vanilla.sh.ps1" + + + + +hestiaOS_Is_Simulation_Mode() { + # execute + if [ ! "$PROJECT_SIMULATE_RUN" = "" ]; then + printf -- "%d" $hestiaKERNEL_ERROR_OK + return $hestiaKERNEL_ERROR_OK + fi + + + # report status + printf -- "%d" $hestiaKERNEL_ERROR_DATA_MISSING + return $hestiaKERNEL_ERROR_DATA_MISSING +} +################################################################################ +# Unix Main Codes # +################################################################################ +return 0 +#> diff --git a/automataCI/services/hestiaOS/Vanilla.sh.ps1 b/automataCI/services/hestiaOS/Vanilla.sh.ps1 new file mode 100755 index 0000000..b009bd7 --- /dev/null +++ b/automataCI/services/hestiaOS/Vanilla.sh.ps1 @@ -0,0 +1,58 @@ +echo \" <<'RUN_AS_BATCH' >/dev/null ">NUL "\" \`" <#" +@ECHO OFF +REM LICENSE CLAUSES HERE +REM ---------------------------------------------------------------------------- + + + + +REM ############################################################################ +REM # Windows BATCH Codes # +REM ############################################################################ +where /q powershell +if errorlevel 1 ( + echo "ERROR: missing powershell facility." + exit /b 1 +) + +copy /Y "%~nx0" "%~n0.ps1" >nul +timeout /t 1 /nobreak >nul +powershell -executionpolicy remotesigned -Command "& '.\%~n0.ps1' %*" +start /b "" cmd /c del "%~f0" & exit /b %errorcode% +REM ############################################################################ +REM # Windows BATCH Codes # +REM ############################################################################ +RUN_AS_BATCH +#> | Out-Null + + + + +echo \" <<'RUN_AS_POWERSHELL' >/dev/null # " | Out-Null +################################################################################ +# Windows POWERSHELL Codes # +################################################################################ +. "${env:LIBS_HESTIA}\hestiaOS\Exec.sh.ps1" +. "${env:LIBS_HESTIA}\hestiaOS\Is_Command_Available.sh.ps1" +. "${env:LIBS_HESTIA}\hestiaOS\Is_Simulation_Mode.sh.ps1" +################################################################################ +# Windows POWERSHELL Codes # +################################################################################ +return +<# +RUN_AS_POWERSHELL + + + + +################################################################################ +# Unix Main Codes # +################################################################################ +. "${LIBS_HESTIA}/hestiaOS/Exec.sh.ps1" +. "${LIBS_HESTIA}/hestiaOS/Is_Command_Available.sh.ps1" +. "${LIBS_HESTIA}/hestiaOS/Is_Simulation_Mode.sh.ps1" +################################################################################ +# Unix Main Codes # +################################################################################ +return 0 +#> diff --git a/automataCI/services/hestiaSTRING/Is_Empty.sh.ps1 b/automataCI/services/hestiaSTRING/Is_Empty.sh.ps1 new file mode 100755 index 0000000..7c57bc4 --- /dev/null +++ b/automataCI/services/hestiaSTRING/Is_Empty.sh.ps1 @@ -0,0 +1,92 @@ +echo \" <<'RUN_AS_BATCH' >/dev/null ">NUL "\" \`" <#" +@ECHO OFF +REM LICENSE CLAUSES HERE +REM ---------------------------------------------------------------------------- + + + + +REM ############################################################################ +REM # Windows BATCH Codes # +REM ############################################################################ +where /q powershell +if errorlevel 1 ( + echo "ERROR: missing powershell facility." + exit /b 1 +) + +copy /Y "%~nx0" "%~n0.ps1" >nul +timeout /t 1 /nobreak >nul +powershell -executionpolicy remotesigned -Command "& '.\%~n0.ps1' %*" +start /b "" cmd /c del "%~f0" & exit /b %errorcode% +REM ############################################################################ +REM # Windows BATCH Codes # +REM ############################################################################ +RUN_AS_BATCH +#> | Out-Null + + + + +echo \" <<'RUN_AS_POWERSHELL' >/dev/null # " | Out-Null +################################################################################ +# Windows POWERSHELL Codes # +################################################################################ +. "${LIBS_HESTIA}\hestiaKERNEL\Vanilla.sh.ps1" + + + + +function hestiaSTRING-Is-Empty { + param( + $___target + ) + + + # execute + if ([string]::IsNullOrEmpty($___target)) { + return ${env:hestiaKERNEL_ERROR_OK} + } + + + # report status + return ${env:hestiaKERNEL_ERROR_DATA_EMPTY} +} +################################################################################ +# Windows POWERSHELL Codes # +################################################################################ +return +<# +RUN_AS_POWERSHELL + + + + +################################################################################ +# Unix Main Codes # +################################################################################ +. "${LIBS_HESTIA}/hestiaKERNEL/Vanilla.sh.ps1" + + + + +hestiaSTRING_Is_Empty() { + #___target="$1" + + + # execute + if [ -z "$1" ]; then + printf -- "%d" $hestiaKERNEL_ERROR_OK + return $hestiaKERNEL_ERROR_OK + fi + + + # report status + printf -- "%d" $hestiaKERNEL_ERROR_DATA_EMPTY + return $hestiaKERNEL_ERROR_DATA_EMPTY +} +################################################################################ +# Unix Main Codes # +################################################################################ +return 0 +#> diff --git a/automataCI/services/hestiaSTRING/Vanilla.sh.ps1 b/automataCI/services/hestiaSTRING/Vanilla.sh.ps1 new file mode 100755 index 0000000..77735de --- /dev/null +++ b/automataCI/services/hestiaSTRING/Vanilla.sh.ps1 @@ -0,0 +1,54 @@ +echo \" <<'RUN_AS_BATCH' >/dev/null ">NUL "\" \`" <#" +@ECHO OFF +REM LICENSE CLAUSES HERE +REM ---------------------------------------------------------------------------- + + + + +REM ############################################################################ +REM # Windows BATCH Codes # +REM ############################################################################ +where /q powershell +if errorlevel 1 ( + echo "ERROR: missing powershell facility." + exit /b 1 +) + +copy /Y "%~nx0" "%~n0.ps1" >nul +timeout /t 1 /nobreak >nul +powershell -executionpolicy remotesigned -Command "& '.\%~n0.ps1' %*" +start /b "" cmd /c del "%~f0" & exit /b %errorcode% +REM ############################################################################ +REM # Windows BATCH Codes # +REM ############################################################################ +RUN_AS_BATCH +#> | Out-Null + + + + +echo \" <<'RUN_AS_POWERSHELL' >/dev/null # " | Out-Null +################################################################################ +# Windows POWERSHELL Codes # +################################################################################ +. "${env:LIBS_HESTIA}\hestiaSTRING\Is_Empty.sh.ps1" +################################################################################ +# Windows POWERSHELL Codes # +################################################################################ +return +<# +RUN_AS_POWERSHELL + + + + +################################################################################ +# Unix Main Codes # +################################################################################ +. "${LIBS_HESTIA}/hestiaSTRING/Is_Empty.sh.ps1" +################################################################################ +# Unix Main Codes # +################################################################################ +return 0 +#> diff --git a/automataCI/services/hestiaZIP/Is_Target_Valid.sh.ps1 b/automataCI/services/hestiaZIP/Is_Target_Valid.sh.ps1 new file mode 100755 index 0000000..45f8a8e --- /dev/null +++ b/automataCI/services/hestiaZIP/Is_Target_Valid.sh.ps1 @@ -0,0 +1,126 @@ +echo \" <<'RUN_AS_BATCH' >/dev/null ">NUL "\" \`" <#" +@ECHO OFF +REM LICENSE CLAUSES HERE +REM ---------------------------------------------------------------------------- + + + + +REM ############################################################################ +REM # Windows BATCH Codes # +REM ############################################################################ +where /q powershell +if errorlevel 1 ( + echo "ERROR: missing powershell facility." + exit /b 1 +) + +copy /Y "%~nx0" "%~n0.ps1" >nul +timeout /t 1 /nobreak >nul +powershell -executionpolicy remotesigned -Command "& '.\%~n0.ps1' %*" +start /b "" cmd /c del "%~f0" & exit /b %errorcode% +REM ############################################################################ +REM # Windows BATCH Codes # +REM ############################################################################ +RUN_AS_BATCH +#> | Out-Null + + + + +echo \" <<'RUN_AS_POWERSHELL' >/dev/null # " | Out-Null +################################################################################ +# Windows POWERSHELL Codes # +################################################################################ +. "${env:LIBS_HESTIA}/hestiaKERNEL/Vanilla.sh.ps1" +. "${env:LIBS_HESTIA}/hestiaFS/Vanilla.sh.ps1" +. "${env:LIBS_HESTIA}/hestiaSTRING/Vanilla.sh.ps1" + + + + +function hestiaZIP-Is-Target-Valid { + param ( + [string]$___target + ) + + + # validate input + if ($(hestiaSTRING-Is-Empty "$1") -eq ${env:hestiaKERNEL_ERROR_OK}) { + return ${env:hestiaKERNEL_ERROR_DATA_MISSING} + } + + + # execute + $___subject = hestiaFS-Get-File "${___target}" + if (($("${___subject}" -replace '^.*\.nupkg$', '') -ne "${___subject}") -or + ($("${___subject}" -replace '^.*\.zip$', '') -ne "${___subject}")) { + return ${env:hestiaKERNEL_ERROR_OK} + } + + + # report status + return ${env:hestiaKERNEL_ERROR_DATA_MISMATCHED} +} +################################################################################ +# Windows POWERSHELL Codes # +################################################################################ +return +<# +RUN_AS_POWERSHELL + + + + +################################################################################ +# Unix Main Codes # +################################################################################ +. "${LIBS_HESTIA}/hestiaKERNEL/Vanilla.sh.ps1" +. "${LIBS_HESTIA}/hestiaFS/Vanilla.sh.ps1" +. "${LIBS_HESTIA}/hestiaSTRING/Vanilla.sh.ps1" +. "${LIBS_HESTIA}/hestiaOS/Vanilla.sh.ps1" + + + + +hestiaZIP_Is_Target_Valid() { + #___target="$1" + + + # validate input + if [ $(hestiaSTRING_Is_Empty "$1") -eq $hestiaKERNEL_ERROR_OK ]; then + printf -- "%d" $hestiaKERNEL_ERROR_DATA_MISSING + return $hestiaKERNEL_ERROR_DATA_MISSING + fi + + + # execute + if [ $(hestiaOS_Is_Command_Available "file") -eq $hestiaKERNEL_ERROR_OK ]; then + ___mime="$(file --brief --mime --mime-type "$1")" + ___mime="${___mime%%;*}" + + if [ "$___mime" = "application/zip" ]; then + printf -- "%d" $hestiaKERNEL_ERROR_OK + return $hestiaKERNEL_ERROR_OK + fi + fi + + + # no choice - guess by extension as last resort + ___subject="$(hestiaFS_Get_File "$1")" + if [ ! "${___subject%%.zip*}" = "$___subject" ] || + [ ! "${___subject%%.nupkg*}" = "$___subject" ]; then + printf -- "%d" $hestiaKERNEL_ERROR_OK + return $hestiaKERNEL_ERROR_OK + fi + + + # report status + printf -- "%d" $hestiaKERNEL_ERROR_DATA_MISMATCHED + return $hestiaKERNEL_ERROR_DATA_MISMATCHED +} +################################################################################ +# Unix Main Codes # +################################################################################ +return 0 +#> diff --git a/automataCI/services/hestiaZIP/Vanilla.sh.ps1 b/automataCI/services/hestiaZIP/Vanilla.sh.ps1 new file mode 100755 index 0000000..b31cec3 --- /dev/null +++ b/automataCI/services/hestiaZIP/Vanilla.sh.ps1 @@ -0,0 +1,54 @@ +echo \" <<'RUN_AS_BATCH' >/dev/null ">NUL "\" \`" <#" +@ECHO OFF +REM LICENSE CLAUSES HERE +REM ---------------------------------------------------------------------------- + + + + +REM ############################################################################ +REM # Windows BATCH Codes # +REM ############################################################################ +where /q powershell +if errorlevel 1 ( + echo "ERROR: missing powershell facility." + exit /b 1 +) + +copy /Y "%~nx0" "%~n0.ps1" >nul +timeout /t 1 /nobreak >nul +powershell -executionpolicy remotesigned -Command "& '.\%~n0.ps1' %*" +start /b "" cmd /c del "%~f0" & exit /b %errorcode% +REM ############################################################################ +REM # Windows BATCH Codes # +REM ############################################################################ +RUN_AS_BATCH +#> | Out-Null + + + + +echo \" <<'RUN_AS_POWERSHELL' >/dev/null # " | Out-Null +################################################################################ +# Windows POWERSHELL Codes # +################################################################################ +. "${env:LIBS_HESTIA}\hestiaZIP\Is_Target_Valid.sh.ps1" +################################################################################ +# Windows POWERSHELL Codes # +################################################################################ +return +<# +RUN_AS_POWERSHELL + + + + +################################################################################ +# Unix Main Codes # +################################################################################ +. "${LIBS_HESTIA}/hestiaZIP/Is_Target_Valid.sh.ps1" +################################################################################ +# Unix Main Codes # +################################################################################ +return 0 +#> diff --git a/automataCI/services/io/fs.sh b/automataCI/services/io/fs.sh index aaaf22f..13777f9 100644 --- a/automataCI/services/io/fs.sh +++ b/automataCI/services/io/fs.sh @@ -357,10 +357,12 @@ FS_Is_Target_A_C() { fi if [ $(FS_Is_Target_A_Cargo "$1") -eq 0 ]; then + printf -- "1" return 1 fi if [ $(FS_Is_Target_A_Chocolatey "$1") -eq 0 ]; then + printf -- "1" return 1 fi diff --git a/automataCI/services/publishers/chocolatey.ps1 b/automataCI/services/publishers/chocolatey.ps1 index 313bdfd..c2a17aa 100644 --- a/automataCI/services/publishers/chocolatey.ps1 +++ b/automataCI/services/publishers/chocolatey.ps1 @@ -202,7 +202,7 @@ function CHOCOLATEY-Test { # execute $___name = Split-Path -Leaf -Path "${___target}" - $___name = $___name -replace '\-chocolatey.*$', '' + $___name = $___name -replace "_.*$", '' ## test install @@ -211,8 +211,9 @@ function CHOCOLATEY-Test { $___arguments = "install ${___name} " ` + "--debug " ` + "--verbose " ` + + "--pre " ` + "--force " ` - + "--source `".`" " + + "--source `".`"" $___process = OS-Exec "choco" "${___arguments}" $null = Set-Location "${___current_path}" $null = Remove-Variable "___current_path" @@ -227,8 +228,9 @@ function CHOCOLATEY-Test { $___arguments = "uninstall ${___name} " ` + "--debug " ` + "--verbose " ` + + "--pre " ` + "--force " ` - + "--source `".`" " + + "--source `".`"" $___process = OS-Exec "choco" "${___arguments}" $null = Set-Location "${___current_path}" $null = Remove-Variable "___current_path" diff --git a/src/.ci/_package-chocolatey_unix-any.sh b/src/.ci/_package-chocolatey_unix-any.sh index c8523df..b009a30 100644 --- a/src/.ci/_package-chocolatey_unix-any.sh +++ b/src/.ci/_package-chocolatey_unix-any.sh @@ -108,7 +108,7 @@ PACKAGE_Assemble_CHOCOLATEY_Content() { return 10 # not applicable else # copy main program - __dest="${_directory}/bin/${PROJECT_SKU}.exe" + __dest="${_directory}/bin/${PROJECT_SKU}-${_target_arch}.exe" I18N_Assemble "$_target" "$__dest" FS_Make_Housing_Directory "$__dest" @@ -121,6 +121,8 @@ PACKAGE_Assemble_CHOCOLATEY_Content() { _package="${PROJECT_SKU}" fi + + # copy icon.png __source="${PROJECT_PATH_ROOT}/${PROJECT_PATH_SOURCE}/icons/icon-128x128.png" __dest="${_directory}/icon.png" I18N_Assemble "$__source" "$__dest" @@ -130,6 +132,8 @@ PACKAGE_Assemble_CHOCOLATEY_Content() { return 1 fi + + # copy README.md __source="${PROJECT_PATH_ROOT}/${PROJECT_README}" __dest="${_directory}/${PROJECT_README}" I18N_Assemble "$__source" "$__dest" @@ -140,6 +144,17 @@ PACKAGE_Assemble_CHOCOLATEY_Content() { fi + # copy primary license file + __source="${PROJECT_PATH_ROOT}/${PROJECT_LICENSE_FILE}" + __dest="${_directory}/${PROJECT_LICENSE_FILE}" + I18N_Assemble "$__source" "$__dest" + FS_Copy_File "$__source" "$__dest" + if [ $? -ne 0 ]; then + I18N_Assemble_Failed + return 1 + fi + + # REQUIRED: chocolatey required tools\ directory __dest="${_directory}/tools" I18N_Create "$__dest" @@ -189,29 +204,46 @@ Write-Host \"Uninstalling ${PROJECT_SKU} (${PROJECT_VERSION})...\" fi + # IMPORTANT NOTE: Chocolatey specifically mentions only use dash (-) as + # the separator and not others including the nupkg's + # dot (.) specification. Please comply for consistencies + # and compatibilities purposes. + # + # The default pattern here considers the possibility + # of facilitating cross-compilation services at the + # guest side. + __id="${PROJECT_SCOPE}-${_package}-${_target_os}-${_target_arch}" + + # IMPORTANT NOTE: Chocolatey specifically mentions its nuspec must have + # the ID as filename. Please do not alter it. + __dest="${_directory}/${__id}.nuspec" + # REQUIRED: chocolatey xml.nuspec file - __dest="${_directory}/${_package}.nuspec" + __title="$(STRINGS_To_Titlecase "$PROJECT_CHOCOLATEY_ID")" + __title="${PROJECT_NAME} (${_target_os}-${_target_arch}) | ${__title}" I18N_Create "$__dest" FS_Write_File "$__dest" "\ - ${PROJECT_SKU} - ${PROJECT_NAME} + ${__id} ${PROJECT_VERSION} + ${PROJECT_PITCH} ${PROJECT_CONTACT_NAME} ${PROJECT_CONTACT_NAME} ${PROJECT_CONTACT_WEBSITE} - ${PROJECT_LICENSE} - ${PROJECT_PITCH} - ${PROJECT_README} + ${PROJECT_LICENSE_FILE} icon.png + ${PROJECT_README} + + ${__title} + " if [ $? -ne 0 ]; then diff --git a/src/.ci/_package-chocolatey_windows-any.ps1 b/src/.ci/_package-chocolatey_windows-any.ps1 index 0bd8bd8..00fbe19 100644 --- a/src/.ci/_package-chocolatey_windows-any.ps1 +++ b/src/.ci/_package-chocolatey_windows-any.ps1 @@ -122,6 +122,7 @@ function PACKAGE-Assemble-CHOCOLATEY-Content { } + # copy icon.png $__source = "${env:PROJECT_PATH_ROOT}\${env:PROJECT_PATH_SOURCE}\icons\icon-128x128.png" $__dest = "${_directory}\icon.png" $null = I18N-Assemble "${__source}" "${__dest}" @@ -131,6 +132,8 @@ function PACKAGE-Assemble-CHOCOLATEY-Content { return 1 } + + # copy README.md $__source = "${env:PROJECT_PATH_ROOT}\${env:PROJECT_README}" $__dest = "${_directory}\${env:PROJECT_README}" $null = I18N-Assemble "${__source}" "${__dest}" @@ -141,6 +144,17 @@ function PACKAGE-Assemble-CHOCOLATEY-Content { } + # copy primary license file + $__source = "${env:PROJECT_PATH_ROOT}\${env:PROJECT_LICENSE_FILE}" + $__dest = "${_directory}\${env:PROJECT_LICENSE_FILE}" + $null = I18N-Assemble "${__source}" "${__dest}" + $___process = FS-Copy-File "${__source}" "${__dest}" + if ($___process -ne 0) { + $null = I18N-Assemble-Failed + return 1 + } + + # REQUIRED: chocolatey required tools\ directory $__dest = "${_directory}\tools" $null = I18N-Create "${__dest}" @@ -192,29 +206,46 @@ Write-Host "Uninstalling ${env:PROJECT_SKU} (${env:PROJECT_VERSION})..." } + # IMPORTANT NOTE: Chocolatey specifically mentions only use dash (-) as + # the separator and not others including the nupkg's + # dot (.) specification. Please comply for consistencies + # and compatibilities purposes. + # + # The default pattern here considers the possibility + # of facilitating cross-compilation services at the + # guest side. + $__id = "${env:PROJECT_SCOPE}-${_package}-${_target_os}-${_target_arch}" + + # IMPORTANT NOTE: Chocolatey specifically mentions its nuspec must have + # the ID as filename. Please do not alter it. + $__dest = "${_directory}\${__id}.nuspec" + # REQUIRED: chocolatey xml.nuspec file - $__dest = "${_directory}\${env:PROJECT_SKU}.nuspec" + $__title = "$(STRINGS-To-Titlecase "${env:PROJECT_CHOCOLATEY_ID}")" + $__title = "${env:PROJECT_NAME} (${_target_os}-${_target_arch}) | ${__title}" $null = I18N-Create "${__dest}" $___process = FS-Write-File "${__dest}" @" - ${env:PROJECT_SKU} - ${env:PROJECT_NAME} + ${__id} ${env:PROJECT_VERSION} + ${env:PROJECT_PITCH} ${env:PROJECT_CONTACT_NAME} ${env:PROJECT_CONTACT_NAME} ${env:PROJECT_CONTACT_WEBSITE} - ${env:PROJECT_LICENSE} - ${env:PROJECT_PITCH} - ${env:PROJECT_README} + ${env:PROJECT_LICENSE_FILE} icon.png + ${env:PROJECT_README} + + ${env:PROJECT_NAME} + "@ diff --git a/src/.ci/_package-lib_unix-any.sh b/src/.ci/_package-lib_unix-any.sh index 3e2324b..ece4614 100644 --- a/src/.ci/_package-lib_unix-any.sh +++ b/src/.ci/_package-lib_unix-any.sh @@ -43,7 +43,8 @@ PACKAGE_Assemble_LIB_Content() { # execute - _workspace="packagers-lib-$(FS_Get_File "$_target")" + _package="lib${PROJECT_SKU}" + _workspace="packagers-lib-${_package}_${_target_os}-${_target_arch}" _workspace="${PROJECT_PATH_ROOT}/${PROJECT_PATH_TEMP}/${_workspace}" FS_Remove_Silently "$_workspace" @@ -152,6 +153,18 @@ PACKAGE_Assemble_LIB_Content() { done + # copy primary license file + __source="${PROJECT_PATH_ROOT}/${PROJECT_LICENSE_FILE}" + __dest="${_workspace}/${PROJECT_LICENSE_FILE}" + I18N_Assemble "$__source" "$__dest" + FS_Copy_File "$__source" "$__dest" + if [ $? -ne 0 ]; then + I18N_Assemble_Failed + return 1 + fi + + + # assemble icon.png __source="${PROJECT_PATH_ROOT}/${PROJECT_PATH_SOURCE}/icons/icon-128x128.png" __dest="${_workspace}/icon.png" @@ -167,7 +180,7 @@ PACKAGE_Assemble_LIB_Content() { __current_path="$PWD" && cd "$_workspace" ## package tar.xz - __dest="lib${PROJECT_SKU}_${PROJECT_VERSION}_${_target_os}-${_target_arch}.tar.xz" + __dest="${_package}_${PROJECT_VERSION}_${_target_os}-${_target_arch}.tar.xz" I18N_Create_Package "$__dest" __dest="${_directory}/${__dest}" TAR_Create_XZ "$__dest" "." @@ -178,7 +191,7 @@ PACKAGE_Assemble_LIB_Content() { fi ## package zip - __dest="lib${PROJECT_SKU}_${PROJECT_VERSION}_${_target_os}-${_target_arch}.zip" + __dest="${_package}_${PROJECT_VERSION}_${_target_os}-${_target_arch}.zip" I18N_Create_Package "$__dest" __dest="${_directory}/${__dest}" ZIP_Create "$__dest" "." @@ -194,26 +207,30 @@ PACKAGE_Assemble_LIB_Content() { __acceptance="true" fi - __dest="lib${PROJECT_SKU}.nuspec" + __id="${PROJECT_SCOPE}.${_package}.${_target_os}.${_target_arch}" + __title="${PROJECT_NAME} (${_package} ${_target_os}-${_target_arch})" + __dest=".nuspec" I18N_Create "$__dest" FS_Write_File "./${__dest}" "\ - ${PROJECT_SKU} + ${__id} ${PROJECT_VERSION} + ${PROJECT_PITCH} ${PROJECT_CONTACT_NAME} ${PROJECT_CONTACT_NAME} - ${PROJECT_SOURCE_URL} - ${PROJECT_NAME} - ${PROJECT_PITCH} - ${PROJECT_LICENSE} - ${__acceptance} - ${PROJECT_README} + ${PROJECT_CONTACT_WEBSITE} + ${PROJECT_LICENSE_FILE} icon.png + ${PROJECT_README} + ${__acceptance} + + ${__title} + @@ -225,7 +242,7 @@ PACKAGE_Assemble_LIB_Content() { return 1 fi - __dest="lib${PROJECT_SKU}_${PROJECT_VERSION}_${_target_os}-${_target_arch}.nupkg" + __dest="${_package}_${PROJECT_VERSION}_${_target_os}-${_target_arch}.nupkg" I18N_Create_Package "$__dest" __dest="${_directory}/${__dest}" ZIP_Create "$__dest" "." diff --git a/src/.ci/_package-lib_windows-any.ps1 b/src/.ci/_package-lib_windows-any.ps1 index 9cdd117..a5999ef 100644 --- a/src/.ci/_package-lib_windows-any.ps1 +++ b/src/.ci/_package-lib_windows-any.ps1 @@ -44,7 +44,8 @@ function PACKAGE-Assemble-LIB-Content { # execute - $_workspace = "packagers-lib-lib${env:PROJECT_SKU}_${_target_os}-${_target_arch}" + $_package = "lib${env:PROJECT_SKU}" + $_workspace = "packagers-lib-${_package}_${_target_os}-${_target_arch}" $_workspace = "${env:PROJECT_PATH_ROOT}\${env:PROJECT_PATH_TEMP}\${_workspace}" $null = FS-Remove-Silently "${_workspace}" @@ -119,10 +120,12 @@ function PACKAGE-Assemble-LIB-Content { } - # copy user guide - Get-ChildItem -Path "${env:PROJECT_PATH_ROOT}\${env:PROJECT_PATH_SOURCE}\docs" ` - | Where-Object { ($_.Name -like "USER-GUIDES*.pdf") } ` - | ForEach-Object { $__source = $_.FullName + # copy user guide files + foreach ($__source in ` + (Get-ChildItem -Path "${env:PROJECT_PATH_ROOT}\${env:PROJECT_PATH_SOURCE}\docs" ` + | Where-Object { ($_.Name -like "USER-GUIDES*.pdf") })) { + $__source = $__source.FullName + $__dest = "${_workspace}\$(FS-Get-File "${__source}")" $null = I18N-Assemble "${__source}" "${__dest}" $___process = FS-Copy-File "${__source}" "${__dest}" @@ -133,10 +136,12 @@ function PACKAGE-Assemble-LIB-Content { } - # copy license file - Get-ChildItem -Path "${env:PROJECT_PATH_ROOT}\${env:PROJECT_PATH_SOURCE}\licenses" ` - | Where-Object { ($_.Name -like "LICENSE*.pdf") } ` - | ForEach-Object { $__source = $_.FullName + # copy license files + foreach ($__source in ` + (Get-ChildItem -Path "${env:PROJECT_PATH_ROOT}\${env:PROJECT_PATH_SOURCE}\licenses" ` + | Where-Object { ($_.Name -like "LICENSE*.pdf") })) { + $__source = $__source.FullName + $__dest = "${_workspace}\$(FS-Get-File "${__source}")" $null = I18N-Assemble "${__source}" "${__dest}" $___process = FS-Copy-File "${__source}" "${__dest}" @@ -147,6 +152,17 @@ function PACKAGE-Assemble-LIB-Content { } + # copy primary license file + $__source = "${env:PROJECT_PATH_ROOT}\${env:PROJECT_LICENSE_FILE}" + $__dest = "${_workspace}\${env:PROJECT_LICENSE_FILE}" + $null = I18N-Assemble "${__source}" "${__dest}" + $___process = FS-Copy-File "${__source}" "${__dest}" + if ($___process -ne 0) { + $null = I18N-Assemble-Failed + return 1 + } + + # assemble icon.png $__source = "${env:PROJECT_PATH_ROOT}\${env:PROJECT_PATH_SOURCE}\icons\icon-128x128.png" $__dest = "${_workspace}\icon.png" @@ -163,7 +179,7 @@ function PACKAGE-Assemble-LIB-Content { $null = Set-Location -Path "${_workspace}" ## package tar.xz - $__dest = "lib${env:PROJECT_SKU}_${env:PROJECT_VERSION}_${_target_os}-${_target_arch}.tar.xz" + $__dest = "${_package}_${env:PROJECT_VERSION}_${_target_os}-${_target_arch}.tar.xz" $null = I18N-Create-Package "${__dest}" $__dest = "${_directory}\${__dest}" $___process = TAR-Create-XZ "${__dest}" "." @@ -175,7 +191,7 @@ function PACKAGE-Assemble-LIB-Content { } ## package zip - $__dest = "lib${env:PROJECT_SKU}_${env:PROJECT_VERSION}_${_target_os}-${_target_arch}.zip" + $__dest = "${_package}_${env:PROJECT_VERSION}_${_target_os}-${_target_arch}.zip" $null = I18N-Create-Package "${__dest}" $__dest = "${_directory}\${__dest}" $___process = ZIP-Create "${__dest}" "." @@ -192,26 +208,31 @@ function PACKAGE-Assemble-LIB-Content { $__acceptance = "true" } - $__dest = "lib${env:PROJECT_SKU}.nuspec" + $__id = "${env:PROJECT_SCOPE}.${_package}.${_target_os}.${_target_arch}" + $__title = "${env:PROJECT_NAME} (${_package} ${_target_os}-${_target_arch})" + $__dest = ".nuspec" $null = I18N-Create "${__dest}" $__dest = ".\${__dest}" $___process = FS-Write-File "${__dest}" @" - ${env:PROJECT_SKU} + ${__id} ${env:PROJECT_VERSION} + ${env:PROJECT_PITCH} ${env:PROJECT_CONTACT_NAME} ${env:PROJECT_CONTACT_NAME} - ${env:PROJECT_SOURCE_URL} - ${env:PROJECT_NAME} - ${env:PROJECT_PITCH} - ${env:PROJECT_LICENSE} - ${__acceptance} + ${env:PROJECT_CONTACT_WEBSITE} + ${env:PROJECT_LICENSE_FILE} + icon.png ${env:PROJECT_README} + ${__acceptance} + + ${__title} + @@ -225,7 +246,7 @@ function PACKAGE-Assemble-LIB-Content { return 1 } - $__dest = "lib${env:PROJECT_SKU}_${env:PROJECT_VERSION}_${_target_os}-${_target_arch}.nupkg" + $__dest = "${_package}_${env:PROJECT_VERSION}_${_target_os}-${_target_arch}.nupkg" $null = I18N-Create-Package "${__dest}" $__dest = "${_directory}\${__dest}" $___process = ZIP-Create "${__dest}" "."