diff --git a/CONFIG.toml b/CONFIG.toml index da0396e..a4494d8 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' @@ -695,16 +697,16 @@ PROJECT_PYPI_README_MIME = 'text/markdown' PROJECT_RESEARCH = 'srcRESEARCH' -# PROJECT_RESEARCH_IDENTIFIER -# The file identifier for the compiled output paper file from its peers with the +# PROJECT_RESEARCH_ID +# The identifier for the compiled output paper file from its peers with the # same formats (e.g. a bunch of PDFs). This is suffix-ed within the filename # itself like: # -# pattern: '${PROJECT_SKU}-${PROJECT_RESEARCH_IDENTIFIER}_v${PROJECT_VERSION}_any-any.pdf' +# pattern: '${PROJECT_SKU}-${PROJECT_RESEARCH_ID}_v${PROJECT_VERSION}_any-any.pdf' # example: 'automataci-RESEARCH_v100.00.100_any-any.pdf' # # default is: 'RESEARCH' -PROJECT_RESEARCH_IDENTIFIER = 'RESEARCH' +PROJECT_RESEARCH_ID = 'RESEARCH' @@ -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' + + ############################# @@ -1211,6 +1223,17 @@ PROJECT_DOCS_REPO_KEY = 'origin' PROJECT_DOCS_REPO_BRANCH = 'gh-pages' +# PROJECT_DOCS_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 a documentation parcel. +# +# This field shall not be EMPTY. +# +# Default is: 'docs' +PROJECT_DOCS_ID = 'docs' + + ########################## @@ -1664,6 +1687,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-assemble-archive_unix-any.sh b/automataCI/__package-assemble-archive_unix-any.sh new file mode 100644 index 0000000..ef71df2 --- /dev/null +++ b/automataCI/__package-assemble-archive_unix-any.sh @@ -0,0 +1,131 @@ +#!/bin/sh +# Copyright 2023 (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. + + + + +# initialize +if [ "$PROJECT_PATH_ROOT" = "" ]; then + >&2 printf "[ ERROR ] - Please run from automataCI/ci.sh.ps1 instead!\n" + return 1 +fi + +. "${LIBS_AUTOMATACI}/services/hestiaCONSOLE/Vanilla.sh.ps1" +. "${LIBS_AUTOMATACI}/services/hestiaFS/Vanilla.sh.ps1" +. "${LIBS_AUTOMATACI}/services/hestiaKERNEL/Vanilla.sh.ps1" +. "${LIBS_AUTOMATACI}/services/hestiaNPM/Vanilla.sh.ps1" +. "${LIBS_AUTOMATACI}/services/hestiaRUST/Vanilla.sh.ps1" +. "${LIBS_AUTOMATACI}/services/hestiaTAR/Vanilla.sh.ps1" +. "${LIBS_AUTOMATACI}/services/hestiaWASM/Vanilla.sh.ps1" +. "${LIBS_AUTOMATACI}/services/hestiaZIP/Vanilla.sh.ps1" + + + + +PACKAGE_Assemble_As_ARCHIVE() { + _target="$1" + _directory="$2" + _target_name="$3" + _target_os="$4" + _target_arch="$5" + + + # determine unpack destination + if [ $(hestiaFS_Is_Filename_Has "$_target" "-docs") -eq $hestiaKERNEL_ERROR_OK ]; then + __dest="${_directory}/docs" + elif [ $(hestiaFS_Is_Filename_Has "$_target" "-lib") -eq $hestiaKERNEL_ERROR_OK ] || + [ $(hestiaFS_Is_Filename_Has "$_target" "lib") -eq $hestiaKERNEL_ERROR_OK ]; then + __dest="${_directory}/lib" + + if [ $(hestiaNPM_Is_Target_Valid "$_target") -eq $hestiaKERNEL_ERROR_OK ] || + [ $(hestiaRUST_Is_Target_Valid "$_target") -eq $hestiaKERNEL_ERROR_OK ]; then + __dest="$_directory" # distribution oriented libraries + fi + elif [ $(hestiaWASM_Is_Target_Valid "$_target") -eq $hestiaKERNEL_ERROR_OK ]; then + __dest="${_directory}/assets" + else + __dest="${_directory}/bin" + if [ $(hestiaTAR_Is_Target_Valid "$_target") -eq $hestiaKERNEL_ERROR_OK ] || + [ $(hestiaZIP_Is_Target_Valid "$_target") -eq $hestiaKERNEL_ERROR_OK ]; then + __dest="$_directory" + fi + fi + + + # assemble based on target's nature + if [ $(hestiaTAR_Is_Target_Valid "$_target") -eq $hestiaKERNEL_ERROR_OK ]; then + # unpack tar* + hestiaCONSOLE_Log_Assemble "$__dest" "$_target" + hestiaFS_Create_Directory "$__dest" + hestiaTAR_Unpack "$__dest" "$_target" + if [ $? -ne $hestiaKERNEL_ERROR_OK ]; then + hestiaCONSOLE_Log_Assemble_Failed + return $hestiaKERNEL_ERROR_BAD_EXEC + fi + elif [ $(hestiaZIP_Is_Target_Valid "$_target") -eq $hestiaKERNEL_ERROR_OK ]; then + # unpack zip + hestiaCONSOLE_Log_Assemble "$__dest" "$_target" + hestiaFS_Create_Directory "$__dest" + hestiaZIP_Unpack "$__dest" "$_target" + if [ $? -ne $hestiaKERNEL_ERROR_OK ]; then + hestiaCONSOLE_Log_Assemble_Failed + return $hestiaKERNEL_ERROR_BAD_EXEC + fi + else + # assemble standalone file + ___filename="$(hestiaFS_Get_File "$_target")" + if [ "$__dest" = "${_directory}/bin" ]; then + ___filename="${PROJECT_SKU}" + if [ "$_target_os" = "windows" ]; then + ___filename="${___filename}.exe" + fi + fi + + hestiaCONSOLE_Log_Assemble "${__dest}/${___filename}" "$_target" + hestiaFS_Create_Directory "$__dest" + hestiaFS_Copy_File "${__dest}/${___filename}" "$_target" + if [ $? -ne $hestiaKERNEL_ERROR_OK ]; then + hestiaCONSOLE_Log_Assemble_Failed + return $hestiaKERNEL_ERROR_BAD_EXEC + fi + + # if it is WASM artifact, then check for its gluing js script + # whenever available. + if [ $(hestiaWASM_Is_Target_Valid "$_target") -eq $hestiaKERNEL_ERROR_OK ]; then + __source="$(hestiaFS_Replace_Extension "$_target" ".wasm" ".js")" + if [ $(hestiaFS_Is_File "$__source") -eq $hestiaKERNEL_ERROR_OK ]; then + __dest="${__dest}/$(hestiaFS_Get_File "$__source")" + hestiaCONSOLE_Log_Assemble "$__dest" "$_target" + hestiaFS_Copy_File \ + "${__dest}/$(hestiaFS_Get_File "$_target")" \ + "$_target" + if [ $? -ne $hestiaKERNEL_ERROR_OK ]; then + hestiaCONSOLE_Log_Assemble_Failed + return $hestiaKERNEL_ERROR_BAD_EXEC + fi + fi + fi + fi + + + # sanitize check before proceeding + hestiaCONSOLE_Log_Check "$_directory" + if [ $(hestiaFS_Is_Directory_Empty "$_directory") -eq 0 ]; then + hestiaCONSOLE_Log_Check_Failed + return $hestiaKERNEL_ERROR_BAD_EXEC + fi + + + # report status + return $hestiaKERNEL_ERROR_OK +} diff --git a/automataCI/__package-assemble-archive_windows-any.ps1 b/automataCI/__package-assemble-archive_windows-any.ps1 new file mode 100644 index 0000000..b7de799 --- /dev/null +++ b/automataCI/__package-assemble-archive_windows-any.ps1 @@ -0,0 +1,139 @@ +#!/bin/sh +# Copyright 2023 (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. + + + + +# initialize +if (-not (Test-Path -Path $env:PROJECT_PATH_ROOT)) { + Write-Error "[ ERROR ] - Please run from automataIC\ci.sh.ps1 instead!`n" + return +} + +. "${env:LIBS_AUTOMATACI}\services\hestiaCONSOLE\Vanilla.sh.ps1" +. "${env:LIBS_AUTOMATACI}\services\hestiaFS\Vanilla.sh.ps1" +. "${env:LIBS_AUTOMATACI}\services\hestiaKERNEL\Vanilla.sh.ps1" +. "${env:LIBS_AUTOMATACI}\services\hestiaNPM\Vanilla.sh.ps1" +. "${env:LIBS_AUTOMATACI}\services\hestiaRUST\Vanilla.sh.ps1" +. "${env:LIBS_AUTOMATACI}\services\hestiaTAR\Vanilla.sh.ps1" +. "${env:LIBS_AUTOMATACI}\services\hestiaWASM\Vanilla.sh.ps1" +. "${env:LIBS_AUTOMATACI}\services\hestiaZIP\Vanilla.sh.ps1" + + + + +function PACKAGE-Assemble-As-ARCHIVE { + param ( + [string]$_target, + [string]$_directory, + [string]$_target_name, + [string]$_target_os, + [string]$_target_arch + ) + + + # determine unpack destination + if ($(hestiaFS-Is-Filename-Has "${_target}" "-docs") -eq ${env:hestiaKERNEL_ERROR_OK}) { + $__dest = "${_directory}\docs" + } elseif ( + ($(hestiaFS-Is-Filename-Has "${_target}" "-lib") -eq ${env:hestiaKERNEL_ERROR_OK}) -or + ($(hestiaFS-Is-Filename-Has "${_target}" "lib") -eq ${env:hestiaKERNEL_ERROR_OK}) + ) { + $__dest = "${_directory}\lib" + + if ( + ($(hestiaNPM-Is-Target-Valid "${_target}") -eq ${env:hestiaKERNEL_ERROR_OK}) -or + ($(hestiaRUST-Is-Target-Valid "${_target}") -eq ${env:hestiaKERNEL_ERROR_OK}) + ) { + $__dest = "${_directory}" # distribution oriented libraries + } + } elseif ($(hestiaWASM-Is-Target-Valid "${_target}") -eq ${env:hestiaKERNEL_ERROR_OK}) { + $__dest = "${_directory}\assets" + } else { + $__dest = "${_directory}\bin" + if ( + ($(hestiaTAR-Is-Target-Valid "${_target}") -eq ${env:hestiaKERNEL_ERROR_OK}) -or + ($(hestiaZIP-Is-Target-Valid "${_target}") -eq $hestiaKERNEL_ERROR_OK) + ) { + $__dest = "${_directory}" + } + } + + + # assemble based on target's nature + if ($(hestiaTAR-Is-Target-Valid "${_target}") -eq ${env:hestiaKERNEL_ERROR_OK}) { + # unpack tar* + $null = hestiaCONSOLE-Log-Assemble "${__dest}" "${_target}" + $null = hestiaFS-Create-Directory "${__dest}" + $___process = hestiaTAR-Unpack "${__dest}" "${_target}" + if ($___process -ne ${env:hestiaKERNEL_ERROR_OK}) { + $null = hestiaCONSOLE-Log-Assemble-Failed + return ${env:hestiaKERNEL_ERROR_BAD_EXEC} + } + } elseif ($(hestiaZIP-Is-Target-Valid "${_target}") -eq ${env:hestiaKERNEL_ERROR_OK}) { + # unpack zip + $null = hestiaCONSOLE-Log-Assemble "${__dest}" "${_target}" + $null = hestiaFS-Create-Directory "${__dest}" + $___process = hestiaZIP-Unpack "${__dest}" "${_target}" + if ($___process -ne ${env:hestiaKERNEL_ERROR_OK}) { + $null = hestiaCONSOLE-Log-Assemble-Failed + return ${env:hestiaKERNEL_ERROR_BAD_EXEC} + } + } else { + # assemble standalone file + $___filename = hestiaFS-Get-File "${_target}" + if ($__dest -eq "${_directory}\bin") { + $___filename = "${PROJECT_SKU}" + if ($_target_os -eq "windows") { + $___filename = "${___filename}.exe" + } + } + + $null = hestiaCONSOLE-Log-Assemble "${__dest}\${___filename}" "${_target}" + $null = hestiaFS-Create-Directory "${__dest}" + $___process = hestiaFS-Copy-File "${__dest}\${___filename}" "${_target}" + if ($___process -ne ${env:hestiaKERNEL_ERROR_OK}) { + $null = hestiaCONSOLE-Log-Assemble-Failed + return $hestiaKERNEL_ERROR_BAD_EXEC + } + + # if it is WASM artifact, then check for its gluing js script + # whenever available. + if ($(hestiaWASM-Is-Target-Valid "${_target}") -eq ${env:hestiaKERNEL_ERROR_OK}) { + $__source = "$(hestiaFS-Replace-Extension "${_target}" ".wasm" ".js")" + if ($(hestiaFS-Is-File "${__source}") -eq ${env:hestiaKERNEL_ERROR_OK}) { + $__dest = "${__dest}\$(hestiaFS-Get-File "${__source}")" + $null = hestiaCONSOLE-Log-Assemble "${__dest}" "${_target}" + $___process = hestiaFS-Copy-File ` + "${__dest}\$(hestiaFS-Get-File "${_target}")" ` + "${_target}" + if ($___process -ne ${env:hestiaKERNEL_ERROR_OK}) { + $null = hestiaCONSOLE-Log-Assemble-Failed + return ${env:hestiaKERNEL_ERROR_BAD_EXEC} + } + } + } + } + + + # sanitize check before proceeding + $null = hestiaCONSOLE-Log-Check "${_directory}" + if ($(hestiaFS-Is-Directory-Empty "${_directory}") -eq ${env:hestiaKERNEL_ERROR_OK}) { + $null = hestiaCONSOLE-Log-Check-Failed + return ${env:hestiaKERNEL_ERROR_BAD_EXEC} + } + + + # report status + return ${env:hestiaKERNEL_ERROR_OK} +} diff --git a/automataCI/__package-assemble-default-single-content_unix-any.sh b/automataCI/__package-assemble-default-single-content_unix-any.sh new file mode 100644 index 0000000..778ac3d --- /dev/null +++ b/automataCI/__package-assemble-default-single-content_unix-any.sh @@ -0,0 +1,61 @@ +#!/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. + + + + +# initialize +if [ "$PROJECT_PATH_ROOT" = "" ]; then + >&2 printf "[ ERROR ] - Please run from automataCI/ci.sh.ps1 instead!\n" + return 1 +fi + +. "${LIBS_AUTOMATACI}/services/hestiaCONSOLE/Vanilla.sh.ps1" +. "${LIBS_AUTOMATACI}/services/hestiaFS/Vanilla.sh.ps1" +. "${LIBS_AUTOMATACI}/services/hestiaKERNEL/Vanilla.sh.ps1" +. "${LIBS_AUTOMATACI}/services/hestiaPDF/Vanilla.sh.ps1" + + + + +PACKAGE_Assemble_Default_Single_Content() { + _target="$1" + _directory="$2" + _target_name="$3" + _target_os="$4" + _target_arch="$5" + + + # determine destination path + if [ $(hestiaPDF_Is_Target_Valid "$_target") -eq $hestiaKERNEL_ERROR_OK ]; then + __dest="${_directory}/${PROJECT_SKU}_any-any.pdf" + if [ $(hestiaFS_Is_Filename_Has "$_target" "$PROJECT_RESEARCH_ID") -eq $hestiaKERNEL_ERROR_OK ]; then + __dest="${_directory}/${PROJECT_SKU}-${PROJECT_RESEARCH_ID}_any-any.pdf" + fi + else + return $hestiaKERNEL_ERROR_CANCELLED # not applicable + fi + + + # assemble the file + hestiaCONSOLE_Log_Assemble "$__dest" "$_target" + hestiaFS_Copy_File "$__dest" "$_target" + if [ $? -ne $hestiaKERNEL_ERROR_OK ]; then + hestiaCONSOLE_Log_Assemble_Failed + return $hestiaKERNEL_ERROR_BAD_EXEC + fi + + + # report status + return $hestiaKERNEL_ERROR_OK +} diff --git a/automataCI/__package-assemble-default-single-content_windows-any.ps1 b/automataCI/__package-assemble-default-single-content_windows-any.ps1 new file mode 100644 index 0000000..f954171 --- /dev/null +++ b/automataCI/__package-assemble-default-single-content_windows-any.ps1 @@ -0,0 +1,63 @@ +#!/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. + + + + +# initialize +if (-not (Test-Path -Path $env:PROJECT_PATH_ROOT)) { + Write-Error "[ ERROR ] - Please run from automataCI\ci.sh.ps1 instead!`n" + return 1 +} + +. "${LIBS_AUTOMATACI}\services\hestiaCONSOLE\Vanilla.sh.ps1" +. "${LIBS_AUTOMATACI}\services\hestiaFS\Vanilla.sh.ps1" +. "${LIBS_AUTOMATACI}\services\hestiaKERNEL\Vanilla.sh.ps1" +. "${LIBS_AUTOMATACI}\services\hestiaPDF\Vanilla.sh.ps1" + + + + +function PACKAGE-Assemble-Default-Single-Content { + param ( + [string]$_target, + [string]$_directory, + [string]$_target_name, + [string]$_target_os, + [string]$_target_arch + ) + + + # determine destination path + if ($(hestiaPDF-Is-Target-Valid "${_target}") -eq ${env:hestiaKERNEL_ERROR_OK}) { + $__dest = "${_directory}\${env:PROJECT_SKU}_any-any.pdf" + if ($(hestiaFS-Is-Filename-Has "${_target}" "${env:PROJECT_RESEARCH_ID}") -eq ${env:hestiaKERNEL_ERROR_OK}) { + $__dest = "${_directory}\${env:PROJECT_SKU}-${env:PROJECT_RESEARCH_ID}_any-any.pdf" + } + } else { + return ${env:hestiaKERNEL_ERROR_CANCELLED} # not applicable + } + + + # assemble the file + $null = hestiaCONSOLE-Log-Assemble "${__dest}" "${_target}" + $___process = hestiaFS-Copy-File "${__dest}" "${_target}" + if ($___process -ne ${env:hestiaKERNEL_ERROR_OK}) { + $null = hestiaCONSOLE-Log-Assemble-Failed + return ${env:hestiaKERNEL_ERROR_BAD_EXEC} + } + + + # report status + return ${env:hestiaKERNEL_ERROR_OK} +} diff --git a/automataCI/_package-archive_unix-any.sh b/automataCI/_package-archive_unix-any.sh index 24a54b6..ad11bcf 100644 --- a/automataCI/_package-archive_unix-any.sh +++ b/automataCI/_package-archive_unix-any.sh @@ -10,11 +10,15 @@ # 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/io/os.sh" -. "${LIBS_AUTOMATACI}/services/io/fs.sh" -. "${LIBS_AUTOMATACI}/services/i18n/translations.sh" -. "${LIBS_AUTOMATACI}/services/archive/tar.sh" -. "${LIBS_AUTOMATACI}/services/archive/zip.sh" +. "${LIBS_AUTOMATACI}/services/hestiaCONSOLE/Vanilla.sh.ps1" +. "${LIBS_AUTOMATACI}/services/hestiaFS/Vanilla.sh.ps1" +. "${LIBS_AUTOMATACI}/services/hestiaKERNEL/Vanilla.sh.ps1" +. "${LIBS_AUTOMATACI}/services/hestiaNUPKG/Vanilla.sh.ps1" +. "${LIBS_AUTOMATACI}/services/hestiaNPM/Vanilla.sh.ps1" +. "${LIBS_AUTOMATACI}/services/hestiaOS/Vanilla.sh.ps1" +. "${LIBS_AUTOMATACI}/services/hestiaRUST/Vanilla.sh.ps1" +. "${LIBS_AUTOMATACI}/services/hestiaTAR/Vanilla.sh.ps1" +. "${LIBS_AUTOMATACI}/services/hestiaZIP/Vanilla.sh.ps1" @@ -35,7 +39,7 @@ PACKAGE_Run_ARCHIVE() { # parse input __line="$1" - _dest="${__line%%|*}" + _output_directory="${__line%%|*}" __line="${__line#*|}" _target="${__line%%|*}" @@ -52,89 +56,366 @@ PACKAGE_Run_ARCHIVE() { # validate input - I18N_Check_Availability "TAR" - TAR_Is_Available - if [ $? -ne 0 ]; then - I18N_Check_Failed - return 1 + hestiaCONSOLE_Log_Check_Availability "TAR" + if [ $(hestiaTAR_Is_Available) -ne $hestiaKERNEL_ERROR_OK ]; then + hestiaCONSOLE_Log_Check_Failed + return $hestiaKERNEL_ERROR_BAD_EXEC fi - I18N_Check_Availability "ZIP" - TAR_Is_Available - if [ $? -ne 0 ]; then - I18N_Check_Failed - return 1 + hestiaCONSOLE_Log_Check_Availability "ZIP" + if [ $(hestiaZIP_Is_Available) -ne $hestiaKERNEL_ERROR_OK ]; then + hestiaCONSOLE_Log_Check_Failed + return $hestiaKERNEL_ERROR_BAD_EXEC fi # prepare workspace and required values - I18N_Create_Package "ARCHIVE" - _src="${_target_filename}_${PROJECT_VERSION}_${_target_os}-${_target_arch}" - _target_path="${_dest}/${_src}" + __package_sku="$PROJECT_SKU" + if [ $(hestiaFS_Is_Filename_Has "$_target" "$PROJECT_DOCS_ID") -eq $hestiaKERNEL_ERROR_OK ]; then + __package_sku="${PROJECT_SKU}-${PROJECT_DOCS_ID}" + elif [ $(hestiaFS_Is_Filename_Has "$_target" "lib") -eq $hestiaKERNEL_ERROR_OK ]; then + __package_sku="lib${PROJECT_SKU}" + if [ $(hestiaNPM_Is_Target_Valid "$_target") -eq $hestiaKERNEL_ERROR_OK ]; then + # npm package + __package_sku="${PROJECT_SKU}-${PROJECT_NODE_NPM_ID}" + elif [ $(hestiaRUST_Is_Target_Valid "$_target") -eq $hestiaKERNEL_ERROR_OK ]; then + # rust crate package + __package_sku="${PROJECT_SKU}-${PROJECT_RUST_ID}" + elif [ $(hestiaFS_Is_Filename_Has "$_target" "$PROJECT_C_ID") -eq $hestiaKERNEL_ERROR_OK ]; then + # complied c package + __package_sku="lib${PROJECT_SKU}-${PROJECT_C_ID}" + fi + fi + + + # remake workspace + _src="${__package_sku}_${_target_os}-${_target_arch}" _src="${PROJECT_PATH_ROOT}/${PROJECT_PATH_TEMP}/packagers-archive-${_src}" - I18N_Remake "$_src" - FS_Remake_Directory "$_src" - if [ $? -ne 0 ]; then - I18N_Remake_Failed - return 1 + hestiaCONSOLE_Log_Recreate "$_src" + hestiaFS_Recreate_Directory "$_src" + if [ $? -ne $hestiaKERNEL_ERROR_OK ]; then + hestiaCONSOLE_Log_Recreate_Failed + return $hestiaKERNEL_ERROR_BAD_EXEC fi - # copy all complimentary files to the workspace + # assemble project specified files to the workspace + . "${PROJECT_PATH_ROOT}/${PROJECT_PATH_SOURCE}/${PROJECT_PATH_CI}/package-archive_unix-any.sh" + cmd="PACKAGE_Assemble_ARCHIVE_Content" - I18N_Check_Function "$cmd" - OS_Is_Command_Available "$cmd" - if [ $? -ne 0 ]; then - I18N_Check_Failed - return 1 + hestiaCONSOLE_Log_Check_Availability "$cmd" + if [ $(hestiaOS_Is_Command_Available "$cmd") -ne $hestiaKERNEL_ERROR_OK ]; then + hestiaCONSOLE_Log_Check_Failed + return $hestiaKERNEL_ERROR_BAD_EXEC fi - I18N_Assemble_Package + hestiaCONSOLE_Log_Run "$cmd" "$cmd" "$_target" "$_src" "$_target_filename" "$_target_os" "$_target_arch" case $? in - 10) - I18N_Assemble_Skipped - FS_Remove_Silently "$_src" - return 0 + $hestiaKERNEL_ERROR_CANCELLED) + hestiaCONSOLE_Log_Run_Skipped + return $hestiaKERNEL_ERROR_OK ;; - 0) + $hestiaKERNEL_ERROR_OK) ;; *) - I18N_Assemble_Failed - return 1 + hestiaCONSOLE_Log_Run_Failed + return $hestiaKERNEL_ERROR_BAD_EXEC ;; esac - # change location into the workspace - __current_path="$PWD" && cd "$_src" + # archive the assembled payload + __package="${__package_sku}_${PROJECT_VERSION}_${_target_os}-${_target_arch}" + + + # assemble project README file + __source="${PROJECT_PATH_ROOT}/${PROJECT_README}" + __dest="${_src}/${PROJECT_README}" + hestiaCONSOLE_Log_Assemble "$__dest" "$__source" + if [ $(hestiaFS_Is_File "$__dest") -ne $hestiaKERNEL_ERROR_OK ]; then + hestiaCONSOLE_Log_Assemble "$__dest" "$__source" + hestiaFS_Copy_File "$__dest" "$__source" + if [ $? -ne $hestiaKERNEL_ERROR_OK ]; then + hestiaCONSOLE_Log_Assemble_Failed + return $hestiaKERNEL_ERROR_BAD_EXEC + fi + fi - # archive the assembled payload - case "$_target_os" in - windows) - _target_path="${_target_path}.zip" - I18N_Package "$_target_path" - ZIP_Create "$_target_path" "." - ___process=$? - ;; - *) - _target_path="${_target_path}.tar.xz" - I18N_Package "$_target_path" - TAR_Create_XZ "$_target_path" "." - ___process=$? - ;; - esac + # assemble project LICENSE file + __source="${PROJECT_PATH_ROOT}/${PROJECT_LICENSE_FILE}" + __dest="${_src}/${PROJECT_LICENSE_FILE}" + if [ $(hestiaFS_Is_File "$__dest") -ne $hestiaKERNEL_ERROR_OK ]; then + hestiaCONSOLE_Log_Assemble "$__dest" "$__source" + hestiaFS_Copy_File "$__dest" "$__source" + if [ $? -ne $hestiaKERNEL_ERROR_OK ]; then + hestiaCONSOLE_Log_Assemble_Failed + return $hestiaKERNEL_ERROR_BAD_EXEC + fi + fi - # head back to current directory - cd "$__current_path" && unset __current_path + # package npm package when detected + if [ $(hestiaNPM_Is_Target_Valid "$_target") -eq $hestiaKERNEL_ERROR_OK ]; then + if [ $(hestiaSTRING_Is_Empty "$PROJECT_NODE_NPM_ID") -eq $hestiaKERNEL_ERROR_OK ]; then + return $hestiaKERNEL_ERROR_OK # disabled explicitly + fi + + # package npm.tgz + __dest="${__package_sku}-${PROJECT_NPM_ID}_${PROJECT_VERSION}" + __dest="${_output_directory}/${__dest}_${_target_os}-${_target_arch}.tgz" + hestiaCONSOLE_Log_Package "$__dest" + hestiaTAR_Pack "$__dest" "$_src" + if [ $? -ne $hestiaKERNEL_ERROR_OK ]; then + hestiaCONSOLE_Log_Package_Failed + return $hestiaKERNEL_ERROR_BAD_EXEC + fi + + # can't be packaged as something else - report status + return $hestiaKERNEL_ERROR_OK + fi - # report status - if [ $___process -ne 0 ]; then - return 1 + # package crate package when detected + if [ $(hestiaRUST_Is_Target_Valid "$_target") -eq $hestiaKERNEL_ERROR_OK ]; then + # package .crate + # TODO during Rust porting + + + # can't be packaged as something else - report status + return $hestiaKERNEL_ERROR_OK fi - return 0 + + # package coventional archive files + if [ $(hestiaSTRING_Is_Empty "$PROJECT_RELEASE_ARCHIVE") -ne $hestiaKERNEL_ERROR_OK ]; then + # package tar.xz + __dest="${_output_directory}/${__package}.tar.xz" + hestiaCONSOLE_Log_Package "$__dest" + hestiaTAR_Pack "$__dest" "$_src" + if [ $? -ne $hestiaKERNEL_ERROR_OK ]; then + hestiaCONSOLE_Log_Package_Failed + return $hestiaKERNEL_ERROR_BAD_EXEC + fi + + # package zip + __dest="${_output_directory}/${__package}.zip" + hestiaCONSOLE_Log_Package "$__dest" + hestiaZIP_Pack "$__dest" "$_src" + if [ $? -ne $hestiaKERNEL_ERROR_OK ]; then + hestiaCONSOLE_Log_Package_Failed + return $hestiaKERNEL_ERROR_BAD_EXEC + fi + fi + + + # package chocolatey nupkg + if ([ "$_target_os" = "any" ] || [ "$_target_os" = "windows" ]) && + [ $(hestiaSTRING_Is_Empty "$PROJECT_CHOCOLATEY_URL") -ne 0 ]; then + # create required tools/ directory + hestiaFS_Create_Directory "${_src}/tools" + + + # create required tools/ChocolateyBeforeModify.ps1 + __source="tools/ChocolateyBeforeModify.ps1" + __dest="${_src}/${__source}" + hestiaCONSOLE_Log_Create "$__dest" + if [ $(hestiaFS_Is_File "$__dest") -eq $hestiaKERNEL_ERROR_OK ]; then + hestiaCONSOLE_Log_Create_Failed + return $hestiaKERNEL_ERROR_BAD_EXEC + fi + + hestiaFS_Write_File "$__dest" "\ +# REQUIRED - BEGIN EXECUTION +Write-Host \"Performing pre-configurations...\" +" + if [ $? -ne $hestiaKERNEL_ERROR_OK ]; then + hestiaCONSOLE_Log_Create_Failed + return $hestiaKERNEL_ERROR_BAD_EXEC + fi + + __source="${PROJECT_PATH_ROOT}/${PROJECT_PATH_SOURCE}/data/chocolatey/${__source}" + if [ $(hestiaFS_Is_File "$__source") -eq $hestiaKERNEL_ERROR_OK ]; then + __old_IFS="$IFS" + while IFS= read -r __line || [ -n "$__line" ]; do + if [ $(hestiaSTRING_Has "$__line" "Done by AutomataCI") -eq $hestiaKERNEL_ERROR_OK ]; then + continue + fi + + hestiaFS_Append_File "$__dest" "${__line}\n" + if [ $? -ne $hestiaKERNEL_ERROR_OK ]; then + return $hestiaKERNEL_ERROR_BAD_EXEC + fi + done < "$__source" + IFS="$__old_IFS" && unset __old_IFS + fi + + + # create required tools/ChocolateyInstall.ps1 + __source="tools/ChocolateyInstall.ps1" + __dest="${_src}/${__source}" + hestiaCONSOLE_Log_Create "$__dest" + if [ $(hestiaFS_Is_File "$__dest") -eq $hestiaKERNEL_ERROR_OK ]; then + hestiaCONSOLE_Log_Create_Failed + return $hestiaKERNEL_ERROR_BAD_EXEC + fi + + hestiaFS_Write_File "$__dest" "\ +# REQUIRED - PREPARING INSTALLATION +Write-Host \"Installing ${__package_sku} (${PROJECT_VERSION})...\" +" + if [ $? -ne $hestiaKERNEL_ERROR_OK ]; then + hestiaCONSOLE_Log_Create_Failed + return $hestiaKERNEL_ERROR_BAD_EXEC + fi + + __source="${PROJECT_PATH_ROOT}/${PROJECT_PATH_SOURCE}/data/chocolatey/${__source}" + if [ $(hestiaFS_Is_File "$__source") -eq $hestiaKERNEL_ERROR_OK ]; then + __old_IFS="$IFS" + while IFS= read -r __line || [ -n "$__line" ]; do + if [ $(hestiaSTRING_Has "$__line" "Done by AutomataCI") -eq $hestiaKERNEL_ERROR_OK ]; then + continue + fi + + hestiaFS_Append_File "$__dest" "${__line}\n" + if [ $? -ne $hestiaKERNEL_ERROR_OK ]; then + return $hestiaKERNEL_ERROR_BAD_EXEC + fi + done < "$__source" + IFS="$__old_IFS" && unset __old_IFS + fi + + + # create required tools/ChocolateyUninstall.ps1 + __source="tools/ChocolateyUninstall.ps1" + __dest="${_src}/${__source}" + hestiaCONSOLE_Log_Create "$__dest" + if [ $(hestiaFS_Is_File "$__dest") -eq $hestiaKERNEL_ERROR_OK ]; then + hestiaCONSOLE_Log_Create_Failed + return $hestiaKERNEL_ERROR_BAD_EXEC + fi + + hestiaFS_Write_File "$__dest" "\ +# REQUIRED - PREPARING UNINSTALLATION +Write-Host \"Uninstalling ${__package_sku} (${PROJECT_VERSION})...\" +" + if [ $? -ne $hestiaKERNEL_ERROR_OK ]; then + hestiaCONSOLE_Log_Create_Failed + return $hestiaKERNEL_ERROR_BAD_EXEC + fi + + __source="${PROJECT_PATH_ROOT}/${PROJECT_PATH_SOURCE}/data/chocolatey/${__source}" + if [ $(hestiaFS_Is_File "$__source") -eq $hestiaKERNEL_ERROR_OK ]; then + __old_IFS="$IFS" + while IFS= read -r __line || [ -n "$__line" ]; do + if [ $(hestiaSTRING_Has "$__line" "Done by AutomataCI") -eq $hestiaKERNEL_ERROR_OK ]; then + continue + fi + + hestiaFS_Append_File "$__dest" "${__line}\n" + if [ $? -ne $hestiaKERNEL_ERROR_OK ]; then + return $hestiaKERNEL_ERROR_BAD_EXEC + fi + done < "$__source" + IFS="$__old_IFS" && unset __old_IFS + fi + + + # create chocolatey nuspec files + # IMPORTANT: 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_sku}-${_target_os}-${_target_arch}" + __id="${__id}-${PROJECT_CHOCOLATEY_ID}" + __title="${PROJECT_NAME} (${__package_sku} ${_target_os}-${_target_arch})" + + __dest="${__id}_${PROJECT_VERSION}_${_target_os}-${_target_arch}.nupkg" + __dest="${_output_directory}/${__dest}" + hestiaCONSOLE_Log_Package "$__dest" + hestiaNUPKG_Package \ + "$__dest" \ + "$_src" \ + "$__id" \ + "$PROJECT_VERSION" \ + "$PROJECT_PITCH" \ + "$PROJECT_CONTACT_NAME" \ + "$PROJECT_CONTACT_WEBSITE" \ + "$PROJECT_LICENSE_FILE" \ + "icon.png" \ + "$PROJECT_README" \ + "$PROJECT_LICENSE_ACCEPTANCE_REQUIRED" \ + "$PROJECT_SOURCE_URL" \ + "$__title" + if [ $? -ne $hestiaKERNEL_ERROR_OK ]; then + hestiaCONSOLE_Log_Package_Failed + return $hestiaKERNEL_ERROR_BAD_EXEC + fi + fi + + + # clean up chocolatey's artifacts + hestiaFS_Remove "${_src}/tools/ChocolateyBeforeModify.ps1" + hestiaFS_Remove "${_src}/tools/ChocolateyInstall.ps1" + hestiaFS_Remove "${_src}/tools/ChocolateyUninstall.ps1" + if [ "$(hestiaFS_Is_Directory_Empty "${_src}/tools")" -eq $hestiaKERNEL_ERROR_OK ]; then + hestiaFS_Remove "${_src}/tools" + fi + + for __nuspec in "${_src}/"*.nuspec; do + hestiaFS_Remove "${__nuspec}" + done + + + # package DOTNET nupkg + if [ $(hestiaSTRING_Is_Empty "$PROJECT_NUPKG_URL") -ne $hestiaKERNEL_ERROR_OK ]; then + # IMPORTANT: Nupkg specifically mentions the current practice + # is to use dot (.) namespacing as ID. 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_sku}.${_target_os}.${_target_arch}" + __title="${PROJECT_NAME} (${__package_sku} ${_target_os}-${_target_arch})" + + __dest="${__package}.nupkg" + __dest="${_output_directory}/${__dest}" + hestiaCONSOLE_Log_Package "$__dest" + hestiaNUPKG_Package \ + "$__dest" \ + "$_src" \ + "$__id" \ + "$PROJECT_VERSION" \ + "$PROJECT_PITCH" \ + "$PROJECT_CONTACT_NAME" \ + "$PROJECT_CONTACT_WEBSITE" \ + "$PROJECT_LICENSE_FILE" \ + "icon.png" \ + "$PROJECT_README" \ + "$PROJECT_LICENSE_ACCEPTANCE_REQUIRED" \ + "$PROJECT_SOURCE_URL" \ + "$__title" + if [ $? -ne $hestiaKERNEL_ERROR_OK ]; then + hestiaCONSOLE_Log_Package_Failed + return $hestiaKERNEL_ERROR_BAD_EXEC + fi + fi + + + # clean up from DOTNET nupkg + for __nuspec in "${_src}/"*.nuspec; do + hestiaFS_Remove "${__nuspec}" + done + + + # report status + return $hestiaKERNEL_ERROR_OK } diff --git a/automataCI/_package-archive_windows-any.ps1 b/automataCI/_package-archive_windows-any.ps1 index 49da491..4d67aae 100644 --- a/automataCI/_package-archive_windows-any.ps1 +++ b/automataCI/_package-archive_windows-any.ps1 @@ -1,132 +1,416 @@ +#!/bin/sh # Copyright 2023 (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 +# 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\io\os.ps1" -. "${env:LIBS_AUTOMATACI}\services\io\fs.ps1" -. "${env:LIBS_AUTOMATACI}\services\i18n\translations.ps1" -. "${env:LIBS_AUTOMATACI}\services\archive\tar.ps1" -. "${env:LIBS_AUTOMATACI}\services\archive\zip.ps1" +# License for the specific language governing permissions and limitations under +# the License. +. "${env:LIBS_AUTOMATACI}\services\hestiaCONSOLE\Vanilla.sh.ps1" +. "${env:LIBS_AUTOMATACI}\services\hestiaFS\Vanilla.sh.ps1" +. "${env:LIBS_AUTOMATACI}\services\hestiaKERNEL\Vanilla.sh.ps1" +. "${env:LIBS_AUTOMATACI}\services\hestiaNUPKG\Vanilla.sh.ps1" +. "${env:LIBS_AUTOMATACI}\services\hestiaNPM\Vanilla.sh.ps1" +. "${env:LIBS_AUTOMATACI}\services\hestiaOS\Vanilla.sh.ps1" +. "${env:LIBS_AUTOMATACI}\services\hestiaRUST\Vanilla.sh.ps1" +. "${env:LIBS_AUTOMATACI}\services\hestiaTAR\Vanilla.sh.ps1" +. "${env:LIBS_AUTOMATACI}\services\hestiaZIP\Vanilla.sh.ps1" # initialize if (-not (Test-Path -Path $env:PROJECT_PATH_ROOT)) { - Write-Error "[ ERROR ] - Please run from automataIC\ci.sh.ps1 instead!`n" - return + Write-Error "[ ERROR ] - Please run from automataIC\ci.sh.ps1 instead!`n" + return } function PACKAGE-Run-ARCHIVE { - param ( - [string]$__line - ) - - - # parse input - $__list = $__line -split "\|" - $_dest = $__list[0] - $_target = $__list[1] - $_target_filename = $__list[2] - $_target_os = $__list[3] - $_target_arch = $__list[4] - - - # validate input - $null = I18N-Check-Availability "TAR" - $___process = TAR-Is-Available - if ($___process -ne 0) { - $null = I18N-Check-Failed - return 1 - } - - $null = I18N-Check-Availability "ZIP" - $___process = ZIP-Is-Available - if ($___process -ne 0) { - $null = I18N-Check-Failed - return 1 - } - - - # prepare workspace and required values - $null = I18N-Create-Package "ARCHIVE" - $_src = "${_target_filename}_${env:PROJECT_VERSION}_${_target_os}-${_target_arch}" - $_target_path = "${_dest}\${_src}" - $_src = "${env:PROJECT_PATH_ROOT}\${env:PROJECT_PATH_TEMP}\packagers-archive-${_src}" - $null = I18N-Remake "${_src}" - $___process = FS-Remake-Directory "${_src}" - if ($___process -ne 0) { - $null = I18N-Remake-Failed - return 1 - } - - - # copy all complimentary files to the workspace - $cmd = "PACKAGE-Assemble-ARCHIVE-Content" - $null = I18N-Check-Function "$cmd" - $___process = OS-Is-Command-Available "$cmd" - if ($___process -ne 0) { - $null = I18N-Check-Failed - return 1 - } - - $null = I18N-Assemble-Package - $___process = PACKAGE-Assemble-ARCHIVE-Content ` - ${_target} ` - ${_src} ` - ${_target_filename} ` - ${_target_os} ` - ${_target_arch} - switch ($___process) { - 10 { - $null = I18N-Assemble-Skipped - $null = FS-Remove-Silently "${_src}" - return 0 - } 0 { - # accepted - } Default { - $null = I18N-Assemble-Failed - return 1 - }} - - - # change location into the workspace - $__current_path = Get-Location - $null = Set-Location -Path "${_src}" - - - # archive the assembled payload - switch ($_target_os) { - windows { - $_target_path = "${_target_path}.zip" - $null = I18N-Package "${_target_path}" - $___process = ZIP-Create "${_target_path}" "." - } Default { - $_target_path = "${_target_path}.tar.xz" - $null = I18N-Package "${_target_path}" - $___process = TAR-Create-XZ "${_target_path}" "." - }} - - - # head back to current directory - $null = Set-Location -Path "${__current_path}" - $null = Remove-Variable -Name __current_path - - - # report status - if ($___process -ne 0) { - return 1 - } - - return 0 + param ( + [string]$__line + ) + + + # parse input + $__list = $__line -split "\|" + $_output_directory = $__list[0] + $_target = $__list[1] + $_target_filename = $__list[2] + $_target_os = $__list[3] + $_target_arch = $__list[4] + + + # validate input + $null = hestiaCONSOLE-Log-Check-Availability "TAR" + if ($(hestiaTAR-Is-Available) -ne ${env:hestiaKERNEL_ERROR_OK}) { + $null = hestiaCONSOLE-Log-Check-Failed + return ${env:hestiaKERNEL_ERROR_BAD_EXEC} + } + + $null = hestiaCONSOLE-Log-Check-Availability "ZIP" + if ($(hestiaZIP-Is-Available) -ne ${env:hestiaKERNEL_ERROR_OK}) { + $null = hestiaCONSOLE-Log-Check-Failed + return ${env:hestiaKERNEL_ERROR_BAD_EXEC} + } + + + # prepare workspace and required values + $__package_sku = "${env:PROJECT_SKU}" + if ($(hestiaFS-Is-Filename-Has "${_target}" "${env:PROJECT_DOCS_ID}") -eq ${env:hestiaKERNEL_ERROR_OK}) { + $__package_sku = "${env:PROJECT_SKU}-${env:PROJECT_DOCS_ID}" + } elseif ($(hestiaFS-Is-Filename-Has "${_target}" "lib") -eq ${env:hestiaKERNEL_ERROR_OK}) { + $__package_sku = "lib${env:PROJECT_SKU}" + + if ($(hestiaNPM-Is-Target-Valid "${_target}") -eq ${env:hestiaKERNEL_ERROR_OK}) { + # npm package + $__package_sku = "${env:PROJECT_SKU}-${env:PROJECT_NODE_NPM_ID}" + } elseif ($(hestiaRUST-Is-Target-Valid "${_target}") -eq ${env:hestiaKERNEL_ERROR_OK}) { + # rust crate package + $__package_sku = "${env:PROJECT_SKU}-${env:PROJECT_RUST_ID}" + } elseif ($(hestiaFS-Is-Filename-Has "${_target}" "${env:PROJECT_C_ID}") -eq ${env:hestiaKERNEL_ERROR_OK}) { + # complied c package + $__package_sku = "lib${env:PROJECT_SKU}-${env:PROJECT_C_ID}" + } + } + + + # remake workspace + $_src = "${__package_sku}_${_target_os}-${_target_arch}" + $_src = "${env:PROJECT_PATH_ROOT}\${env:PROJECT_PATH_TEMP}\packagers-archive-${_src}" + $null = hestiaCONSOLE-Log-Recreate "${_src}" + $___process = hestiaFS-Recreate-Directory "${_src}" + if ($___process -ne ${env:hestiaKERNEL_ERROR_OK}) { + $null = hestiaCONSOLE-Log-Recreate-Failed + return ${env:hestiaKERNEL_ERROR_BAD_EXEC} + } + + + # assemble project specified files to the workspace + . "${env:PROJECT_PATH_ROOT}\${env:PROJECT_PATH_SOURCE}\${env:PROJECT_PATH_CI}\package-archive_windows-any.ps1" + + $cmd = "PACKAGE-Assemble-ARCHIVE-Content" + $null = hestiaCONSOLE-Log-Check-Availability "$cmd" + if ($(hestiaOS-Is-Command-Available "$cmd") -ne ${env:hestiaKERNEL_ERROR_OK}) { + $null = hestiaCONSOLE-Log-Check-Failed + return ${env:hestiaKERNEL_ERROR_BAD_EXEC} + } + + $null = hestiaCONSOLE-Log-Run "$cmd" + $___process = PACKAGE-Assemble-ARCHIVE-Content ` + "${_target}" ` + "${_src}" ` + "${_target_filename}" ` + "${_target_os}" ` + "${_target_arch}" + switch ($___process) { + "${env:hestiaKERNEL_ERROR_CANCELLED}" { + $null = hestiaCONSOLE-Log-Run-Skipped + return ${env:hestiaKERNEL_ERROR_OK} + } "${env:hestiaKERNEL_ERROR_OK}" { + # proceed further + } default { + $null = hestiaCONSOLE-Log-Run-Failed + return ${env:hestiaKERNEL_ERROR_BAD_EXEC} + }} + + + # archive the assembled payload + $__package = "${__package_sku}_${env:PROJECT_VERSION}_${_target_os}-${_target_arch}" + + + # assemble project README file + $__source = "${env:PROJECT_PATH_ROOT}\${env:PROJECT_README}" + $__dest = "${_src}\${env:PROJECT_README}" + if ($(hestiaFS-Is-File "${__dest}") -ne ${env:hestiaKERNEL_ERROR_OK}) { + $null = hestiaCONSOLE-Log-Assemble "${__dest}" "${__source}" + $___process = hestiaFS-Copy-File "${__dest}" "${__source}" + if ($___process -ne ${env:hestiaKERNEL_ERROR_OK}) { + $null = hestiaCONSOLE-Log-Assemble-Failed + return ${env:hestiaKERNEL_ERROR_BAD_EXEC} + } + } + + + # assemble project LICENSE file + $__source = "${env:PROJECT_PATH_ROOT}\${env:PROJECT_LICENSE_FILE}" + $__dest = "${_src}\${env:PROJECT_LICENSE_FILE}" + if ($(hestiaFS-Is-File "${__dest}") -ne ${env:hestiaKERNEL_ERROR_OK}) { + $null = hestiaCONSOLE-Log-Assemble "${__dest}" "${__source}" + $___process = hestiaFS-Copy-File "${__dest}" "${__source}" + if ($___process -ne ${env:hestiaKERNEL_ERROR_OK}) { + $null = hestiaCONSOLE-Log-Assemble-Failed + return ${env:hestiaKERNEL_ERROR_BAD_EXEC} + } + } + + + # package npm package when detected + if ($(hestiaNPM-Is-Target-Valid "${_target}") -eq ${env:hestiaKERNEL_ERROR_OK}) { + if ($(hestiaSTRING-Is-Empty "${env:PROJECT_NODE_NPM_ID}") -eq ${env:hestiaKERNEL_ERROR_OK}) { + return ${env:hestiaKERNEL_ERROR_OK} # disabled explictly + } + + # package npm.tgz + $__dest = "${__package_sku}-${env:PROJECT_NPM_ID}_${env:PROJECT_VERSION}" + $__dest = "${_output_directory}\${__dest}_${_target_os}-${_target_arch}.tgz" + $null = hestiaCONSOLE-Log-Package "${__dest}" + $___process = hestiaTAR-Pack "${__dest}" "${_src}" + if ($___process -ne ${env:hestiaKERNEL_ERROR_OK}) { + $null = hestiaCONSOLE-Log-Package-Failed + return ${env:hestiaKERNEL_ERROR_BAD_EXEC} + } + + # can't be packaged as something else - report status + return ${env:hestiaKERNEL_ERROR_OK} + } + + + # package crate package when detected + if ($(hestiaRUST-Is-Target-Valid "${_target}") -eq ${env:hestiaKERNEL_ERROR_OK}) { + # package .crate + # TODO during Rust porting + + + # can't be packaged as something else - report status + return ${env:hestiaKERNEL_ERROR_OK} + } + + + # package coventional archive files + if ($(hestiaSTRING-Is-Empty "${env:PROJECT_RELEASE_ARCHIVE}") -ne ${env:hestiaKERNEL_ERROR_OK}) { + # package tar.xz + $__dest = "${_output_directory}\${__package}.tar.xz" + $null = hestiaCONSOLE-Log-Package "${__dest}" + $___process = hestiaTAR-Pack "${__dest}" "${_src}" + if ($___process -ne ${env:hestiaKERNEL_ERROR_OK}) { + $null = hestiaCONSOLE-Log-Package-Failed + return ${env:hestiaKERNEL_ERROR_BAD_EXEC} + } + + # package zip + $__dest = "${_output_directory}\${__package}.zip" + $null = hestiaCONSOLE-Log-Package "${__dest}" + $___process = hestiaZIP-Pack "${__dest}" "${_src}" + if ($___process -ne ${env:hestiaKERNEL_ERROR_OK}) { + $null = hestiaCONSOLE-Log-Package-Failed + return ${env:hestiaKERNEL_ERROR_BAD_EXEC} + } + } + + + # package chocolatey nupkg + if ( + (($_target_os -eq "any") -or ($_target_os -eq "windows")) -and + ($(hestiaSTRING-Is-Empty "${env:PROJECT_CHOCOLATEY_URL}") -ne ${env:hestiaKERNEL_ERROR_OK}) + ) { + # create required tools\ directory + $null = hestiaFS-Create-Directory "${_src}\tools" + + + # create required tools\ChocolateyBeforeModify.ps1 + $__source = "tools\ChocolateyBeforeModify.ps1" + $__dest = "${_src}\${__source}" + $null = hestiaCONSOLE-Log-Create "${__dest}" + if ($(hestiaFS-Is-File "${__dest}") -eq ${env:hestiaKERNEL_ERROR_OK}) { + $null = hestiaCONSOLE-Log-Create-Failed + return ${env:hestiaKERNEL_ERROR_BAD_EXEC} + } + + $___process = hestiaFS-Write-File "${__dest}" @" +# REQUIRED - BEGIN EXECUTION +Write-Host "Performing pre-configurations..." + +"@ + if ($___process -ne ${env:hestiaKERNEL_ERROR_OK}) { + $null = hestiaCONSOLE-Log-Create-Failed + return ${env:hestiaKERNEL_ERROR_BAD_EXEC} + } + + $__source = "${env:PROJECT_PATH_ROOT}\${env:PROJECT_PATH_SOURCE}\data\chocolatey\${__source}" + if ($(hestiaFS-Is-File "${__source}") -eq ${env:hestiaKERNEL_ERROR_OK}) { + foreach ($__line in (Get-Content -Path "${__source}")) { + if ($(hestiaSTRING-Has "${__line}" "Done by AutomataCI") -eq ${env:hestiaKERNEL_ERROR_OK}) { + continue + } + + $___process = hestiaFS-Append-File "${__dest}" "${__line}`n" + if ($___process -ne ${env:hestiaKERNEL_ERROR_OK}) { + return ${env:hestiaKERNEL_ERROR_BAD_EXEC} + } + }} + + + # create required tools\ChocolateyInstall.ps1 + $__source = "tools\ChocolateyInstall.ps1" + $__dest = "${_src}\${__source}" + $null = hestiaCONSOLE-Log-Create "${__dest}" + if ($(hestiaFS-Is-File "${__dest}") -eq ${env:hestiaKERNEL_ERROR_OK}) { + $null = hestiaCONSOLE-Log-Create-Failed + return ${env:hestiaKERNEL_ERROR_BAD_EXEC} + } + + $___process = hestiaFS-Write-File "${__dest}" @" +# REQUIRED - PREPARING INSTALLATION +Write-Host "Installing ${__package_sku} (${env:PROJECT_VERSION})..." + +"@ + if ($___process -ne ${env:hestiaKERNEL_ERROR_OK}) { + $null = hestiaCONSOLE-Log-Create-Failed + return ${env:hestiaKERNEL_ERROR_BAD_EXEC} + } + + $__source = "${env:PROJECT_PATH_ROOT}\${env:PROJECT_PATH_SOURCE}\data\chocolatey\${__source}" + if ($(hestiaFS-Is-File "${__source}") -eq ${env:hestiaKERNEL_ERROR_OK}) { + foreach ($__line in (Get-Content -Path "${__source}")) { + if ($(hestiaSTRING-Has "${__line}" "Done by AutomataCI") -eq ${env:hestiaKERNEL_ERROR_OK}) { + continue + } + + $___process = hestiaFS-Append-File "${__dest}" "${__line}`n" + if ($___process -ne ${env:hestiaKERNEL_ERROR_OK}) { + return ${env:hestiaKERNEL_ERROR_BAD_EXEC} + } + }} + + + # create required tools\ChocolateyUninstall.ps1 + $__source = "tools\ChocolateyUninstall.ps1" + $__dest = "${_src}\${__source}" + $null = hestiaCONSOLE-Log-Create "${__dest}" + if ($(hestiaFS-Is-File "${__dest}") -eq ${env:hestiaKERNEL_ERROR_OK}) { + $null = hestiaCONSOLE-Log-Create-Failed + return ${env:hestiaKERNEL_ERROR_BAD_EXEC} + } + + $___process = hestiaFS-Write-File "${__dest}" @" +# REQUIRED - PREPARING UNINSTALLATION +Write-Host "Uninstalling ${__package_sku} (${env:PROJECT_VERSION})..." + +"@ + if ($___process -ne ${env:hestiaKERNEL_ERROR_OK}) { + $null = hestiaCONSOLE-Log-Create-Failed + return ${env:hestiaKERNEL_ERROR_BAD_EXEC} + } + + $__source = "${env:PROJECT_PATH_ROOT}\${env:PROJECT_PATH_SOURCE}\data\chocolatey\${__source}" + if ($(hestiaFS-Is-File "${__source}") -eq ${env:hestiaKERNEL_ERROR_OK}) { + foreach ($__line in (Get-Content -Path "${__source}")) { + if ($(hestiaSTRING-Has "${__line}" "Done by AutomataCI") -eq ${env:hestiaKERNEL_ERROR_OK}) { + continue + } + + $___process = hestiaFS-Append-File "${__dest}" "${__line}`n" + if ($___process -ne ${env:hestiaKERNEL_ERROR_OK}) { + return ${env:hestiaKERNEL_ERROR_BAD_EXEC} + } + }} + + + # create chocolatey nuspec files + # IMPORTANT: 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_sku}-${_target_os}-${_target_arch}" + $__id = "${__id}-${env:PROJECT_CHOCOLATEY_ID}" + $__title = "${env:PROJECT_NAME} (${__package_sku} ${_target_os}-${_target_arch})" + + $__dest = "${__id}_${env:PROJECT_VERSION}_${_target_os}-${_target_arch}.nupkg" + $__dest = "${_output_directory}\${__dest}" + $null = hestiaCONSOLE-Log-Package "${__dest}" + $___process = hestiaNUPKG-Package ` + "${__dest}" ` + "${_src}" ` + "${__id}" ` + "${env:PROJECT_VERSION}" ` + "${env:PROJECT_PITCH}" ` + "${env:PROJECT_CONTACT_NAME}" ` + "${env:PROJECT_CONTACT_WEBSITE}" ` + "${env:PROJECT_LICENSE_FILE}" ` + "icon.png" ` + "${env:PROJECT_README}" ` + "${env:PROJECT_LICENSE_ACCEPTANCE_REQUIRED}" ` + "${env:PROJECT_SOURCE_URL}" ` + "${__title}" + if ($___process -ne ${env:hestiaKERNEL_ERROR_OK}) { + $null = hestiaCONSOLE-Log-Package-Failed + return ${env:hestiaKERNEL_ERROR_BAD_EXEC} + } + } + + + # clean up chocolatey's artifacts + $null = hestiaFS-Remove "${_src}\tools\ChocolateyBeforeModify.ps1" + $null = hestiaFS-Remove "${_src}\tools\ChocolateyInstall.ps1" + $null = hestiaFS-Remove "${_src}\tools\ChocolateyUninstall.ps1" + if ("$(hestiaFS-Is-Directory-Empty "${_src}\tools")" -eq ${env:hestiaKERNEL_ERROR_OK}) { + $null = hestiaFS-Remove "${_src}\tools" + } + + foreach ($__nuspec in (Get-ChildItem -Path "${_src}" ` + | Where-Object { $_.Name -like "*.nuspec" } + )) { + $null = hestiaFS-Remove $__nuspec.FullPath + } + + + # package DOTNET nupkg + if ($(hestiaSTRING-Is-Empty "${env:PROJECT_NUPKG_URL}") -ne ${env:hestiaKERNEL_ERROR_OK}) { + # IMPORTANT: Nupkg specifically mentions the current practice + # is to use dot (.) namespacing as ID. 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_sku}.${_target_os}.${_target_arch}" + $__title = "${env:PROJECT_NAME} (${__package_sku} ${_target_os}-${_target_arch})" + + $__dest = "${__package}.nupkg" + $__dest = "${_output_directory}/${__dest}" + $null = hestiaCONSOLE-Log-Package "${__dest}" + $___process = hestiaNUPKG-Package ` + "${__dest}" ` + "${_src}" ` + "${__id}" ` + "${env:PROJECT_VERSION}" ` + "${env:PROJECT_PITCH}" ` + "${env:PROJECT_CONTACT_NAME}" ` + "${env:PROJECT_CONTACT_WEBSITE}" ` + "${env:PROJECT_LICENSE_FILE}" ` + "icon.png" ` + "${env:PROJECT_README}" ` + "${env:PROJECT_LICENSE_ACCEPTANCE_REQUIRED}" ` + "${env:PROJECT_SOURCE_URL}" ` + "${__title}" + if ($___process -ne ${env:hestiaKERNEL_ERROR_OK}) { + $null = hestiaCONSOLE-Log-Package-Failed + return ${env:hestiaKERNEL_ERROR_BAD_EXEC} + } + } + + + # clean up from DOTNET nupkg + foreach ($__nuspec in (Get-ChildItem -Path "${_src}" ` + | Where-Object { $_.Name -like "*.nuspec" } + )) { + $null = hestiaFS-Remove $__nuspec.FullPath + } + + + # report status + return ${env:hestiaKERNEL_ERROR_OK} } diff --git a/automataCI/_package-cargo_unix-any.sh b/automataCI/_package-cargo_unix-any.sh deleted file mode 100644 index de9fd79..0000000 --- a/automataCI/_package-cargo_unix-any.sh +++ /dev/null @@ -1,125 +0,0 @@ -#!/bin/sh -# Copyright 2023 (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/io/os.sh" -. "${LIBS_AUTOMATACI}/services/io/fs.sh" -. "${LIBS_AUTOMATACI}/services/i18n/translations.sh" -. "${LIBS_AUTOMATACI}/services/compilers/rust.sh" - - - - -# initialize -if [ "$PROJECT_PATH_ROOT" = "" ]; then - >&2 printf "[ ERROR ] - Please run me from automataCI/ci.sh.ps1 instead!\n" - return 1 -fi - - - - -PACKAGE_Run_CARGO() { - #__line="$1" - - - # parse input - __line="$1" - - _dest="${__line%%|*}" - __line="${__line#*|}" - - _target="${__line%%|*}" - __line="${__line#*|}" - - _target_filename="${__line%%|*}" - __line="${__line#*|}" - - _target_os="${__line%%|*}" - __line="${__line#*|}" - - _target_arch="${__line%%|*}" - __line="${__line#*|}" - - - # validate input - if [ $(STRINGS_Is_Empty "$PROJECT_RUST") -eq 0 ]; then - return 0 - fi - - I18N_Check_Availability "RUST" - RUST_Activate_Local_Environment - RUST_Is_Available - if [ $? -ne 0 ]; then - I18N_Check_Failed - return 0 - fi - - - # prepare workspace and required values - I18N_Create_Package "RUST" - _src="${_target_filename}_${PROJECT_VERSION}_${_target_os}-${_target_arch}" - _target_path="${_dest}/cargo_${_src}" - _src="${PROJECT_PATH_ROOT}/${PROJECT_PATH_TEMP}/packagers-cargo-${_src}" - I18N_Remake "$_src" - FS_Remake_Directory "$_src" - if [ $? -ne 0 ]; then - I18N_Remake_Failed - return 1 - fi - - I18N_Check "$_target_path" - FS_Is_Directory "$_target_path" - if [ $? -eq 0 ]; then - I18N_Check_Failed - return 1 - fi - - - # copy all complimentary files to the workspace - cmd="PACKAGE_Assemble_CARGO_Content" - I18N_Check_Function "$cmd" - OS_Is_Command_Available "$cmd" - if [ $? -ne 0 ]; then - I18N_Check_Failed - return 1 - fi - - I18N_Assemble_Package - "$cmd" "$_target" "$_src" "$_target_filename" "$_target_os" "$_target_arch" - case $? in - 10) - I18N_Assemble_Skipped - FS_Remove_Silently "$_src" - return 0 - ;; - 0) - ;; - *) - I18N_Assemble_Failed - return 1 - ;; - esac - - - # archive the assembled payload - I18N_Package "$_target_path" - FS_Make_Directory "$_target_path" - RUST_Create_Archive "$_src" "$_target_path" - if [ $? -ne 0 ]; then - I18N_Package_Failed - return 1 - fi - - - # report status - return 0 -} diff --git a/automataCI/_package-cargo_windows-any.ps1 b/automataCI/_package-cargo_windows-any.ps1 deleted file mode 100644 index f1c74e5..0000000 --- a/automataCI/_package-cargo_windows-any.ps1 +++ /dev/null @@ -1,116 +0,0 @@ -# Copyright 2023 (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\io\os.ps1" -. "${env:LIBS_AUTOMATACI}\services\io\fs.ps1" -. "${env:LIBS_AUTOMATACI}\services\i18n\translations.ps1" -. "${env:LIBS_AUTOMATACI}\services\compilers\rust.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 PACKAGE-Run-CARGO { - param ( - [string]$__line - ) - - - # parse input - $__list = $__line -split "\|" - $_dest = $__list[0] - $_target = $__list[1] - $_target_filename = $__list[2] - $_target_os = $__list[3] - $_target_arch = $__list[4] - - - # validate input - if ($(STRINGS-Is-Empty "${env:PROJECT_RUST}") -eq 0) { - return 0 - } - - $null = I18N-Check-Availability "RUST" - $null = RUST-Activate-Local-Environment - $___process = RUST-Is-Available - if ($___process -ne 0) { - $null = I18N-Check-Failed - return 0 - } - - - # prepare workspace and required values - $null = I18N-Create-Package "RUST" - $_src = "${_target_filename}_${env:PROJECT_VERSION}_${_target_os}-${_target_arch}" - $_target_path = "${_dest}\cargo_${_src}" - $_src = "${env:PROJECT_PATH_ROOT}\${env:PROJECT_PATH_TEMP}\packagers-cargo-${_src}" - $null = I18N-Remake "${_src}" - $___process = FS-Remake-Directory "${_src}" - if ($___process -ne 0) { - $null = I18N-Remake-Failed - return 1 - } - - $null = I18N-Check "${_target_path}" - $___process = FS-Is-Directory "${_target_path}" - if ($___process -eq 0) { - $null = I18N-Check-Failed - return 1 - } - - - # copy all complimentary files to the workspace - $cmd = "PACKAGE-Assemble-CARGO-Content" - $null = I18N-Check-Function "${cmd}" - $___process = OS-Is-Command-Available "${cmd}" - if ($___process -ne 0) { - $null = I18N-Check-Failed - return 1 - } - - $null = I18N-Assemble-Package - $___process = PACKAGE-Assemble-CARGO-Content ` - ${_target} ` - ${_src} ` - ${_target_filename} ` - ${_target_os} ` - ${_target_arch} - if ($___process -eq 10) { - $null = I18N-Assemble-Skipped - $null = FS-Remove-Silently "${_src}" - return 0 - } elseif ($___process -ne 0) { - $null = I18N-Assemble-Failed - return 1 - } - - - # archive the assembled payload - $null = I18N-Package "${_target_path}" - $null = FS-Make-Directory "${_target_path}" - $___process = RUST-Create-Archive "${_src}" "${_target_path}" - if ($___process -ne 0) { - $null = I18N-Package-Failed - return 1 - } - - - # report status - return 0 -} diff --git a/automataCI/_package-changelog_unix-any.sh b/automataCI/_package-changelog_unix-any.sh deleted file mode 100644 index 0e8131b..0000000 --- a/automataCI/_package-changelog_unix-any.sh +++ /dev/null @@ -1,89 +0,0 @@ -#!/bin/sh -# Copyright 2023 (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/io/os.sh" -. "${LIBS_AUTOMATACI}/services/io/fs.sh" -. "${LIBS_AUTOMATACI}/services/i18n/translations.sh" -. "${LIBS_AUTOMATACI}/services/compilers/changelog.sh" - - - - -# initialize -if [ "$PROJECT_PATH_ROOT" = "" ]; then - >&2 printf "[ ERROR ] - Please run me from automataCI/ci.sh.ps1 instead!\n" - return 1 -fi - - - - -PACKAGE_Run_CHANGELOG() { - __changelog_md="$1" - __changelog_deb="$2" - - - I18N_Check_Availability "CHANGELOG" - CHANGELOG_Is_Available - if [ $? -ne 0 ]; then - I18N_Check_Failed - return 1 - fi - - - # validate input - I18N_Validate "${PROJECT_VERSION} CHANGELOG" - CHANGELOG_Compatible_DATA_Version \ - "${PROJECT_PATH_ROOT}/${PROJECT_PATH_SOURCE}/changelog" \ - "$PROJECT_VERSION" - if [ $? -ne 0 ]; then - I18N_Validate_Failed - return 1 - fi - - I18N_Validate "${PROJECT_VERSION} DEB CHANGELOG" - CHANGELOG_Compatible_DEB_Version \ - "${PROJECT_PATH_ROOT}/${PROJECT_PATH_SOURCE}/changelog" \ - "$PROJECT_VERSION" - if [ $? -ne 0 ]; then - I18N_Validate_Failed - return 1 - fi - - - # assemble changelog - I18N_Create "$__changelog_md" - CHANGELOG_Assemble_MD \ - "${PROJECT_PATH_ROOT}/${PROJECT_PATH_SOURCE}/changelog" \ - "$__changelog_md" \ - "$PROJECT_VERSION" \ - "$PROJECT_CHANGELOG_TITLE" - if [ $? -ne 0 ]; then - I18N_Create_Failed - return 1 - fi - - I18N_Create "$__changelog_deb" - FS_Make_Directory "${__changelog_deb%/*}" - CHANGELOG_Assemble_DEB \ - "${PROJECT_PATH_ROOT}/${PROJECT_PATH_SOURCE}/changelog" \ - "$__changelog_deb" \ - "$PROJECT_VERSION" - if [ $? -ne 0 ]; then - I18N_Create_Failed - return 1 - fi - - - # report status - return 0 -} diff --git a/automataCI/_package-changelog_windows-any.ps1 b/automataCI/_package-changelog_windows-any.ps1 deleted file mode 100644 index 5e3048e..0000000 --- a/automataCI/_package-changelog_windows-any.ps1 +++ /dev/null @@ -1,90 +0,0 @@ -# Copyright 2023 (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\io\os.ps1" -. "${env:LIBS_AUTOMATACI}\services\io\fs.ps1" -. "${env:LIBS_AUTOMATACI}\services\i18n\translations.ps1" -. "${env:LIBS_AUTOMATACI}\services\compilers\changelog.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 PACKAGE-Run-CHANGELOG { - param ( - [string]$__changelog_md, - [string]$__changelog_deb - ) - - - $null = I18N-Check-Availability "CHANGELOG" - $___process = CHANGELOG-Is-Available - if ($___process -ne 0) { - $null = I18N-Check-Failed - return 1 - } - - - # validate input - $null = I18N-Validate "${env:PROJECT_VERSION} CHANGELOG" - $___process = CHANGELOG-Compatible-DATA-Version ` - "${env:PROJECT_PATH_ROOT}\${env:PROJECT_PATH_SOURCE}\changelog" ` - "${env:PROJECT_VERSION}" - if ($___process -ne 0) { - $null = I18N-Validate-Failed - return 1 - } - - $null = I18N-Validate "${env:PROJECT_VERSION} DEB CHANGELOG" - $___process = CHANGELOG-Compatible-DEB-Version ` - "${env:PROJECT_PATH_ROOT}\${env:PROJECT_PATH_SOURCE}\changelog" ` - "${env:PROJECT_VERSION}" - if ($___process -ne 0) { - $null = I18N-Validate-Failed - return 1 - } - - - # assemble changelog - $null = I18N-Create "${__changelog_md}" - $___process = CHANGELOG-Assemble-MD ` - "${env:PROJECT_PATH_ROOT}\${env:PROJECT_PATH_SOURCE}\changelog" ` - "${__changelog_md}" ` - "${env:PROJECT_VERSION}" ` - "${env:PROJECT_CHANGELOG_TITLE}" - if ($___process -ne 0) { - $null = I18N-Create-Failed - return 1 - } - - $null = I18N-Create "${__changelog_deb}" - $null = FS-Make-Housing-Directory "${__changelog_deb}" - $___process = CHANGELOG-Assemble-DEB ` - "${env:PROJECT_PATH_ROOT}\${env:PROJECT_PATH_SOURCE}\changelog" ` - "${__changelog_deb}" ` - "${env:PROJECT_VERSION}" - if ($___process -ne 0) { - $null = I18N-Create-Failed - return 1 - } - - - # report status - return 0 -} diff --git a/automataCI/_package-chocolatey_unix-any.sh b/automataCI/_package-chocolatey_unix-any.sh deleted file mode 100644 index 87d0639..0000000 --- a/automataCI/_package-chocolatey_unix-any.sh +++ /dev/null @@ -1,151 +0,0 @@ -#!/bin/sh -# Copyright 2023 (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/io/os.sh" -. "${LIBS_AUTOMATACI}/services/io/fs.sh" -. "${LIBS_AUTOMATACI}/services/io/strings.sh" -. "${LIBS_AUTOMATACI}/services/i18n/translations.sh" -. "${LIBS_AUTOMATACI}/services/publishers/chocolatey.sh" - - - - -# initialize -if [ "$PROJECT_PATH_ROOT" = "" ]; then - >&2 printf "[ ERROR ] - Please run me from automataCI/ci.sh.ps1 instead!\n" - return 1 -fi - - - - -PACKAGE_Run_CHOCOLATEY() { - #__line="$1" - - - # parse input - __line="$1" - - _dest="${__line%%|*}" - __line="${__line#*|}" - - _target="${__line%%|*}" - __line="${__line#*|}" - - _target_filename="${__line%%|*}" - __line="${__line#*|}" - - _target_os="${__line%%|*}" - __line="${__line#*|}" - - _target_arch="${__line%%|*}" - __line="${__line#*|}" - - - # validate input - I18N_Check_Availability "ZIP" - ZIP_Is_Available - if [ $? -ne 0 ]; then - I18N_Check_Failed - return 1 - fi - - - # prepare workspace and required values - I18N_Create_Package "CHOCOLATEY" - _src="${_target_filename}_${PROJECT_VERSION}_${_target_os}-${_target_arch}" - _target_path="${_dest}/${_src}" - _src="${PROJECT_PATH_ROOT}/${PROJECT_PATH_TEMP}/packagers-choco-${_src}" - I18N_Remake "$_src" - FS_Remake_Directory "$_src" - if [ $? -ne 0 ]; then - I18N_Remake_Failed - return 1 - fi - - - # copy all complimentary files to the workspace - cmd="PACKAGE_Assemble_CHOCOLATEY_Content" - I18N_Check_Function "$cmd" - OS_Is_Command_Available "$cmd" - if [ $? -ne 0 ]; then - I18N_Check_Failed - return 1 - fi - - I18N_Assemble_Package - "$cmd" "$_target" "$_src" "$_target_filename" "$_target_os" "$_target_arch" - case $? in - 10) - I18N_Assemble_Skipped - FS_Remove_Silently "$_src" - return 0 - ;; - 0) - ;; - *) - I18N_Assemble_Failed - return 1 - ;; - esac - - - # 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*}" - fi - done - - if [ $(STRINGS_Is_Empty "$__name") -eq 0 ]; then - I18N_Check_Failed - return 1 - fi - - - # archive the assembled payload - __name="${__name}-chocolatey_${PROJECT_VERSION}_${_target_os}-${_target_arch}.nupkg" - __name="${_dest}/${__name}" - I18N_Archive "$__name" - CHOCOLATEY_Archive "$__name" "$_src" - if [ $? -ne 0 ]; then - I18N_Archive_Failed - return 1 - fi - - - # test the package - I18N_Test "$__name" - CHOCOLATEY_Is_Available - if [ $? -eq 0 ]; then - CHOCOLATEY_Test "$__name" - if [ $? -ne 0 ]; then - I18N_Test_Failed - return 1 - fi - else - I18N_Test_Skipped - fi - - - # report status - return 0 -} diff --git a/automataCI/_package-chocolatey_windows-any.ps1 b/automataCI/_package-chocolatey_windows-any.ps1 deleted file mode 100644 index 7b158d9..0000000 --- a/automataCI/_package-chocolatey_windows-any.ps1 +++ /dev/null @@ -1,141 +0,0 @@ -# Copyright 2023 (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\io\os.ps1" -. "${env:LIBS_AUTOMATACI}\services\io\fs.ps1" -. "${env:LIBS_AUTOMATACI}\services\io\strings.ps1" -. "${env:LIBS_AUTOMATACI}\services\i18n\translations.ps1" -. "${env:LIBS_AUTOMATACI}\services\publishers\chocolatey.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 PACKAGE-Run-CHOCOLATEY { - param ( - [string]$__line - ) - - - # parse input - $__list = $__line -split "\|" - $_dest = $__list[0] - $_target = $__list[1] - $_target_filename = $__list[2] - $_target_os = $__list[3] - $_target_arch = $__list[4] - - - # validate input - $null = I18N-Check-Availability "ZIP" - $___process = ZIP-Is-Available - if ($___process -ne 0) { - $null = I18N-Check-Failed - return 1 - } - - - # prepare workspace and required values - $null = I18N-Create-Package "CHOCOLATEY" - $_src = "${_target_filename}_${env:PROJECT_VERSION}_${_target_os}-${_target_arch}" - $_target_path = "${_dest}\${_src}" - $_src = "${env:PROJECT_PATH_ROOT}\${env:PROJECT_PATH_TEMP}\packagers-choco-${_src}" - $null = I18N-Remake "${_src}" - $___process = FS-Remake-Directory "${_src}" - if ($___process -ne 0) { - $null = I18N-Remake-Failed - return 1 - } - - - # copy all complimentary files to the workspace - $cmd = "PACKAGE-Assemble-CHOCOLATEY-Content" - $null = I18N-Check-Function "${cmd}" - $___process = OS-Is-Command-Available "PACKAGE-Assemble-CHOCOLATEY-Content" - if ($___process -ne 0) { - $null = I18N-Check-Failed - return 1 - } - - $null = I18N-Assemble-Package - $___process = PACKAGE-Assemble-CHOCOLATEY-Content ` - "${_target}" ` - "${_src}" ` - "${_target_filename}" ` - "${_target_os}" ` - "${_target_arch}" - switch ($___process) { - 10 { - $null = I18N-Assemble-Skipped - $null = FS-Remove-Silently "${_src}" - return 0 - } 0 { - # accepted - } Default { - $null = I18N-Assemble-Failed - return 1 - }} - - - # check nuspec is available - $null = I18N-Check ".nuspec metadata" - $__name = "" - foreach ($__file in (Get-ChildItem -File -Path "${_src}\*.nuspec")) { - if ($(STRINGS-Is-Empty "${__name}") -ne 0) { - $null = I18N-Check-Failed - return 1 - } - - $__name = $__file.Name -replace '\.nuspec.*$', '' - } - - if ($(STRINGS-Is-Empty "${__name}") -eq 0) { - $null = I18N-Check-Failed - return 1 - } - - - # archive the assembled payload - $__name = "${__name}-chocolatey_${env:PROJECT_VERSION}_${_target_os}-${_target_arch}.nupkg" - $__name = "${_dest}\${__name}" - $null = I18N-Archive "${__name}" - $___process = CHOCOLATEY-Archive "${__name}" "${_src}" - if ($___process -ne 0) { - $null = I18N-Archive-Failed - return 1 - } - - - # test the package - $null = I18N-Test "${__name}" - $___process = CHOCOLATEY-Is-Available - if ($___process -eq 0) { - $___process = CHOCOLATEY-Test "${__name}" - if ($___process -ne 0) { - $null = I18N-Test-Failed - return 1 - } - } else { - $null = I18N-Test-Skipped - } - - - # report status - return 0 -} diff --git a/automataCI/_package-citation_unix-any.sh b/automataCI/_package-citation_unix-any.sh deleted file mode 100644 index 54bb8c4..0000000 --- a/automataCI/_package-citation_unix-any.sh +++ /dev/null @@ -1,60 +0,0 @@ -#!/bin/sh -# Copyright 2023 (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/io/fs.sh" -. "${LIBS_AUTOMATACI}/services/io/time.sh" -. "${LIBS_AUTOMATACI}/services/i18n/translations.sh" -. "${LIBS_AUTOMATACI}/services/compilers/citation.sh" - - - - -# initialize -if [ "$PROJECT_PATH_ROOT" = "" ]; then - >&2 printf "[ ERROR ] - Please run me from automataCI/ci.sh.ps1 instead!\n" - return 1 -fi - - - - -PACKAGE_Run_CITATION() { - __citation_cff="$1" - - - # assemble citation - I18N_Create "$__citation_cff" - CITATION_Build \ - "$__citation_cff" \ - "${PROJECT_PATH_ROOT}/${PROJECT_PATH_SOURCE}/docs/ABSTRACTS.txt" \ - "${PROJECT_PATH_ROOT}/${PROJECT_PATH_SOURCE}/docs/CITATIONS.yml" \ - "$PROJECT_CITATION" \ - "$PROJECT_CITATION_TYPE" \ - "$(TIME_Format_Date_ISO8601 "$(TIME_Now)")" \ - "$PROJECT_NAME" \ - "$PROJECT_VERSION" \ - "$PROJECT_LICENSE" \ - "$PROJECT_SOURCE_URL" \ - "$PROJECT_SOURCE_URL" \ - "$PROJECT_STATIC_URL" \ - "$PROJECT_CONTACT_NAME" \ - "$PROJECT_CONTACT_WEBSITE" \ - "$PROJECT_CONTACT_EMAIL" - if [ $? -ne 0 ]; then - I18N_Create_Failed - return 1 - fi - - - # report status - return 0 -} diff --git a/automataCI/_package-citation_windows-any.ps1 b/automataCI/_package-citation_windows-any.ps1 deleted file mode 100644 index 232d02c..0000000 --- a/automataCI/_package-citation_windows-any.ps1 +++ /dev/null @@ -1,60 +0,0 @@ -# Copyright 2023 (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\io\fs.ps1" -. "${env:LIBS_AUTOMATACI}\services\io\time.ps1" -. "${env:LIBS_AUTOMATACI}\services\i18n\translations.ps1" -. "${env:LIBS_AUTOMATACI}\services\compilers\citation.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 PACKAGE-Run-CITATION { - param( - [string]$__citation_cff - ) - - # execute - $null = I18N-Create "${__citation_cff}" - $___process = CITATION-Build ` - "${__citation_cff}" ` - "${env:PROJECT_PATH_ROOT}\${env:PROJECT_PATH_SOURCE}\docs\ABSTRACTS.txt" ` - "${env:PROJECT_PATH_ROOT}\${env:PROJECT_PATH_SOURCE}\docs\CITATIONS.yml" ` - "${env:PROJECT_CITATION}" ` - "${env:PROJECT_CITATION_TYPE}" ` - "$(TIME-Format-Date-ISO8601 "$(TIME-Now)")" ` - "${env:PROJECT_NAME}" ` - "${env:PROJECT_VERSION}" ` - "${env:PROJECT_LICENSE}" ` - "${env:PROJECT_SOURCE_URL}" ` - "${env:PROJECT_SOURCE_URL}" ` - "${env:PROJECT_STATIC_URL}" ` - "${env:PROJECT_CONTACT_NAME}" ` - "${env:PROJECT_CONTACT_WEBSITE}" ` - "${env:PROJECT_CONTACT_EMAIL}" - if ($___process -ne 0) { - $null = I18N-Create-Failed - return 1 - } - - - # report status - return 0 -} diff --git a/automataCI/_package-lib_unix-any.sh b/automataCI/_package-lib_unix-any.sh deleted file mode 100644 index c9b6cbb..0000000 --- a/automataCI/_package-lib_unix-any.sh +++ /dev/null @@ -1,80 +0,0 @@ -#!/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/io/os.sh" -. "${LIBS_AUTOMATACI}/services/io/fs.sh" -. "${LIBS_AUTOMATACI}/services/i18n/translations.sh" - - - - -# initialize -if [ "$PROJECT_PATH_ROOT" = "" ]; then - >&2 printf "[ ERROR ] - Please run me from automataCI/ci.sh.ps1 instead!\n" - return 1 -fi - - - - -PACKAGE_Run_LIB() { - #__line="$1" - - - # parse input - __line="$1" - - _dest="${__line%%|*}" - __line="${__line#*|}" - - _target="${__line%%|*}" - __line="${__line#*|}" - - _target_filename="${__line%%|*}" - __line="${__line#*|}" - - _target_os="${__line%%|*}" - __line="${__line#*|}" - - _target_arch="${__line%%|*}" - __line="${__line#*|}" - - - # copy all complimentary files to the workspace - cmd="PACKAGE_Assemble_LIB_Content" - I18N_Check_Function "$cmd" - OS_Is_Command_Available "$cmd" - if [ $? -ne 0 ]; then - I18N_Check_Failed - return 1 - fi - - I18N_Assemble_Package - "$cmd" "$_target" "$_dest" "$_target_filename" "$_target_os" "$_target_arch" - case $? in - 10) - I18N_Assemble_Skipped - return 0 - ;; - 0) - # accepted - ;; - *) - I18N_Assemble_Failed - return 1 - ;; - esac - - - # report status - return 0 -} diff --git a/automataCI/_package-lib_windows-any.ps1 b/automataCI/_package-lib_windows-any.ps1 deleted file mode 100644 index f784801..0000000 --- a/automataCI/_package-lib_windows-any.ps1 +++ /dev/null @@ -1,73 +0,0 @@ -# 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\io\os.ps1" -. "${env:LIBS_AUTOMATACI}\services\io\fs.ps1" -. "${env:LIBS_AUTOMATACI}\services\i18n\translations.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 PACKAGE-Run-LIB { - param ( - [string]$__line - ) - - - # parse input - $__list = $__line -split "\|" - $_dest = $__list[0] - $_target = $__list[1] - $_target_filename = $__list[2] - $_target_os = $__list[3] - $_target_arch = $__list[4] - - - # copy all complimentary files to the workspace - $cmd = "PACKAGE-Assemble-LIB-Content" - $null = I18N-Check-Function "$cmd" - $___process = OS-Is-Command-Available "$cmd" - if ($___process -ne 0) { - $null = I18N-Check-Failed - return 1 - } - - $null = I18N-Assemble-Package - $___process = PACKAGE-Assemble-LIB-Content ` - "${_target}" ` - "${_dest}" ` - "${_target_filename}" ` - "${_target_os}" ` - "${_target_arch}" - switch ($___process) { - 10 { - $null = I18N-Assemble-Skipped - return 0 - } 0 { - # accepted - } Default { - $null = I18N-Assemble-Failed - return 1 - }} - - - # report status - return 0 -} diff --git a/automataCI/_package-pdf_unix-any.sh b/automataCI/_package-pdf_unix-any.sh deleted file mode 100644 index 6f486b7..0000000 --- a/automataCI/_package-pdf_unix-any.sh +++ /dev/null @@ -1,80 +0,0 @@ -#!/bin/sh -# Copyright 2023 (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/io/os.sh" -. "${LIBS_AUTOMATACI}/services/io/fs.sh" -. "${LIBS_AUTOMATACI}/services/i18n/translations.sh" - - - - -# initialize -if [ "$PROJECT_PATH_ROOT" = "" ]; then - >&2 printf "[ ERROR ] - Please run me from automataCI/ci.sh.ps1 instead!\n" - return 1 -fi - - - - -PACKAGE_Run_PDF() { - #__line="$1" - - - # parse input - __line="$1" - - _dest="${__line%%|*}" - __line="${__line#*|}" - - _target="${__line%%|*}" - __line="${__line#*|}" - - _target_filename="${__line%%|*}" - __line="${__line#*|}" - - _target_os="${__line%%|*}" - __line="${__line#*|}" - - _target_arch="${__line%%|*}" - __line="${__line#*|}" - - - # copy all complimentary files to the workspace - cmd="PACKAGE_Assemble_PDF_Content" - I18N_Check_Function "$cmd" - OS_Is_Command_Available "$cmd" - if [ $? -ne 0 ]; then - I18N_Check_Failed - return 1 - fi - - I18N_Assemble_Package - "$cmd" "$_target" "$_dest" "$_target_filename" "$_target_os" "$_target_arch" - case $? in - 10) - I18N_Assemble_Skipped - return 0 - ;; - 0) - # accepted - ;; - *) - I18N_Assemble_Failed - return 1 - ;; - esac - - - # report status - return 0 -} diff --git a/automataCI/_package-pdf_windows-any.ps1 b/automataCI/_package-pdf_windows-any.ps1 deleted file mode 100644 index fd78da0..0000000 --- a/automataCI/_package-pdf_windows-any.ps1 +++ /dev/null @@ -1,73 +0,0 @@ -# Copyright 2023 (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\io\os.ps1" -. "${env:LIBS_AUTOMATACI}\services\io\fs.ps1" -. "${env:LIBS_AUTOMATACI}\services\i18n\translations.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 PACKAGE-Run-PDF { - param ( - [string]$__line - ) - - - # parse input - $__list = $__line -split "\|" - $_dest = $__list[0] - $_target = $__list[1] - $_target_filename = $__list[2] - $_target_os = $__list[3] - $_target_arch = $__list[4] - - - # copy all complimentary files to the workspace - $cmd = "PACKAGE-Assemble-PDF-Content" - $null = I18N-Check-Function "$cmd" - $___process = OS-Is-Command-Available "$cmd" - if ($___process -ne 0) { - $null = I18N-Check-Failed - return 1 - } - - $null = I18N-Assemble-Package - $___process = PACKAGE-Assemble-PDF-Content ` - "${_target}" ` - "${_dest}" ` - "${_target_filename}" ` - "${_target_os}" ` - "${_target_arch}" - switch ($___process) { - 10 { - $null = I18N-Assemble-Skipped - return 0 - } 0 { - # accepted - } Default { - $null = I18N-Assemble-Failed - return 1 - }} - - - # report status - return 0 -} diff --git a/automataCI/_package-pypi_unix-any.sh b/automataCI/_package-pypi_unix-any.sh deleted file mode 100644 index 7399772..0000000 --- a/automataCI/_package-pypi_unix-any.sh +++ /dev/null @@ -1,164 +0,0 @@ -#!/bin/sh -# Copyright 2023 (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/io/os.sh" -. "${LIBS_AUTOMATACI}/services/io/fs.sh" -. "${LIBS_AUTOMATACI}/services/io/strings.sh" -. "${LIBS_AUTOMATACI}/services/i18n/translations.sh" -. "${LIBS_AUTOMATACI}/services/compilers/python.sh" - - - - - -# initialize -if [ "$PROJECT_PATH_ROOT" = "" ]; then - >&2 printf "[ ERROR ] - Please run me from automataCI/ci.sh.ps1 instead!\n" - return 1 -fi - - - - -PACKAGE_Run_PYPI() { - #__line="$1" - - - # parse input - __line="$1" - - _dest="${__line%%|*}" - __line="${__line#*|}" - - _target="${__line%%|*}" - __line="${__line#*|}" - - _target_filename="${__line%%|*}" - __line="${__line#*|}" - - _target_os="${__line%%|*}" - __line="${__line#*|}" - - _target_arch="${__line%%|*}" - __line="${__line#*|}" - - - # validate input - if [ $(FS_Is_Target_A_PYPI "$_target") -ne 0 ]; then - return 0 - fi - - if [ $(STRINGS_Is_Empty "$PROJECT_PYTHON") -eq 0 ]; then - return 0 - fi - - I18N_Check_Availability "PYTHON" - PYTHON_Activate_VENV - if [ $? -ne 0 ]; then - I18N_Check_Failed - return 1 - fi - - I18N_Check_Availability "PYPI" - PYTHON_PYPI_Is_Available - if [ $? -ne 0 ]; then - I18N_Check_Failed - return 1 - fi - - - # prepare workspace and required values - I18N_Create "PYPI" - _src="${_target_filename}_${PROJECT_VERSION}_${_target_os}-${_target_arch}" - _target_path="${_dest}/pypi_${_src}" - _src="${PROJECT_PATH_ROOT}/${PROJECT_PATH_TEMP}/packagers-pypi-${_src}" - I18N_Remake "$_src" - FS_Remake_Directory "$_src" - if [ $? -ne 0 ]; then - I18N_Remake_Failed - return 1 - fi - - I18N_Check "$_target_path" - FS_Is_Directory "$_target_path" - if [ $? -eq 0 ]; then - I18N_Check_Failed - return 1 - fi - - - # copy all complimentary files to the workspace - cmd="PACKAGE_Assemble_PYPI_Content" - I18N_Check_Function "$cmd" - OS_Is_Command_Available "$cmd" - if [ $? -ne 0 ]; then - I18N_Check_Failed - return 1 - fi - - I18N_Assemble_Package - "$cmd" "$_target" "$_src" "$_target_filename" "$_target_os" "$_target_arch" - case $? in - 10) - I18N_Assemble_Skipped - FS_Remove_Silently "$_src" - return 0 - ;; - 0) - # accepted - ;; - *) - I18N_Assemble_Failed - return 1 - ;; - esac - - - # generate required files - I18N_Create "pyproject.toml" - PYTHON_Create_PYPI_Config \ - "$_src" \ - "$PROJECT_NAME" \ - "$PROJECT_VERSION" \ - "$PROJECT_CONTACT_NAME" \ - "$PROJECT_CONTACT_EMAIL" \ - "$PROJECT_CONTACT_WEBSITE" \ - "$PROJECT_PITCH" \ - "$PROJECT_PYPI_README" \ - "$PROJECT_PYPI_README_MIME" \ - "$PROJECT_LICENSE" - case $? in - 2) - I18N_Injection_Manual_Detected - ;; - 0) - ;; - *) - I18N_Create_Failed - return 1 - ;; - esac - - - # archive the assembled payload - I18N_Package "$_target_path" - FS_Make_Directory "$_target_path" - PYTHON_Create_PYPI_Archive "$_src" "$_target_path" - if [ $? -ne 0 ]; then - I18N_Package_Failed - return 1 - fi - - - # report status - return 0 -} diff --git a/automataCI/_package-pypi_windows-any.ps1 b/automataCI/_package-pypi_windows-any.ps1 deleted file mode 100644 index 62ee7b5..0000000 --- a/automataCI/_package-pypi_windows-any.ps1 +++ /dev/null @@ -1,155 +0,0 @@ -# Copyright 2023 (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\io\os.ps1" -. "${env:LIBS_AUTOMATACI}\services\io\fs.ps1" -. "${env:LIBS_AUTOMATACI}\services\io\strings.ps1" -. "${env:LIBS_AUTOMATACI}\services\i18n\translations.ps1" -. "${env:LIBS_AUTOMATACI}\services\compilers\python.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 PACKAGE-Run-PYPI { - param ( - [string]$__line - ) - - - # parse input - $__list = $__line -split "\|" - $_dest = $__list[0] - $_target = $__list[1] - $_target_filename = $__list[2] - $_target_os = $__list[3] - $_target_arch = $__list[4] - - - # validate input - if ($(FS-Is-Target-A-PYPI "${_target}") -ne 0) { - return 0 - } - - if ($(STRINGS-Is-Empty "${env:PROJECT_PYTHON}") -eq 0) { - return 0 - } - - $null = I18N-Check-Availability "PYTHON" - $___process = PYTHON-Activate-VENV - if ($___process -ne 0) { - $null = I18N-Check-Failed - return 1 - } - - $null = I18N-Check-Availability "PYPI" - $___process = PYTHON-PYPI-Is-Available - if ($___process -ne 0) { - $null = I18N-Check-Failed - return 1 - } - - - # prepare workspace and required values - $null = I18N-Create "PYPI" - $_src = "${_target_filename}_${env:PROJECT_VERSION}_${_target_os}-${_target_arch}" - $_target_path = "${_dest}\pypi_${_src}" - $_src = "${env:PROJECT_PATH_ROOT}\${env:PROJECT_PATH_TEMP}\packagers-pypi-${_src}" - $null = I18N-Remake "${_src}" - $___process = FS-Remake-Directory "${_src}" - if ($___process -ne 0) { - $null = I18N-Remake-Failed - return 1 - } - - - $null = I18N-Check "${_target_path}" - $___process = FS-Is-Directory "${_target_path}" - if ($___process -eq 0) { - $null = I18N-Check-Failed - return 1 - } - - - # copy all complimentary files to the workspace - $cmd = "PACKAGE-Assemble-PYPI-Content" - $null = I18N-Check-Function "$cmd" - $___process = OS-Is-Command-Available "$cmd" - if ($___process -ne 0) { - $null = I18N-Check-Failed - return 1 - } - - $null = I18N-Assemble-Package - $___process = PACKAGE-Assemble-PYPI-Content ` - ${_target} ` - ${_src} ` - ${_target_filename} ` - ${_target_os} ` - ${_target_arch} - switch ($___process) { - 10 { - $null = I18N-Assemble-Skipped - $null = FS-Remove-Silently "${_src}" - return 0 - } 0 { - # accepted - } default { - $null = I18N-Assemble-Failed - return 1 - }} - - - # generate required files - $null = I18N-Create "${_src}\pyproject.toml" - $___process = PYTHON-Create-PYPI-Config ` - "${_src}" ` - "${env:PROJECT_NAME}" ` - "${env:PROJECT_VERSION}" ` - "${env:PROJECT_CONTACT_NAME}" ` - "${env:PROJECT_CONTACT_EMAIL}" ` - "${env:PROJECT_CONTACT_WEBSITE}" ` - "${env:PROJECT_PITCH}" ` - "${env:PROJECT_PYPI_README}" ` - "${env:PROJECT_PYPI_README_MIME}" ` - "${env:PROJECT_LICENSE}" - switch ($___process) { - 2 { - $null = I18N-Injection-Manual-Detected - } 0 { - # accepted - } default { - $null = I18N-Create-Failed - return 1 - }} - - - # archive the assembled payload - $null = I18N-Package "${_target_path}" - $null = FS-Make-Directory "${_target_path}" - $___process = PYTHON-Create-PYPI-Archive "${_src}" "${_target_path}" - if ($___process -ne 0) { - $null = I18N-Package-Failed - return 1 - } - - - # report status - return 0 -} diff --git a/automataCI/_package-single_unix-any.sh b/automataCI/_package-single_unix-any.sh new file mode 100644 index 0000000..4b45649 --- /dev/null +++ b/automataCI/_package-single_unix-any.sh @@ -0,0 +1,75 @@ +#!/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/hestiaCONSOLE/Vanilla.sh.ps1" +. "${LIBS_AUTOMATACI}/services/hestiaFS/Vanilla.sh.ps1" +. "${LIBS_AUTOMATACI}/services/hestiaOS/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 + + + + +PACKAGE_SINGLE() { + #__filename="$1" + #__target="$2" + #__target_os="$3" + #__target_arch="$4" + #__package_time="$5" + #__directory_output="$6" + #__arguments="$7" + + + # import external assembly function + __cmd="PACKAGE_Assemble_Single_Content" + hestiaCONSOLE_Log_Check_Availability "$__cmd" + + __file_assembly="${PROJECT_PATH_ROOT}/${PROJECT_PATH_SOURCE}/${PROJECT_PATH_CI}/package-single_unix-any.sh" + if [ $(hestiaFS_Is_File "$__file_assembly") -ne $hestiaKERNEL_ERROR_OK ]; then + hestiaCONSOLE_Log_Run_Failed + return $hestiaKERNEL_ERROR_BAD_EXEC + fi + . "$__file_assembly" + + if [ $(hestiaOS_Is_Command_Available "$__cmd") -ne $hestiaKERNEL_ERROR_OK ]; then + hestiaCONSOLE_Log_Check_Failed + return $hestiaKERNEL_ERROR_BAD_EXEC + fi + + + # execute assembly function + hestiaCONSOLE_Log_Run "$cmd" + "$__cmd" "$2" "$6" "$1" "$3" "$4" + case $? in + $hestiaKERNEL_ERROR_CANCELLED) + hestiaCONSOLE_Log_Run_Skipped + return $hestiaKERNEL_ERROR_OK + ;; + $hestiaKERNEL_ERROR_OK) + ;; + *) + hestiaCONSOLE_Log_Run_Failed + return $hestiaKERNEL_ERROR_BAD_EXEC + ;; + esac + + + # report status + return $hestiaKERNEL_ERROR_OK +} diff --git a/automataCI/_package-single_windows-any.ps1 b/automataCI/_package-single_windows-any.ps1 new file mode 100644 index 0000000..aba90b9 --- /dev/null +++ b/automataCI/_package-single_windows-any.ps1 @@ -0,0 +1,80 @@ +#!/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. +. "${env:LIBS_AUTOMATACI}\services\hestiaCONSOLE\Vanilla.sh.ps1" +. "${env:LIBS_AUTOMATACI}\services\hestiaFS\Vanilla.sh.ps1" +. "${env:LIBS_AUTOMATACI}\services\hestiaOS\Vanilla.sh.ps1" + + + + +# initialize +if (-not (Test-Path -Path $env:PROJECT_PATH_ROOT)) { + Write-Error "[ ERROR ] - Please run from automataCI\ci.sh.ps1 instead!`n" + return 1 +} + + + + +function PACKAGE-SINGLE { + param ( + [string]$__filename, + [string]$__target, + [string]$__target_os, + [string]$__target_arch, + [string]$__package_time, + [string]$__directory_output, + [string]$__arguments + ) + + + # import external assembly function + $__cmd = "PACKAGE-Assemble-Single-Content" + $null = hestiaCONSOLE-Log-Check-Availability "${__cmd}" + + $__file_assembly = "${env:PROJECT_PATH_CI}/package-single_windows-any.ps1" + $__file_assembly = "${env:PROJECT_PATH_ROOT}/${env:PROJECT_PATH_SOURCE}/${__file_assembly}" + if ($(hestiaFS-Is-File "${__file_assembly}") -ne ${env:hestiaKERNEL_ERROR_OK}) { + $null = hestiaCONSOLE-Log-Run-Failed + return ${env:hestiaKERNEL_ERROR_BAD_EXEC} + } + $null = . "${__file_assembly}" + + if ($(hestiaOS-Is-Command-Available "${__cmd}") -ne ${env:hestiaKERNEL_ERROR_OK}) { + $null = hestiaCONSOLE-Log-Check-Failed + return ${env:hestiaKERNEL_ERROR_BAD_EXEC} + } + + + # execute assembly function + $null = hestiaCONSOLE-Log-Run "$cmd" + $___process = PACKAGE-Assemble-Single-Content "${__target}" ` + "${__directory_output}" ` + "${__filename}" ` + "${__target_os}" ` + "${__target_arch}" + switch ($___process) { + ${env:hestiaKERNEL_ERROR_CANCELLED} { + $null = hestiaCONSOLE-Log-Run-Skipped + return ${env:hestiaKERNEL_ERROR_OK} + } ${env:hestiaKERNEL_ERROR_OK} { + # accepted + } default { + $null = hestiaCONSOLE-Log-Run-Failed + return ${env:hestiaKERNEL_ERROR_BAD_EXEC} + }} + + + # report status + return ${env:hestiaKERNEL_ERROR_OK} +} diff --git a/automataCI/_package-sourcing_unix-any.sh b/automataCI/_package-sourcing_unix-any.sh deleted file mode 100644 index ed4ee7b..0000000 --- a/automataCI/_package-sourcing_unix-any.sh +++ /dev/null @@ -1,70 +0,0 @@ -#!/bin/sh -# Copyright 2023 (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/io/fs.sh" -. "${LIBS_AUTOMATACI}/services/io/strings.sh" -. "${LIBS_AUTOMATACI}/services/i18n/translations.sh" - - - - -# initialize -if [ "$PROJECT_PATH_ROOT" = "" ]; then - >&2 printf "[ ERROR ] - Please run me from automataCI/ci.sh.ps1 instead!\n" - return 1 -fi - - - - -# source from baseline -tech_list="\ -${PROJECT_PATH_SOURCE:-none} -${PROJECT_ANGULAR:-none} -${PROJECT_C:-none} -${PROJECT_GO:-none} -${PROJECT_NIM:-none} -${PROJECT_PYTHON:-none} -${PROJECT_RESEARCH:-none} -${PROJECT_RUST:-none} -" - -old_IFS="$IFS" -while IFS="" read -r tech || [ -n "$tech" ]; do - # validate input - if [ $(STRINGS_Is_Empty "$tech") -eq 0 ] || - [ "$(STRINGS_To_Uppercase "$tech")" = "NONE" ]; then - continue - fi - - - # execute - package_fx="${PROJECT_PATH_ROOT}/${tech}/${PROJECT_PATH_CI}/package_unix-any.sh" - FS_Is_File "$package_fx" - if [ $? -eq 0 ]; then - I18N_Source "$package_fx" - . "$package_fx" - if [ $? -ne 0 ]; then - I18N_Source_Failed - return 1 - fi - fi -done < -# -# 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\io\fs.ps1" -. "${env:LIBS_AUTOMATACI}\services\io\strings.ps1" -. "${env:LIBS_AUTOMATACI}\services\i18n\translations.ps1" - - - - -# initialize -if (-not (Test-Path -Path $env:PROJECT_PATH_ROOT)) { - Write-Error "[ ERROR ] - Please run from automataCI\ci.sh.ps1 instead!`n" - return -} - - - - -# execute -## IMPORTANT NOTE: -## (1) Appearently, PowerShell disallowed globally scoped dot import inside -## a function. Hence, we don't have a choice but to do repetition. -if ($(STRINGS-Is-Empty "${env:PROJECT_PATH_SOURCE}") -ne 0) { - $package_fx = "${env:PROJECT_PATH_ROOT}\${env:PROJECT_PATH_SOURCE}" - $package_fx = "${package_fx}\${env:PROJECT_PATH_CI}\package_windows-any.ps1" - if ($(FS-Is-File "$package_fx") -eq 0) { - $null = I18N-Source "${package_fx}" - - $___process = . $package_fx - if ($___process -ne 0) { - $null = I18N-Source-Failed - return 1 - } - } -} - -if ($(STRINGS-Is-Empty "${env:PROJECT_ANGULAR}") -ne 0) { - $package_fx = "${env:PROJECT_PATH_ROOT}\${env:PROJECT_ANGULAR}" - $package_fx = "${package_fx}\${env:PROJECT_PATH_CI}\package_windows-any.ps1" - if ($(FS-Is-File "$package_fx") -eq 0) { - $null = I18N-Source "${package_fx}" - - $___process = . $package_fx - if ($___process -ne 0) { - $null = I18N-Source-Failed - return 1 - } - } -} - -if ($(STRINGS-Is-Empty "${env:PROJECT_C}") -ne 0) { - $package_fx = "${env:PROJECT_PATH_ROOT}\${env:PROJECT_C}" - $package_fx = "${package_fx}\${env:PROJECT_PATH_CI}\package_windows-any.ps1" - if ($(FS-Is-File "$package_fx") -eq 0) { - $null = I18N-Source "${package_fx}" - - $___process = . $package_fx - if ($___process -ne 0) { - $null = I18N-Source-Failed - return 1 - } - } -} - -if ($(STRINGS-Is-Empty "${env:PROJECT_GO}") -ne 0) { - $package_fx = "${env:PROJECT_PATH_ROOT}\${env:PROJECT_GO}" - $package_fx = "${package_fx}\${env:PROJECT_PATH_CI}\package_windows-any.ps1" - if ($(FS-Is-File "$package_fx") -eq 0) { - $null = I18N-Source "${package_fx}" - - $___process = . $package_fx - if ($___process -ne 0) { - $null = I18N-Source-Failed - return 1 - } - } -} - -if ($(STRINGS-Is-Empty "${env:PROJECT_NIM}") -ne 0) { - $package_fx = "${env:PROJECT_PATH_ROOT}\${env:PROJECT_NIM}" - $package_fx = "${package_fx}\${env:PROJECT_PATH_CI}\package_windows-any.ps1" - if ($(FS-Is-File "$package_fx") -eq 0) { - $null = I18N-Source "${package_fx}" - - $___process = . $package_fx - if ($___process -ne 0) { - $null = I18N-Source-Failed - return 1 - } - } -} - -if ($(STRINGS-Is-Empty "${env:PROJECT_PYTHON}") -ne 0) { - $package_fx = "${env:PROJECT_PATH_ROOT}\${env:PROJECT_PYTHON}" - $package_fx = "${package_fx}\${env:PROJECT_PATH_CI}\package_windows-any.ps1" - if ($(FS-Is-File "$package_fx") -eq 0) { - $null = I18N-Source "${package_fx}" - - $___process = . $package_fx - if ($___process -ne 0) { - $null = I18N-Source-Failed - return 1 - } - } -} - -if ($(STRINGS-Is-Empty "${env:PROJECT_RESEARCH}") -ne 0) { - $package_fx = "${env:PROJECT_PATH_ROOT}\${env:PROJECT_RESEARCH}" - $package_fx = "${package_fx}\${env:PROJECT_PATH_CI}\package_windows-any.ps1" - if ($(FS-Is-File "$package_fx") -eq 0) { - $null = I18N-Source "${package_fx}" - - $___process = . $package_fx - if ($___process -ne 0) { - $null = I18N-Source-Failed - return 1 - } - } -} - -if ($(STRINGS-Is-Empty "${env:PROJECT_RUST}") -ne 0) { - $package_fx = "${env:PROJECT_PATH_ROOT}\${env:PROJECT_RUST}" - $package_fx = "${package_fx}\${env:PROJECT_PATH_CI}\package_windows-any.ps1" - if ($(FS-Is-File "$package_fx") -eq 0) { - $null = I18N-Source "${package_fx}" - - $___process = . $package_fx - if ($___process -ne 0) { - $null = I18N-Source-Failed - return 1 - } - } -} diff --git a/automataCI/_release-checksum_unix-any.sh b/automataCI/_release-checksum_unix-any.sh index 2229127..d6ab287 100644 --- a/automataCI/_release-checksum_unix-any.sh +++ b/automataCI/_release-checksum_unix-any.sh @@ -69,6 +69,10 @@ RELEASE_Conclude_CHECKSUM() { # gpg sign all packages for TARGET in "$1"/*; do + if [ ! -e "$TARGET" ]; then + continue # last entry is gibbrish from shell + fi + if [ ! "${TARGET%%.asc*}" = "$TARGET" ]; then continue # it's a gpg cert fi @@ -95,6 +99,10 @@ RELEASE_Conclude_CHECKSUM() { # shasum all files for TARGET in "$1"/*; do + if [ ! -e "$TARGET" ]; then + continue # last entry is gibbrish from shell + fi + FS_Is_Directory "$TARGET" if [ $? -eq 0 ]; then I18N_Is_Directory_Skipped "$TARGET" 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..25f91e0 --- /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.sh.ps1" +. "${env:LIBS_AUTOMATACI}\services\hestiaCONSOLE\Vanilla.sh.ps1" +. "${env:LIBS_AUTOMATACI}\services\hestiaKERNEL\Vanilla.sh.ps1" +. "${env:LIBS_AUTOMATACI}\services\hestiaNUPKG\Vanilla.sh.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..35a7e8e 100644 --- a/automataCI/_release-research_unix-any.sh +++ b/automataCI/_release-research_unix-any.sh @@ -35,7 +35,7 @@ RELEASE_Run_RESEARCH() { return 0 fi - if [ "${1##*${PROJECT_RESEARCH_IDENTIFIER}}" = "$1" ]; then + if [ "${1##*${PROJECT_RESEARCH_ID}}" = "$1" ]; then return 0 # not a research paper fi @@ -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..33e92e2 100644 --- a/automataCI/_release-research_windows-any.ps1 +++ b/automataCI/_release-research_windows-any.ps1 @@ -37,7 +37,7 @@ function RELEASE-Run-RESEARCH { return 0 } - if ($($__target -replace "^.*${env:PROJECT_RESEARCH_IDENTIFIER}") -eq "${__target}") { + if ($($__target -replace "^.*${env:PROJECT_RESEARCH_ID}") -eq "${__target}") { return 0 # not a research paper } @@ -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/package_unix-any.sh b/automataCI/package_unix-any.sh index 25b7382..4ff3f09 100644 --- a/automataCI/package_unix-any.sh +++ b/automataCI/package_unix-any.sh @@ -20,209 +20,315 @@ if [ "$PROJECT_PATH_ROOT" = "" ]; then return 1 fi -. "${LIBS_AUTOMATACI}/services/io/fs.sh" -. "${LIBS_AUTOMATACI}/services/io/strings.sh" -. "${LIBS_AUTOMATACI}/services/io/sync.sh" -. "${LIBS_AUTOMATACI}/services/i18n/translations.sh" -. "${LIBS_AUTOMATACI}/services/compilers/flatpak.sh" -. "${LIBS_AUTOMATACI}/services/publishers/homebrew.sh" -. "${LIBS_AUTOMATACI}/services/versioners/git.sh" -. "${LIBS_AUTOMATACI}/_package-archive_unix-any.sh" -. "${LIBS_AUTOMATACI}/_package-cargo_unix-any.sh" -. "${LIBS_AUTOMATACI}/_package-changelog_unix-any.sh" -. "${LIBS_AUTOMATACI}/_package-chocolatey_unix-any.sh" -. "${LIBS_AUTOMATACI}/_package-citation_unix-any.sh" -. "${LIBS_AUTOMATACI}/_package-deb_unix-any.sh" -. "${LIBS_AUTOMATACI}/_package-docker_unix-any.sh" -. "${LIBS_AUTOMATACI}/_package-flatpak_unix-any.sh" -. "${LIBS_AUTOMATACI}/_package-homebrew_unix-any.sh" -. "${LIBS_AUTOMATACI}/_package-ipk_unix-any.sh" -. "${LIBS_AUTOMATACI}/_package-lib_unix-any.sh" -. "${LIBS_AUTOMATACI}/_package-msi_unix-any.sh" -. "${LIBS_AUTOMATACI}/_package-pdf_unix-any.sh" -. "${LIBS_AUTOMATACI}/_package-pypi_unix-any.sh" -. "${LIBS_AUTOMATACI}/_package-rpm_unix-any.sh" +. "${LIBS_AUTOMATACI}/services/hestiaCHANGELOG/Vanilla.sh.ps1" +. "${LIBS_AUTOMATACI}/services/hestiaCITATION/Vanilla.sh.ps1" +. "${LIBS_AUTOMATACI}/services/hestiaCONSOLE/Vanilla.sh.ps1" +. "${LIBS_AUTOMATACI}/services/hestiaFS/Vanilla.sh.ps1" +. "${LIBS_AUTOMATACI}/services/hestiaGIT/Vanilla.sh.ps1" +. "${LIBS_AUTOMATACI}/services/hestiaKERNEL/Vanilla.sh.ps1" +. "${LIBS_AUTOMATACI}/services/hestiaOS/Vanilla.sh.ps1" +. "${LIBS_AUTOMATACI}/services/hestiaSTRING/Vanilla.sh.ps1" +. "${LIBS_AUTOMATACI}/services/hestiaTIME/Vanilla.sh.ps1" -# source locally provided functions -. "${LIBS_AUTOMATACI}/_package-sourcing_unix-any.sh" +# snap a release time +PACKAGE_TIME="$(hestiaTIME_Now)" -# 1-time setup job required materials -DEST="${PROJECT_PATH_ROOT}/${PROJECT_PATH_PKG}" -I18N_Remake "$DEST" -FS_Remake_Directory "$DEST" -if [ $? -ne 0 ]; then - I18N_Remake_Failed - return 1 +# clean up the entire output directory for fresh packaging +DIRECTORY_OUTPUT="${PROJECT_PATH_ROOT}/${PROJECT_PATH_PKG}" +hestiaCONSOLE_Log_Recreate "$DIRECTORY_OUTPUT" +hestiaFS_Recreate_Directory "$DIRECTORY_OUTPUT" +if [ $? -ne $hestiaKERNEL_ERROR_OK ]; then + hestiaCONSOLE_Log_Recreate_Failed + return $hestiaKERNEL_ERROR_BAD_EXEC fi -if [ "$(STRINGS_Is_Empty "$PROJECT_HOMEBREW_URL")" -ne 0 ]; then - HOMEBREW_WORKSPACE="packagers-homebrew-${PROJECT_SKU}" - I18N_Setup "$HOMEBREW_WORKSPACE" - HOMEBREW_WORKSPACE="${PROJECT_PATH_ROOT}/${PROJECT_PATH_TEMP}/${HOMEBREW_WORKSPACE}" - FS_Remake_Directory "$HOMEBREW_WORKSPACE" - if [ $? -ne 0 ]; then - I18N_Setup_Failed - return 1 +# clean up homebrew consolidation directory +if [ "$(hestiaSTRING_Is_Empty "$PROJECT_HOMEBREW_URL")" -ne $hestiaKERNEL_ERROR_OK ]; then + DIRECTORY_HOMEBREW="${PROJECT_PATH_ROOT}/${PROJECT_PATH_TEMP}/packagers-homebrew-${PROJECT_SKU}" + hestiaCONSOLE_Log_Recreate "$DIRECTORY_HOMEBREW" + hestiaFS_Recreate_Directory "$DIRECTORY_HOMEBREW" + if [ $? -ne $hestiaKERNEL_ERROR_OK ]; then + hestiaCONSOLE_Log_Recreate_Failed + return $hestiaKERNEL_ERROR_BAD_EXEC fi fi -if [ "$(STRINGS_Is_Empty "$PROJECT_MSI_INSTALL_DIRECTORY")" -ne 0 ]; then - MSI_WORKSPACE="packagers-msi-${PROJECT_SKU}" - I18N_Setup "$MSI_WORKSPACE" - MSI_WORKSPACE="${PROJECT_PATH_ROOT}/${PROJECT_PATH_TEMP}/${MSI_WORKSPACE}" - FS_Remake_Directory "$MSI_WORKSPACE" - if [ $? -ne 0 ]; then - I18N_Setup_Failed - return 1 +# clean up msi (windows) consolidation directory +if [ "$(hestiaSTRING_Is_Empty "$PROJECT_MSI_INSTALL_DIRECTORY")" -ne $hestiaKERNEL_ERROR_OK ]; then + DIRECTORY_MSI="${PROJECT_PATH_ROOT}/${PROJECT_PATH_TEMP}/packagers-msi-${PROJECT_SKU}" + hestiaCONSOLE_Log_Recreate "$DIRECTORY_MSI" + hestiaFS_Recreate_Directory "$DIRECTORY_MSI" + if [ $? -ne $hestiaKERNEL_ERROR_OK ]; then + hestiaCONSOLE_Log_Recreate_Failed + return $hestiaKERNEL_ERROR_BAD_EXEC fi - if [ $(STRINGS_Is_Empty "$PROJECT_MSI_REGISTRY_KEY") -eq 0 ]; then + if [ "$(hestiaSTRING_Is_Empty "$PROJECT_MSI_REGISTRY_KEY")" -eq $hestiaKERNEL_ERROR_OK ]; then PROJECT_MSI_REGISTRY_KEY="\ Software\\\\${PROJECT_SCOPE}\\\\InstalledProducts\\\\${PROJECT_SKU_TITLECASE}" fi fi -if [ "$(STRINGS_Is_Empty "$PROJECT_FLATPAK_URL")" -ne 0 ]; then - FLATPAK_REPO="flatpak-repo" - I18N_Setup "$FLATPAK_REPO" - FLATPAK_REPO="${PROJECT_PATH_ROOT}/${PROJECT_PATH_TEMP}/${FLATPAK_REPO}" - FS_Remove_Silently "$FLATPAK_REPO" +# clean up flatpak repository directory +if [ "$(hestiaSTRING_Is_Empty "$PROJECT_FLATPAK_URL")" -ne $hestiaKERNEL_ERROR_OK ]; then + DIRECTORY_FLATPAK="${PROJECT_PATH_ROOT}/${PROJECT_PATH_TEMP}/packagers-flatpak-${PROJECT_SKU}" + hestiaCONSOLE_Log_Recreate "$DIRECTORY_FLATPAK" + hestiaFS_Remove "$DIRECTORY_FLATPAK" - if [ $(STRINGS_Is_Empty "$PROJECT_FLATPAK_REPO") -ne 0 ] && - [ $(STRINGS_Is_Empty "$PROJECT_RELEASE_REPO") -eq 0 ]; then + if [ $(hestiaSTRING_Is_Empty "$PROJECT_FLATPAK_REPO") -ne $hestiaKERNEL_ERROR_OK ] && + [ $(hestiaSTRING_Is_Empty "$PROJECT_RELEASE_REPO") -eq $hestiaKERNEL_ERROR_OK ]; then # version controlled repository supplied; AND # single unified repository is not enabled - FS_Make_Housing_Directory "$FLATPAK_REPO" - GIT_Clone_Repo \ - "$PROJECT_PATH_ROOT" \ - "$PROJECT_PATH_TEMP" \ - "$PWD" \ - "$PROJECT_FLATPAK_REPO" \ - "$PROJECT_SIMULATE_RUN" \ - "$(FS_Get_File "$FLATPAK_REPO")" \ - "$PROJECT_FLATPAK_REPO_BRANCH" - if [ $? -ne 0 ]; then - I18N_Setup_Failed - return 1 + if [ $(hestiaOS_Is_Simulation_Mode) -eq $hestiaKERNEL_ERROR_OK ]; then + hestiaCONSOLE_Log_Recreate_Simulate "$DIRECTORY_FLATPAK" + else + hestiaGIT_Clone "$PROJECT_FLATPAK_REPO" "$DIRECTORY_FLATPAK" + if [ $? -ne $hestiaKERNEL_ERROR_OK ]; then + hestiaCONSOLE_Log_Recreate_Failed + return $hestiaKERNEL_ERROR_BAD_EXEC + fi + + hestiaGIT_Change_Branch "$DIRECTORY_FLATPAK" "$PROJECT_FLATPAK_REPO_BRANCH" + if [ $? -ne $hestiaKERNEL_ERROR_OK ]; then + hestiaCONSOLE_Log_Recreate_Failed + return $hestiaKERNEL_ERROR_BAD_EXEC + fi fi - if [ $(STRINGS_Is_Empty "$PROJECT_FLATPAK_PATH") -ne 0 ]; then - FLATPAK_REPO="${FLATPAK_REPO}/${PROJECT_FLATPAK_PATH}" + if [ $(hestiaSTRING_Is_Empty "$PROJECT_FLATPAK_PATH") -ne $hestiaKERNEL_ERROR_OK ]; then + DIRECTORY_FLATPAK="${DIRECTORY_FLATPAK}/${PROJECT_FLATPAK_PATH}" fi fi - FS_Make_Directory "$FLATPAK_REPO" - if [ $? -ne 0 ]; then - I18N_Setup_Failed - return 1 + hestiaFS_Create_Directory "$DIRECTORY_FLATPAK" + if [ $? -ne $hestiaKERNEL_ERROR_OK ]; then + hestiaCONSOLE_Log_Recreate_Failed + return $hestiaKERNEL_ERROR_BAD_EXEC fi fi +# clean up changelog directory +DIRECTORY_CHANGELOG="${PROJECT_PATH_ROOT}/${PROJECT_PATH_TEMP}/packagers-changelog" +hestiaCONSOLE_Log_Recreate "$DIRECTORY_CHANGELOG" +hestiaFS_Recreate_Directory "$DIRECTORY_CHANGELOG" +if [ $? -ne $hestiaKERNEL_ERROR_OK ]; then + hestiaCONSOLE_Log_Recreate_Failed + return $hestiaKERNEL_ERROR_BAD_EXEC +fi + + +# generate markdown changelog FILE_CHANGELOG_MD="${PROJECT_SKU}-CHANGELOG_${PROJECT_VERSION}.md" FILE_CHANGELOG_MD="${PROJECT_PATH_ROOT}/${PROJECT_PATH_PKG}/${FILE_CHANGELOG_MD}" -FILE_CHANGELOG_DEB="${PROJECT_PATH_ROOT}/${PROJECT_PATH_TEMP}/packagers-changelog/deb.gz" -PACKAGE_Run_CHANGELOG "$FILE_CHANGELOG_MD" "$FILE_CHANGELOG_DEB" -if [ $? -ne 0 ]; then - return 1 +hestiaCONSOLE_Log_Recreate "$FILE_CHANGELOG_MD" +hestiaCHANGELOG_Assemble_MARKDOWN \ + "$FILE_CHANGELOG_MD" \ + "${PROJECT_PATH_ROOT}/${PROJECT_PATH_SOURCE}/changelog/data" \ + "$PROJECT_CHANGELOG_TITLE" \ + "$PROJECT_VERSION" +if [ $? -ne $hestiaKERNEL_ERROR_OK ]; then + hestiaCONSOLE_Log_Recreate_Failed + return $hestiaKERNEL_ERROR_BAD_EXEC fi -FILE_CITATION_CFF="${PROJECT_SKU}-CITATION_${PROJECT_VERSION}.cff" -FILE_CITATION_CFF="${PROJECT_PATH_ROOT}/${PROJECT_PATH_PKG}/${FILE_CITATION_CFF}" -PACKAGE_Run_CITATION "$FILE_CITATION_CFF" -if [ $? -ne 0 ]; then - return 1 +# generate deb changelog +FILE_CHANGELOG_DEB="${DIRECTORY_CHANGELOG}/deb" +hestiaCONSOLE_Log_Recreate "$FILE_CHANGELOG_DEB" +hestiaCHANGELOG_Assemble_DEB \ + "$FILE_CHANGELOG_DEB" \ + "${PROJECT_PATH_ROOT}/${PROJECT_PATH_SOURCE}/changelog/deb" \ + "$PROJECT_VERSION" +if [ $? -ne $hestiaKERNEL_ERROR_OK ]; then + hestiaCONSOLE_Log_Recreate_Failed + return $hestiaKERNEL_ERROR_BAD_EXEC +fi + +FILE_CHANGELOG_DEB="${FILE_CHANGELOG_DEB}.gz" +if [ $(hestiaFS_Is_File "$FILE_CHANGELOG_DEB") -ne $hestiaKERNEL_ERROR_OK ]; then + hestiaCONSOLE_Log_Recreate_Failed + return $hestiaKERNEL_ERROR_BAD_EXEC fi -I18N_Newline +# generate rpm changelog +FILE_CHANGELOG_RPM="${DIRECTORY_CHANGELOG}/rpm" +hestiaCONSOLE_Log_Recreate "$FILE_CHANGELOG_RPM" +hestiaCHANGELOG_Assemble_RPM \ + "$FILE_CHANGELOG_RPM" \ + "${PROJECT_PATH_ROOT}/${PROJECT_PATH_SOURCE}/changelog/data" \ + "$(hestiaTIME_Format_Date_RPM "$PACKAGE_TIME")" \ + "$PROJECT_CONTACT_NAME" \ + "$PROJECT_CONTACT_EMAIL" \ + "$PROJECT_VERSION" \ + "$PROJECT_CADENCE" +if [ $? -ne $hestiaKERNEL_ERROR_OK ]; then + hestiaCONSOLE_Log_Recreate_Failed + return $hestiaKERNEL_ERROR_BAD_EXEC +fi +# generate CITATION.cff +FILE_CITATION_CFF="${PROJECT_SKU}-CITATION_${PROJECT_VERSION}.cff" +FILE_CITATION_CFF="${PROJECT_PATH_ROOT}/${PROJECT_PATH_PKG}/${FILE_CITATION_CFF}" +hestiaCONSOLE_Log_Recreate "$FILE_CITATION_CFF" +hestiaCITATION_Assemble \ + "$FILE_CITATION_CFF" \ + "${PROJECT_PATH_ROOT}/${PROJECT_PATH_SOURCE}/docs/ABSTRACTS.txt" \ + "${PROJECT_PATH_ROOT}/${PROJECT_PATH_SOURCE}/docs/CITATIONS.yml" \ + "$PROJECT_CITATION" \ + "$PROJECT_CITATION_TYPE" \ + "$(hestiaTIME_Format_Date_ISO8601 "$PACKAGE_TIME")" \ + "$PROJECT_NAME" \ + "$PROJECT_VERSION" \ + "$PROJECT_LICENSE" \ + "$PROJECT_SOURCE_URL" \ + "$PROJECT_SOURCE_URL" \ + "$PROJECT_STATIC_URL" \ + "$PROJECT_CONTACT_NAME" \ + "$PROJECT_CONTACT_WEBSITE" \ + "$PROJECT_CONTACT_EMAIL" +if [ $? -ne $hestiaKERNEL_ERROR_OK ]; then + hestiaCONSOLE_Log_Recreate_Failed + return $hestiaKERNEL_ERROR_BAD_EXEC +fi -# prepare for parallel package -__log_directory="${PROJECT_PATH_ROOT}/${PROJECT_PATH_LOG}/packagers" -I18N_Remake "$__log_directory" -FS_Remake_Directory "$__log_directory" -FS_Is_Directory "$__log_directory" -if [ $? -ne 0 ]; then - I18N_Remake_Failed - return 1 +# clean up log directory +DIRECTORY_LOG="${PROJECT_PATH_ROOT}/${PROJECT_PATH_LOG}/packagers" +hestiaCONSOLE_Log_Recreate "$DIRECTORY_LOG" +hestiaFS_Recreate_Directory "$DIRECTORY_LOG" +if [ $? -ne $hestiaKERNEL_ERROR_OK ]; then + hestiaCONSOLE_Log_Recreate_Failed + return $hestiaKERNEL_ERROR_BAD_EXEC fi -__control_directory="${PROJECT_PATH_ROOT}/${PROJECT_PATH_TEMP}/packagers-parallel" -I18N_Remake "${__control_directory}" -FS_Remake_Directory "$__control_directory" -FS_Is_Directory "$__control_directory" -if [ $? -ne 0 ]; then - I18N_Remake_Failed - return 1 + +# clean up parallel control directory +DIRECTORY_PARALLEL="${PROJECT_PATH_ROOT}/${PROJECT_PATH_TEMP}/packagers-parallel" +hestiaCONSOLE_Log_Recreate "$DIRECTORY_PARALLEL" +hestiaFS_Recreate_Directory "$DIRECTORY_PARALLEL" +if [ $? -ne $hestiaKERNEL_ERROR_OK ]; then + hestiaCONSOLE_Log_Recreate_Failed + return $hestiaKERNEL_ERROR_BAD_EXEC fi -__parallel_control="${__control_directory}/control-parallel.txt" -FS_Remove_Silently "$__parallel_control" -__serial_control="${__control_directory}/control-serial.txt" -FS_Remove_Silently "$__serial_control" +# clean up serial control directory +DIRECTORY_SERIAL="${PROJECT_PATH_ROOT}/${PROJECT_PATH_TEMP}/packagers-serial" +hestiaCONSOLE_Log_Recreate "$DIRECTORY_SERIAL" +hestiaFS_Recreate_Directory "$DIRECTORY_SERIAL" +if [ $? -ne $hestiaKERNEL_ERROR_OK ]; then + hestiaCONSOLE_Log_Recreate_Failed + return $hestiaKERNEL_ERROR_BAD_EXEC +fi +# setup subroutine function for parallel executions SUBROUTINE_Package() { #__line="$1" + __filename="${1%%|*}" + __arguments="${1#*|}" + + __target="${__arguments%%|*}" + __arguments="${__arguments#*|}" + + __target_os="${__arguments%%|*}" + __arguments="${__arguments#*|}" + + __target_arch="${__arguments%%|*}" + __arguments="${__arguments#*|}" - # parse input - __command="${1##*|}" - __arguments="${1%|*}" + __package_time="${__arguments%%|*}" + __arguments="${__arguments#*|}" - __log="${__arguments##*|}" - __arguments="${__arguments%|*}|" + __function="${__arguments##*|}" + __arguments="${__arguments%|*}" - __subject="${__log##*/}" - __subject="${__subject%.*}" + __directory_log="${__arguments##*|}" + __arguments="${__arguments%|*}" + + __directory_output="${__arguments##*|}" + __arguments="${__arguments%|*}" + + + # import required libraries + . "${LIBS_AUTOMATACI}/services/hestiaKERNEL/Vanilla.sh.ps1" + . "${LIBS_AUTOMATACI}/_package-single_unix-any.sh" # execute - I18N_Package "$__subject" - FS_Remove_Silently "$__log" + case "$__function" in + "PACKAGE_SINGLE") + __log="${__directory_log}/single-${__filename}_${__target_os}-${__target_arch}.txt" + ;; + "PACKAGE_ARCHIVE") + __log="${__directory_log}/archive-${__filename}_${__target_os}-${__target_arch}.txt" + ;; + "PACKAGE_APP") + __log="${__directory_log}/app-${__filename}_${__target_os}-${__target_arch}.txt" + ;; + "PACKAGE_UNIX") + __log="${__directory_log}/unix-${__filename}_${__target_os}-${__target_arch}.txt" + ;; + "PACKAGE_WINDOWS") + __log="${__directory_log}/windows-${__filename}_${__target_os}-${__target_arch}.txt" + ;; + "PACKAGE_CONSOLIDATE") + __log="${__directory_log}/consolidate-${__filename}_${__target_os}-${__target_arch}.txt" + ;; + *) + return $hestiaKERNEL_ERROR_BAD_EXEC + ;; + esac - $__command "$__arguments" &> "$__log" - if [ $? -ne 0 ]; then - I18N_Package_Failed - return 1 + + # execute + "$__function" "$__filename" \ + "$__target" \ + "$__target_os" \ + "$__target_arch" \ + "$__package_time" \ + "$__directory_output" \ + "$__arguments" \ + &> "$__log" + if [ $? -ne $hestiaKERNEL_ERROR_OK ]; then + return $hestiaKERNEL_ERROR_BAD_EXEC fi # report status - return 0 + return $hestiaKERNEL_ERROR_OK } +# register built artifacts for parallel executions +if [ $(hestiaFS_Is_Directory "${PROJECT_PATH_ROOT}/${PROJECT_PATH_BUILD}") -ne $hestiaKERNEL_ERROR_OK ]; then + # no artifacts at all - report status + hestiaCONSOLE_Log_Success + return $hestiaKERNEL_ERROR_OK +fi - -# begin registering packagers -FS_Is_Directory "${PROJECT_PATH_ROOT}/${PROJECT_PATH_BUILD}" -if [ $? -eq 0 ]; then -for i in "${PROJECT_PATH_ROOT}/${PROJECT_PATH_BUILD}"/*; do - FS_Is_File "$i" - if [ $? -ne 0 ]; then +for __artifact in "${PROJECT_PATH_ROOT}/${PROJECT_PATH_BUILD}"/*; do + if [ $(hestiaFS_Is_File "$__artifact") -ne $hestiaKERNEL_ERROR_OK ]; then continue fi # parse build candidate - I18N_Detected "$i" - TARGET_FILENAME="${i##*${PROJECT_PATH_ROOT}/${PROJECT_PATH_BUILD}/}" + TARGET_FILENAME="$(hestiaFS_Get_File "$__artifact")" TARGET_FILENAME="${TARGET_FILENAME%.*}" TARGET_OS="${TARGET_FILENAME##*_}" TARGET_FILENAME="${TARGET_FILENAME%%_*}" @@ -230,299 +336,62 @@ for i in "${PROJECT_PATH_ROOT}/${PROJECT_PATH_BUILD}"/*; do TARGET_ARCH="${TARGET_ARCH%%.*}" TARGET_OS="${TARGET_OS%%-*}" TARGET_OS="${TARGET_OS%%.*}" + TAG_COMMON="${TARGET_FILENAME}|${__artifact}|${TARGET_OS}|${TARGET_ARCH}|${PACKAGE_TIME}" - if [ "$(STRINGS_Is_Empty "$TARGET_OS")" -eq 0 ] || - [ "$(STRINGS_Is_Empty "$TARGET_ARCH")" -eq 0 ] || - [ "$(STRINGS_Is_Empty "$TARGET_FILENAME")" -eq 0 ]; then - I18N_File_Has_Bad_Stat_Skipped + if [ "$(hestiaSTRING_Is_Empty "$TARGET_OS")" -eq $hestiaKERNEL_ERROR_OK ] || + [ "$(hestiaSTRING_Is_Empty "$TARGET_ARCH")" -eq $hestiaKERNEL_ERROR_OK ] || + [ "$(hestiaSTRING_Is_Empty "$TARGET_FILENAME")" -eq $hestiaKERNEL_ERROR_OK ]; then continue fi - STRINGS_Has_Prefix "$PROJECT_SKU" "$TARGET_FILENAME" - if [ $? -ne 0 ]; then - STRINGS_Has_Prefix "lib${PROJECT_SKU}" "$TARGET_FILENAME" - if [ $? -ne 0 ]; then - I18N_Is_Incompatible_Skipped "$TARGET_FILENAME" - continue - fi - fi - - __common="${DEST}|${i}|${TARGET_FILENAME}|${TARGET_OS}|${TARGET_ARCH}" - - - # begin registrations - I18N_Sync_Register "$i" - if [ $(STRINGS_Is_Empty "$PROJECT_RELEASE_ARCHIVE") -ne 0 ]; then - __log="archive_${TARGET_FILENAME}_${TARGET_OS}-${TARGET_ARCH}.log" - __log="${__log_directory}/${__log}" - FS_Append_File "$__parallel_control" "\ -${__common}|${__log}|PACKAGE_Run_ARCHIVE + # register classcial single / archive packages + hestiaFS_Append_File "${DIRECTORY_PARALLEL}/control.txt" "\ +${TAG_COMMON}|${DIRECTORY_OUTPUT}|${DIRECTORY_LOG}|PACKAGE_SINGLE " - if [ $? -ne 0 ]; then - return 1 - fi + if [ $? -ne $hestiaKERNEL_ERROR_OK ]; then + return $hestiaKERNEL_ERROR_BAD_EXEC fi - if [ $(STRINGS_Is_Empty "$PROJECT_RUST") -ne 0 ]; then - __log="cargo_${TARGET_FILENAME}_${TARGET_OS}-${TARGET_ARCH}.log" - __log="${__log_directory}/${__log}" - FS_Append_File "$__parallel_control" "\ -${__common}|${__log}|PACKAGE_Run_CARGO -" - if [ $? -ne 0 ]; then - return 1 - fi - fi - # NOTE: chocolatey only serve windows - if [ $(STRINGS_Is_Empty "$PROJECT_CHOCOLATEY_URL") -ne 0 ]; then - case "$TARGET_OS" in - any|windows) - __log="chocolatey_${TARGET_FILENAME}_${TARGET_OS}-${TARGET_ARCH}.log" - __log="${__log_directory}/${__log}" - FS_Append_File "$__parallel_control" "\ -${__common}|${__log}|PACKAGE_Run_CHOCOLATEY -" - if [ $? -ne 0 ]; then - return 1 - fi - ;; - *) - ;; - esac - fi + # register app-only sandboxed|containerized packages - # NOTE: deb does not work in windows or mac - if [ $(STRINGS_Is_Empty "$PROJECT_DEB_URL") -ne 0 ]; then - case "$TARGET_OS" in - windows|darwin) - ;; - *) - __log="deb_${TARGET_FILENAME}_${TARGET_OS}-${TARGET_ARCH}.log" - __log="${__log_directory}/${__log}" - FS_Append_File "$__parallel_control" "\ -${__common}|${FILE_CHANGELOG_DEB}|${__log}|PACKAGE_Run_DEB -" - if [ $? -ne 0 ]; then - return 1 - fi - ;; - esac - fi - # NOTE: container only serve windows and linux - if [ $(STRINGS_Is_Empty "$PROJECT_CONTAINER_REGISTRY") -ne 0 ]; then - case "$TARGET_OS" in - any|linux|windows) - __log="docker_${TARGET_FILENAME}_${TARGET_OS}-${TARGET_ARCH}.log" - __log="${__log_directory}/${__log}" - FS_Append_File "$__serial_control" "\ -${__common}|${__log}|PACKAGE_Run_DOCKER -" - if [ $? -ne 0 ]; then - return 1 - fi - ;; - *) - ;; - esac - fi - - # NOTE: flatpak only serve linux - FLATPAK_Is_Available - if [ $? -eq 0 ] && [ $(STRINGS_Is_Empty "$PROJECT_FLATPAK_URL") -ne 0 ]; then - case "$TARGET_OS" in - any|linux) - __log="flatpak_${TARGET_FILENAME}_${TARGET_OS}-${TARGET_ARCH}.log" - __log="${__log_directory}/${__log}" - FS_Append_File "$__serial_control" "\ -${__common}|${FLATPAK_REPO}|${__log}|PACKAGE_Run_FLATPAK -" - if [ $? -ne 0 ]; then - return 1 - fi - ;; - *) - ;; - esac - fi + # register unix OS packages - # NOTE: homebrew only serve linux and mac - if [ $(STRINGS_Is_Empty "$PROJECT_HOMEBREW_URL") -ne 0 ]; then - case "$TARGET_OS" in - any|darwin|linux) - __log="homebrew_${TARGET_FILENAME}_${TARGET_OS}-${TARGET_ARCH}.log" - __log="${__log_directory}/${__log}" - FS_Append_File "$__parallel_control" "\ -${__common}|${HOMEBREW_WORKSPACE}|${__log}|PACKAGE_Run_HOMEBREW -" - if [ $? -ne 0 ]; then - return 1 - fi - ;; - *) - ;; - esac - fi - if [ $(STRINGS_Is_Empty "$PROJECT_RELEASE_IPK") -ne 0 ]; then - __log="ipk_${TARGET_FILENAME}_${TARGET_OS}-${TARGET_ARCH}.log" - __log="${__log_directory}/${__log}" - FS_Append_File "$__parallel_control" "\ -${__common}|${__log}|PACKAGE_Run_IPK -" - if [ $? -ne 0 ]; then - return 1 - fi - fi - - if [ $(FS_Is_Target_A_Library "$i") -eq 0 ] && - [ $(STRINGS_Is_Empty "$PROJECT_RELEASE_ARCHIVE") -ne 0 ]; then - __log="lib_${TARGET_FILENAME}_${TARGET_OS}-${TARGET_ARCH}.log" - __log="${__log_directory}/${__log}" - FS_Append_File "$__parallel_control" "\ -${__common}|${__log}|PACKAGE_Run_LIB -" - if [ $? -ne 0 ]; then - return 1 - fi - fi - - # NOTE: MSI only works in windows - if [ $(STRINGS_Is_Empty "$PROJECT_MSI_INSTALL_DIRECTORY") -ne 0 ]; then - case "$TARGET_OS" in - any|windows) - __log="msi_${TARGET_FILENAME}_${TARGET_OS}-${TARGET_ARCH}.log" - __log="${__log_directory}/${__log}" - FS_Append_File "$__parallel_control" "\ -${__common}|${MSI_WORKSPACE}|${__log}|PACKAGE_Run_MSI -" - if [ $? -ne 0 ]; then - return 1 - fi - ;; - *) - ;; - esac - - fi - - if [ $(FS_Is_Target_A_PDF "$i") -eq 0 ]; then - __log="pdf_${TARGET_FILENAME}_${TARGET_OS}-${TARGET_ARCH}.log" - __log="${__log_directory}/${__log}" - FS_Append_File "$__parallel_control" "\ -${__common}|${__log}|PACKAGE_Run_PDF -" - if [ $? -ne 0 ]; then - return 1 - fi - fi + # register windows OS packages - if [ $(STRINGS_Is_Empty "$PROJECT_PYTHON") -ne 0 ]; then - __log="pypi_${TARGET_FILENAME}_${TARGET_OS}-${TARGET_ARCH}.log" - __log="${__log_directory}/${__log}" - FS_Append_File "$__parallel_control" "\ -${__common}|${__log}|PACKAGE_Run_PYPI -" - if [ $? -ne 0 ]; then - return 1 - fi - fi - # NOTE: RPM only serve linux - if [ $(STRINGS_Is_Empty "$PROJECT_RPM_URL") -ne 0 ]; then - case "$TARGET_OS" in - any|linux) - __log="rpm_${TARGET_FILENAME}_${TARGET_OS}-${TARGET_ARCH}.log" - __log="${__log_directory}/${__log}" - FS_Append_File "$__parallel_control" "\ -${__common}|${__log}|PACKAGE_Run_RPM -" - if [ $? -ne 0 ]; then - return 1 - fi - ;; - *) - ;; - esac - fi + # register consolidation packages done -fi -I18N_Sync_Run -FS_Is_File "$__parallel_control" -if [ $? -eq 0 ]; then - SYNC_Exec_Parallel "SUBROUTINE_Package" "$__parallel_control" - if [ $? -ne 0 ]; then - I18N_Sync_Failed - return 1 +# execute in parallel +if [ $(hestiaFS_Is_File "${DIRECTORY_PARALLEL}/control.txt") -eq $hestiaKERNEL_ERROR_OK ]; then + hestiaCONSOLE_Log_Run "$DIRECTORY_PARALLEL" + hestiaKERNEL_Run_Parallel_Sentinel "SUBROUTINE_Package" "$DIRECTORY_PARALLEL" + ___process=$? + if [ $___process -ne $hestiaKERNEL_ERROR_OK ]; then + hestiaCONSOLE_Log_Run_Failed + return $hestiaKERNEL_ERROR_BAD_EXEC fi fi - -if [ $(STRINGS_Is_Empty "$PROJECT_HOMEBREW_URL") -ne 0 ]; then - I18N_Newline - I18N_Newline - - __dest="${PROJECT_SKU}.rb" - I18N_Export "$__dest" - __dest="${PROJECT_PATH_ROOT}/${PROJECT_PATH_PKG}/${__dest}" - HOMEBREW_Seal "$__dest" \ - "${PROJECT_SKU}-homebrew_${PROJECT_VERSION}_any-any.tar.xz" \ - "$HOMEBREW_WORKSPACE" \ - "$PROJECT_SKU" \ - "$PROJECT_PITCH" \ - "$PROJECT_CONTACT_WEBSITE" \ - "$PROJECT_LICENSE" \ - "$PROJECT_HOMEBREW_URL" - if [ $? -ne 0 ];then - I18N_Export_Failed - return 1 - fi -fi +# execute consolidated packages -if [ "$(STRINGS_Is_Empty "$PROJECT_MSI_INSTALL_DIRECTORY")" -ne 0 ]; then - I18N_Newline - I18N_Newline - - # sort any arch into others - PACKAGE_Sort_MSI "$MSI_WORKSPACE" - if [ $? -ne 0 ];then - return 1 +# execute in serial +if [ $(hestiaFS_Is_File "${DIRECTORY_SERIAL}/control.txt") -eq $hestiaKERNEL_ERROR_OK ]; then + hestiaCONSOLE_Log_Run "$DIRECTORY_SERIAL" + hestiaKERNEL_Run_Parallel_Sentinel "SUBROUTINE_Package" "$DIRECTORY_SERIAL" "1" + if [ $? -ne $hestiaKERNEL_ERROR_OK ]; then + hestiaCONSOLE_Log_Run_Failed + return $hestiaKERNEL_ERROR_BAD_EXEC fi - - # seal all MSI packages - for _candidate in "${MSI_WORKSPACE}/"*; do - FS_Is_Directory "$_candidate" - if [ $? -ne 0 ]; then - continue - fi - - I18N_Newline - PACKAGE_Seal_MSI "$_candidate" "${PROJECT_PATH_ROOT}/${PROJECT_PATH_PKG}" - if [ $? -ne 0 ];then - return 1 - fi - done fi -I18N_Sync_Run_Series -FS_Is_File "$__serial_control" -if [ $? -eq 0 ]; then - SYNC_Exec_Serial "SUBROUTINE_Package" "$__serial_control" - if [ $? -ne 0 ]; then - I18N_Sync_Failed - return 1 - fi -fi - - - - # report status -I18N_Run_Successful -return 0 +hestiaCONSOLE_Log_Success +return $hestiaKERNEL_ERROR_OK diff --git a/automataCI/package_windows-any.ps1 b/automataCI/package_windows-any.ps1 index 9ca070b..33b55b9 100644 --- a/automataCI/package_windows-any.ps1 +++ b/automataCI/package_windows-any.ps1 @@ -15,537 +15,385 @@ # initialize if (-not (Test-Path -Path $env:PROJECT_PATH_ROOT)) { - Write-Error "[ ERROR ] - Please run me from automataCI\ci.sh.ps1 instead!`n" - return 1 + Write-Error "[ ERROR ] - Please run me from automataCI\ci.sh.ps1 instead!`n" + return 1 } -. "${env:LIBS_AUTOMATACI}\services\io\fs.ps1" -. "${env:LIBS_AUTOMATACI}\services\io\strings.ps1" -. "${env:LIBS_AUTOMATACI}\services\io\sync.ps1" -. "${env:LIBS_AUTOMATACI}\services\i18n\translations.ps1" -. "${env:LIBS_AUTOMATACI}\services\compilers\flatpak.ps1" -. "${env:LIBS_AUTOMATACI}\services\publishers\homebrew.ps1" -. "${env:LIBS_AUTOMATACI}\services\versioners\git.ps1" +. "${env:LIBS_AUTOMATACI}\services\hestiaCHANGELOG\Vanilla.sh.ps1" +. "${env:LIBS_AUTOMATACI}\services\hestiaCITATION\Vanilla.sh.ps1" +. "${env:LIBS_AUTOMATACI}\services\hestiaCONSOLE\Vanilla.sh.ps1" +. "${env:LIBS_AUTOMATACI}\services\hestiaFS\Vanilla.sh.ps1" +. "${env:LIBS_AUTOMATACI}\services\hestiaGIT\Vanilla.sh.ps1" +. "${env:LIBS_AUTOMATACI}\services\hestiaKERNEL\Vanilla.sh.ps1" +. "${env:LIBS_AUTOMATACI}\services\hestiaOS\Vanilla.sh.ps1" +. "${env:LIBS_AUTOMATACI}\services\hestiaSTRING\Vanilla.sh.ps1" +. "${env:LIBS_AUTOMATACI}\services\hestiaTIME\Vanilla.sh.ps1" -. "${env:LIBS_AUTOMATACI}\_package-changelog_windows-any.ps1" -. "${env:LIBS_AUTOMATACI}\_package-citation_windows-any.ps1" -. "${env:LIBS_AUTOMATACI}\_package-msi_windows-any.ps1" +# snap a release time +$PACKAGE_TIME = hestiaTIME-Now + -# 1-time setup job required materials -$DEST = "${env:PROJECT_PATH_ROOT}\${env:PROJECT_PATH_PKG}" -$null = I18N-Remake "${DEST}" -$___process = FS-Remake-Directory "${DEST}" -if ($___process -ne 0) { - $null = I18N-Remake-Failed - return 1 -} -if ($(STRINGS-Is-Empty "${env:PROJECT_HOMEBREW_URL}") -ne 0) { - $HOMEBREW_WORKSPACE = "packagers-homebrew-${env:PROJECT_SKU}" - $null = I18N-Setup "${HOMEBREW_WORKSPACE}" - $HOMEBREW_WORKSPACE = "${env:PROJECT_PATH_ROOT}\${env:PROJECT_PATH_TEMP}\${HOMEBREW_WORKSPACE}" - $___process = FS-Remake-Directory "${HOMEBREW_WORKSPACE}" - if ($___process -ne 0) { - $null = I18N-Setup-Failed - return 1 - } +# clean up the entire output directory for fresh packaging +$DIRECTORY_OUTPUT = "${env:PROJECT_PATH_ROOT}\${env:PROJECT_PATH_PKG}" +$null = hestiaCONSOLE-Log-Recreate "${DIRECTORY_OUTPUT}" +$___process = hestiaFS-Recreate-Directory "${DIRECTORY_OUTPUT}" +if ($___process -ne ${env:hestiaKERNEL_ERROR_OK}) { + $null = hestiaCONSOLE-Log-Recreate-Failed + return ${env:hestiaKERNEL_ERROR_BAD_EXEC} } -if ($(STRINGS-Is-Empty "${env:PROJECT_MSI_INSTALL_DIRECTORY}") -ne 0) { - $MSI_WORKSPACE = "packagers-msi-${env:PROJECT_SKU}" - $null = I18N-Setup "${MSI_WORKSPACE}" - $MSI_WORKSPACE = "${env:PROJECT_PATH_ROOT}\${env:PROJECT_PATH_TEMP}\${MSI_WORKSPACE}" - $___process = FS-Remake-Directory "${MSI_WORKSPACE}" - if ($___process -ne 0) { - $null = I18N-Setup-Failed - return 1 - } +# clean up homebrew consolidation directory +if ($(STRINGS-Is-Empty "${env:PROJECT_HOMEBREW_URL}") -ne ${env:hestiaKERNEL_ERROR_OK}) { + $DIRECTORY_HOMEBREW = "${env:PROJECT_PATH_ROOT}\${env:PROJECT_PATH_TEMP}\packagers-homebrew-${env:PROJECT_SKU}" + $null = hestiaCONSOLE-Log-Recreate "${DIRECTORY_HOMEBREW}" + $___process = hestiaFS-Recreate-Directory "${DIRECTORY_HOMEBREW}" + if ($___process -ne ${env:hestiaKERNEL_ERROR_OK}) { + $null = hestiaCONSOLE-Log-Recreate-Failed + return ${env:hestiaKERNEL_ERROR_BAD_EXEC} + } +} + +# clean up msi (windows) consolidation directory +if ($(STRINGS-Is-Empty "${env:PROJECT_MSI_INSTALL_DIRECTORY}") -ne ${env:hestiaKERNEL_ERROR_OK}) { + $DIRECTORY_MSI = "${env:PROJECT_PATH_ROOT}\${env:PROJECT_PATH_TEMP}\packagers-msi-${env:PROJECT_SKU}" + $null = hestiaCONSOLE-Log-Recreate "${DIRECTORY_MSI}" + $___process = hestiaFS-Recreate-Directory "${DIRECTORY_MSI}" + if ($___process -ne 0) { + $null = hestiaCONSOLE-Log-Recreate-Failed + return ${env:hestiaKERNEL_ERROR_BAD_EXEC} + } - if ($(STRINGS-Is-Empty "${env:PROJECT_MSI_REGISTRY_KEY}") -eq 0) { - ${env:PROJECT_MSI_REGISTRY_KEY} = @" + if ($(STRINGS-Is-Empty "${env:PROJECT_MSI_REGISTRY_KEY}") -eq ${env:hestiaKERNEL_ERROR_OK}) { + ${env:PROJECT_MSI_REGISTRY_KEY} = @" Software\${env:PROJECT_SCOPE}\InstalledProducts\${env:PROJECT_SKU_TITLECASE} "@ - } + } } -if ($(STRINGS-Is-Empty "${env:PROJECT_FLATPAK_URL}") -ne 0) { - $FLATPAK_REPO = "flatpak-repo" - $null = I18N-Setup "${FLATPAK_REPO}" - $FLATPAK_REPO = "${env:PROJECT_PATH_ROOT}\${env:PROJECT_PATH_TEMP}\${FLATPAK_REPO}" - $null = FS-Remove-Silently "$FLATPAK_REPO" - - if (($(STRINGS-Is-Empty "${env:PROJECT_FLATPAK_REPO}") -ne 0) -and - ($(STRINGS-Is-Empty "${env:PROJECT_RELEASE_REPO}") -ne 0)) { - # version controlled repository supplied; AND - # single unified repository is not enabled - $null = FS-Make-Housing-Directory "$FLATPAK_REPO" - $___process = GIT-Clone-Repo ` - "${env:PROJECT_PATH_ROOT}" ` - "${env:PROJECT_PATH_TEMP}" ` - "$(Get-Location)" ` - "${env:PROJECT_FLATPAK_REPO}" ` - "${env:PROJECT_SIMULATE_RUN}" ` - "$(FS-Get-File "${env:FLATPAK_REPO}")" ` - "${env:PROJECT_FLATPAK_REPO_BRANCH}" - if ($___process -ne 0) { - $null = I18N-Setup-Failed - return 1 - } - - if ($(STRINGS-Is-Empty "${env:PROJECT_FLATPAK_PATH}") -ne 0) { - $FLATPAK_REPO = "${FLATPAK_REPO}/${env:PROJECT_FLATPAK_PATH}" - } - } - - $___process = FS-Make-Directory "$FLATPAK_REPO" - if ($___process -ne 0) { - $null = I18N-Setup-Failed - return 1 - } +# clean up flatpak repository directory +if ($(STRINGS-Is-Empty "${env:PROJECT_FLATPAK_URL}") -ne ${env:hestiaKERNEL_ERROR_OK}) { + $DIRECTORY_FLATPAK = "${env:PROJECT_PATH_ROOT}\${env:PROJECT_PATH_TEMP}\packagers-flatpak-${env:PROJECT_SKU}" + $null = hestiaCONSOLE-Log-Recreate "${DIRECTORY_FLATPAK}" + $null = hestiaFS-Remove "${DIRECTORY_FLATPAK}" + + if ( + ($(hestiaSTRING-Is-Empty "${env:PROJECT_FLATPAK_REPO}") -ne ${env:hestiaKERNEL_ERROR_OK}) -and + ($(hestiaSTRING-Is-Empty "${env:PROJECT_RELEASE_REPO}") -eq ${env:hestiaKERNEL_ERROR_OK}) + ) { + if ($(hestiaOS-Is-Simulation-Mode) -eq ${env:hestiaKERNEL_ERROR_OK}) { + $null = hestiaCONSOLE-Log-Recreate-Simulate "$DIRECTORY_FLATPAK" + } else { + # version controlled repository supplied; AND + # single unified repository is not enabled + $___process = hestiaGIT-Clone "${env:PROJECT_FLATPAK_REPO}" "$DIRECTORY_FLATPAK" + if ($___process -ne ${env:hestiaKERNEL_ERROR_OK}) { + $null = hestiaCONSOLE-Log-Recreate-Failed + return ${env:hestiaKERNEL_ERROR_BAD_EXEC} + } + + $___process = hestiaGIT-Change-Branch "$DIRECTORY_FLATPAK" "${env:PROJECT_FLATPAK_REPO_BRANCH}" + if ($___process -ne ${env:hestiaKERNEL_ERROR_OK}) { + $null = hestiaCONSOLE-Log-Recreate-Failed + return ${env:hestiaKERNEL_ERROR_BAD_EXEC} + } + } + + if ($(hestiaSTRING-Is-Empty "${env:PROJECT_FLATPAK_PATH}") -ne ${env:hestiaKERNEL_ERROR_OK}) { + ${DIRECTORY_FLATPAK} = "${DIRECTORY_FLATPAK}\${env:PROJECT_FLATPAK_PATH}" + } + } + + $___process = hestiaFS-Create-Directory "${DIRECTORY_FLATPAK}" + if ($___process -ne ${env:hestiaKERNEL_ERROR_OK}) { + $null = hestiaCONSOLE-Log-Recreate-Failed + return ${env:hestiaKERNEL_ERROR_BAD_EXEC} + } } +# clean up changelog directory +$DIRECTORY_CHANGELOG = "${env:PROJECT_PATH_ROOT}\${env:PROJECT_PATH_TEMP}\packagers-changelog" +$null = hestiaCONSOLE-Log-Recreate "${DIRECTORY_CHANGELOG}" +$___process = hestiaFS-Recreate-Directory "${DIRECTORY_CHANGELOG}" +if ($___process -ne ${env:hestiaKERNEL_ERROR_OK}) { + $null = hestiaCONSOLE-Log-Recreate-Failed + return ${env:hestiaKERNEL_ERROR_BAD_EXEC} +} + + +# generate markdown changelog $FILE_CHANGELOG_MD = "${env:PROJECT_SKU}-CHANGELOG_${env:PROJECT_VERSION}.md" $FILE_CHANGELOG_MD = "${env:PROJECT_PATH_ROOT}\${env:PROJECT_PATH_PKG}\${FILE_CHANGELOG_MD}" -$FILE_CHANGELOG_DEB = "${env:PROJECT_PATH_ROOT}\${env:PROJECT_PATH_TEMP}\packagers-changelog\deb.gz" -$___process = Package-Run-CHANGELOG "$FILE_CHANGELOG_MD" "$FILE_CHANGELOG_DEB" -if ($___process -ne 0) { - return 1 +$null = hestiaCONSOLE-Log-Recreate "$FILE_CHANGELOG_MD" +$___process = hestiaCHANGELOG-Assemble-MARKDOWN ` + "$FILE_CHANGELOG_MD" ` + "${env:PROJECT_PATH_ROOT}\${env:PROJECT_PATH_SOURCE}\changelog\data" ` + "${env:PROJECT_CHANGELOG_TITLE}" ` + "${env:PROJECT_VERSION}" +if ($___process -ne ${env:hestiaKERNEL_ERROR_OK}) { + $null = hestiaCONSOLE-Log-Recreate-Failed + return ${env:hestiaKERNEL_ERROR_BAD_EXEC} } -$FILE_CITATION_CFF = "${env:PROJECT_SKU}-CITATION_${env:PROJECT_VERSION}.cff" -$FILE_CITATION_CFF = "${env:PROJECT_PATH_ROOT}\${env:PROJECT_PATH_PKG}\${FILE_CITATION_CFF}" -$___process = Package-Run-CITATION "$FILE_CITATION_CFF" -if ($___process -ne 0) { - return 1 +# generate deb changelog +$FILE_CHANGELOG_DEB = "${DIRECTORY_CHANGELOG}\deb" +$null = hestiaCONSOLE-Log-Recreate "$FILE_CHANGELOG_DEB" +$___process = hestiaCHANGELOG-Assemble-DEB ` + "$FILE_CHANGELOG_DEB" ` + "${env:PROJECT_PATH_ROOT}\${env:PROJECT_PATH_SOURCE}\changelog\deb" ` + "${env:PROJECT_VERSION}" +if ($___process -ne ${env:hestiaKERNEL_ERROR_OK}) { + $null = hestiaCONSOLE-Log-Recreate-Failed + return ${env:hestiaKERNEL_ERROR_BAD_EXEC} } - -$null = I18N-Newline +$FILE_CHANGELOG_DEB = "${FILE_CHANGELOG_DEB}.gz" +if ($(hestiaFS-Is-File "$FILE_CHANGELOG_DEB") -ne ${env:hestiaKERNEL_ERROR_OK}) { + $null = hestiaCONSOLE-Log-Recreate-Failed + return ${env:hestiaKERNEL_ERROR_BAD_EXEC} +} +# generate rpm changelog +$FILE_CHANGELOG_RPM = "${DIRECTORY_CHANGELOG}\rpm" +$null = hestiaCONSOLE-Log-Recreate "$FILE_CHANGELOG_RPM" +$___process = hestiaCHANGELOG-Assemble-RPM ` + "$FILE_CHANGELOG_RPM" ` + "${env:PROJECT_PATH_ROOT}\${env:PROJECT_PATH_SOURCE}\changelog\data" ` + "$(hestiaTIME-Format-Date-RPM "$PACKAGE_TIME")" ` + "${env:PROJECT_CONTACT_NAME}" ` + "${env:PROJECT_CONTACT_EMAIL}" ` + "${env:PROJECT_VERSION}" ` + "${env:PROJECT_CADENCE}" +if ($___process -ne ${env:hestiaKERNEL_ERROR_OK}) { + $null = hestiaCONSOLE-Log-Recreate-Failed + return ${env:hestiaKERNEL_ERROR_BAD_EXEC} +} -# prepare for parallel package -$__log_directory = "${env:PROJECT_PATH_ROOT}\${env:PROJECT_PATH_LOG}\packagers" -$null = I18N-Remake "${__log_directory}" -$null = FS-Remake-Directory "${__log_directory}" -$___process = FS-Is-Directory "${__log_directory}" -if ($___process -ne 0) { - $null = I18N-Remake-Failed - return 1 +# generate CITATION.cff +$FILE_CITATION_CFF = "${env:PROJECT_SKU}-CITATION_${env:PROJECT_VERSION}.cff" +$FILE_CITATION_CFF = "${env:PROJECT_PATH_ROOT}\${env:PROJECT_PATH_PKG}\${FILE_CITATION_CFF}" +$null = hestiaCONSOLE-Log-Recreate "$FILE_CITATION_CFF" +$___process = hestiaCITATION-Assemble ` + "$FILE_CITATION_CFF" ` + "${env:PROJECT_PATH_ROOT}\${env:PROJECT_PATH_SOURCE}\docs\ABSTRACTS.txt" ` + "${env:PROJECT_PATH_ROOT}\${env:PROJECT_PATH_SOURCE}\docs\CITATIONS.yml" ` + "${env:PROJECT_CITATION}" ` + "${env:PROJECT_CITATION_TYPE}" ` + "$(hestiaTIME-Format-Date-ISO8601 "${PACKAGE_TIME}")" ` + "${env:PROJECT_NAME}" ` + "${env:PROJECT_VERSION}" ` + "${env:PROJECT_LICENSE}" ` + "${env:PROJECT_SOURCE_URL}" ` + "${env:PROJECT_SOURCE_URL}" ` + "${env:PROJECT_STATIC_URL}" ` + "${env:PROJECT_CONTACT_NAME}" ` + "${env:PROJECT_CONTACT_WEBSITE}" ` + "${env:PROJECT_CONTACT_EMAIL}" +if ($___process -ne ${env:hestiaKERNEL_ERROR_OK}) { + $null = hestiaCONSOLE-Log-Recreate-Failed + return ${env:hestiaKERNEL_ERROR_BAD_EXEC} } -$__control_directory = "${env:PROJECT_PATH_ROOT}\${env:PROJECT_PATH_TEMP}\packagers-parallel" -$null = I18N-Remake "${__control_directory}" -$null = FS-Remake-Directory "${__control_directory}" -$___process = FS-Is-Directory "${__control_directory}" -if ($___process -ne 0) { - $null = I18N-Remake-Failed - return 1 +# clean up log directory +$DIRECTORY_LOG = "${env:PROJECT_PATH_ROOT}\${env:PROJECT_PATH_LOG}\packagers" +$null = hestiaCONSOLE-Log-Recreate "${DIRECTORY_LOG}" +$___process = hestiaFS-Recreate-Directory "${DIRECTORY_LOG}" +if ($___process -ne ${env:hestiaKERNEL_ERROR_OK}) { + $null = hestiaCONSOLE-Log-Recreate-Failed + return ${env:hestiaKERNEL_ERROR_BAD_EXEC} } -$__parallel_control = "${__control_directory}\control-parallel.txt" -$null = FS-Remove-Silently "${__parallel_control}" +# clean up parallel control directory +$DIRECTORY_PARALLEL = "${env:PROJECT_PATH_ROOT}\${env:PROJECT_PATH_TEMP}\packagers-parallel" +$null = hestiaCONSOLE-Log-Recreate "${DIRECTORY_PARALLEL}" +$___process = hestiaFS-Recreate-Directory "${DIRECTORY_PARALLEL}" +if ($___process -ne ${env:hestiaKERNEL_ERROR_OK}) { + $null = hestiaCONSOLE-Log-Recreate-Failed + return ${env:hestiaKERNEL_ERROR_BAD_EXEC} +} -$__serial_control = "${__control_directory}\control-serial.txt" -$null = FS-Remove-Silently "${__serial_control}" +# clean up serial control directory +$DIRECTORY_SERIAL = "${env:PROJECT_PATH_ROOT}\${env:PROJECT_PATH_TEMP}\packagers-serial" +$null = hestiaCONSOLE-Log-Recreate "${DIRECTORY_SERIAL}" +$___process = hestiaFS-Recreate-Directory "${DIRECTORY_SERIAL}" +if ($___process -ne ${env:hestiaKERNEL_ERROR_OK}) { + $null = hestiaCONSOLE-Log-Recreate-Failed + return ${env:hestiaKERNEL_ERROR_BAD_EXEC} +} +# setup subroutine function for parallel executions function SUBROUTINE-Package { - param( - [string]$__line - ) - - - # initialize libraries from scratch - $null = . "${env:LIBS_AUTOMATACI}\services\io\fs.ps1" - $null = . "${env:LIBS_AUTOMATACI}\services\io\strings.ps1" - $null = . "${env:LIBS_AUTOMATACI}\services\i18n\translations.ps1" - - $null = . "${env:LIBS_AUTOMATACI}\_package-archive_windows-any.ps1" - $null = . "${env:LIBS_AUTOMATACI}\_package-cargo_windows-any.ps1" - $null = . "${env:LIBS_AUTOMATACI}\_package-changelog_windows-any.ps1" - $null = . "${env:LIBS_AUTOMATACI}\_package-chocolatey_windows-any.ps1" - $null = . "${env:LIBS_AUTOMATACI}\_package-deb_windows-any.ps1" - $null = . "${env:LIBS_AUTOMATACI}\_package-docker_windows-any.ps1" - $null = . "${env:LIBS_AUTOMATACI}\_package-flatpak_windows-any.ps1" - $null = . "${env:LIBS_AUTOMATACI}\_package-homebrew_windows-any.ps1" - $null = . "${env:LIBS_AUTOMATACI}\_package-ipk_windows-any.ps1" - $null = . "${env:LIBS_AUTOMATACI}\_package-lib_windows-any.ps1" - $null = . "${env:LIBS_AUTOMATACI}\_package-msi_windows-any.ps1" - - $null = . "${env:LIBS_AUTOMATACI}\_package-pypi_windows-any.ps1" - $null = . "${env:LIBS_AUTOMATACI}\_package-rpm_windows-any.ps1" - $null = . "${env:LIBS_AUTOMATACI}\_package-sourcing_windows-any.ps1" - - - # parse input - $__command = $__line.Split("|")[-1] - $__log = $__line.Split("|")[-2] - $__arguments = $__line.Split("|") - $__arguments = $__arguments[0..$($__arguments.Length - 3)] - $__arguments = $__arguments -Join "|" - - $__subject = Split-Path -Leaf -Path "${__log}" - $__subject = FS-Extension-Remove "${__subject}" "*" - - - # execute - $null = I18N-Package "${__subject}" - $null = FS-Remove-Silently "${__log}" - - try { - ${function:SUBROUTINE-Exec} = Get-Command ` - "${__command}" ` - -ErrorAction SilentlyContinue - $($___process = SUBROUTINE-Exec "${__arguments}") *> "${__log}" - } catch { - $___process = 1 - } - if ($___process -ne 0) { - $null = I18N-Package-Failed - return 1 - } - - - # report status - return 0 + param( + [string]$__line + ) + + + # parse input + $__arguments = $__line.Split("|") + $__filename = $__arguments[0] + $__target = $__arguments[1] + $__target_os = $__arguments[2] + $__target_arch = $__arguments[3] + $__package_time = $__arguments[4] + $__function = $__arguments[-1] + $__directory_log = $__arguments[-2] + $__directory_output = $__arguments[-3] + $__arguments = $__arguments[5..($__arguments.Length - 4)] -join "|" + + + # import required libraries + $null = . "${env:LIBS_AUTOMATACI}\services\hestiaKERNEL\Vanilla.sh.ps1" + + + # execute + switch ("${__function}") { + "PACKAGE-SINGLE" { + $__log = "${__directory_log}\single-${__filename}_${__target_os}-${__target_arch}.txt" + $null = . "${env:LIBS_AUTOMATACI}\_package-single_windows-any.ps1" + ${function:SUBROUTINE-Exec} = Get-Command "PACKAGE-SINGLE" -ErrorAction SilentlyContinue + } "PACKAGE-ARCHIVE" { + $__log = "${__directory_log}\archive-${__filename}_${__target_os}-${__target_arch}.txt" + } "PACKAGE-APP" { + $__log = "${__directory_log}\app-${__filename}_${__target_os}-${__target_arch}.txt" + } "PACKAGE-UNIX" { + $__log = "${__directory_log}\unix-${__filename}_${__target_os}-${__target_arch}.txt" + } "PACKAGE-WINDOWS" { + $__log = "${__directory_log}\windows-${__filename}_${__target_os}-${__target_arch}.txt" + } "PACKAGE-CONSOLIDATE" { + $__log = "${__directory_log}\consolidate-${__filename}_${__target_os}-${__target_arch}.txt" + } default { + return ${env:hestiaKERNEL_ERROR_BAD_EXEC} + }} + + + # execute + try { + $___process = SUBROUTINE-Exec "${__arguments}" ` + "${__filename}" ` + "${__target}" ` + "${__target_os}" ` + "${__target_arch}" ` + "${__package_time}" ` + "${__directory_output}" ` + "${__arguments}" + 2>> "${__log}" 3>> "${__log}" ` + 4>> "${__log}" 5>> "${__log}" ` + 6>> "${__log}" + } catch { + $___process = ${env:hestiaKERNEL_ERROR_BAD_EXEC} + } + if ($___process -ne ${env:hestiaKERNEL_ERROR_OK}) { + return ${env:hestiaKERNEL_ERROR_BAD_EXEC} + } + + + # report status + return ${env:hestiaKERNEL_ERROR_OK} } +# register built artifacts for parallel executions +if ($(hestiaFS-Is-Directory "${env:PROJECT_PATH_ROOT}\${env:PROJECT_PATH_BUILD}") -ne ${env:hestiaKERNEL_ERROR_OK}) { + # no artifacts at all - report status + $null = hestiaCONSOLE-Log-Success + return ${env:hestiaKERNEL_ERROR_OK} +} - -# begin registering packagers -if ($(FS-Is-Directory "${env:PROJECT_PATH_ROOT}\${env:PROJECT_PATH_BUILD}") -eq 0) { -foreach ($i in (Get-ChildItem -Path "${env:PROJECT_PATH_ROOT}\${env:PROJECT_PATH_BUILD}")) { - $i = $i.FullName - - $___process = FS-Is-File "$i" - if ($___process -ne 0) { - continue - } - - - # parse build candidate - $null = I18N-Detected "${i}" - $TARGET_FILENAME = Split-Path -Leaf $i - $TARGET_FILENAME = $TARGET_FILENAME -replace "\..*$" - $TARGET_OS = $TARGET_FILENAME -replace ".*_" - $TARGET_FILENAME = $TARGET_FILENAME -replace "_.*" - $TARGET_ARCH = $TARGET_OS -replace ".*-" - $TARGET_ARCH = $TARGET_ARCH -replace "\..*$" - $TARGET_OS = $TARGET_OS -replace "-.*" - $TARGET_OS = $TARGET_OS -replace "\..*$" - - if (($(STRINGS-Is-Empty "${TARGET_OS}") -eq 0) -or - ($(STRINGS-Is-Empty "${TARGET_ARCH}") -eq 0) -or - ($(STRINGS-Is-Empty "${TARGET_FILENAME}") -eq 0)) { - $null = I18N-File-Has-Bad-Stat-Skipped - continue - } - - $___process = STRINGS-Has-Prefix "${env:PROJECT_SKU}" "${TARGET_FILENAME}" - if ($___process -ne 0) { - $___process = STRINGS-Has-Prefix "lib${env:PROJECT_SKU}" "${TARGET_FILENAME}" - if ($___process -ne 0) { - $null = I18N-Is-Incompatible-Skipped "${TARGET_FILENAME}" - continue - } - } - - $__common = "${DEST}|${i}|${TARGET_FILENAME}|${TARGET_OS}|${TARGET_ARCH}" - - - # begin registrations - $null = I18N-Sync-Register "$i" - - if ($(STRINGS-Is-Empty "${env:PROJECT_RELEASE_ARCHIVE}") -ne 0) { - $__log = "archive_${TARGET_FILENAME}_${TARGET_OS}-${TARGET_ARCH}.log" - $__log = "${__log_directory}\${__log}" - $___process = FS-Append-File "${__parallel_control}" @" -${__common}|${__log}|PACKAGE-Run-ARCHIVE - -"@ - if ($___process -ne 0) { - return 1 - } - } - - if ($(STRINGS-Is-Empty "${env:PROJECT_RUST}") -ne 0) { - $__log = "cargo_${TARGET_FILENAME}_${TARGET_OS}-${TARGET_ARCH}.log" - $__log = "${__log_directory}\${__log}" - $___process = FS-Append-File "${__parallel_control}" @" -${__common}|${__log}|PACKAGE-Run-CARGO - -"@ - if ($___process -ne 0) { - return 1 - } - } - - # NOTE: chocolatey only serve windows - if ($(STRINGS-Is-Empty "${env:PROJECT_CHOCOLATEY_URL}") -ne 0) { - switch ("${TARGET_OS}") { - { $_ -in "any", "windows" } { - $__log = "chocolatey_${TARGET_FILENAME}_${TARGET_OS}-${TARGET_ARCH}.log" - $__log = "${__log_directory}\${__log}" - $___process = FS-Append-File "${__parallel_control}" @" -${__common}|${__log}|PACKAGE-Run-CHOCOLATEY - -"@ - if ($___process -ne 0) { - return 1 - } - } default { - }} - } - - # NOTE: deb does not work in windows or mac - if ($(STRINGS-Is-Empty "${env:PROJECT_DEB_URL}") -ne 0) { - switch ("${TARGET_OS}") { - { $_ -in "windows", "darwin" } { - $__log = "deb_${TARGET_FILENAME}_${TARGET_OS}-${TARGET_ARCH}.log" - $__log = "${__log_directory}\${__log}" - $___process = FS-Append-File "${__parallel_control}" @" -${__common}|${FILE_CHANGELOG_DEB}|${__log}|PACKAGE-Run-DEB - -"@ - if ($___process -ne 0) { - return 1 - } - } default { - }} - } - - # NOTE: container only server windows and linux - if ($(STRINGS-Is-Empty "${env:PROJECT_CONTAINER_REGISTRY}") -ne 0) { - switch ("${TARGET_OS}") { - { $_ -in "any", "linux", "windows" } { - $__log = "docker_${TARGET_FILENAME}_${TARGET_OS}-${TARGET_ARCH}.log" - $__log = "${__log_directory}\${__log}" - $___process = FS-Append-File "${__serial_control}" @" -${__common}|${__log}|PACKAGE-Run-DOCKER - -"@ - if ($___process -ne 0) { - return 1 - } - } default { - }} - } - - # NOTE: flatpak only serve linux - $___process = FLATPAK-Is-Available - if (($___process -eq 0) -and - ($(STRINGS-Is-Empty "${env:PROJECT_FLATPAK_URL}") -ne 0)) { - switch ("${TARGET_OS}") { - { $_ -in "any", "linux" } { - $__log = "flatpak_${TARGET_FILENAME}_${TARGET_OS}-${TARGET_ARCH}.log" - $__log = "${__log_directory}\${__log}" - $___process = FS-Append-File "${__serial_control}" @" -${__common}|${FLATPAK_REPO}|${__log}|PACKAGE-Run-FLATPAK - -"@ - if ($___process -ne 0) { - return 1 - } - } default { - }} - } - - # NOTE: homebrew only serve linux and mac - if ($(STRINGS-Is-Empty "${env:PROJECT_HOMEBREW_URL}") -ne 0) { - switch ("${TARGET_OS}") { - { $_ -in "any", "darwin", "linux" } { - $__log = "homebrew_${TARGET_FILENAME}_${TARGET_OS}-${TARGET_ARCH}.log" - $__log = "${__log_directory}\${__log}" - $___process = FS-Append-File "${__parallel_control}" @" -${__common}|${HOMEBREW_WORKSPACE}|${__log}|PACKAGE-Run-HOMEBREW - -"@ - if ($___process -ne 0) { - return 1 - } - } default { - }} - } - - if ($(STRINGS-Is-Empty "${env:PROJECT_RELEASE_IPK}") -ne 0) { - $__log = "ipk_${TARGET_FILENAME}_${TARGET_OS}-${TARGET_ARCH}.log" - $__log = "${__log_directory}\${__log}" - $___process = FS-Append-File "${__parallel_control}" @" -${__common}|${__log}|PACKAGE-Run-IPK +foreach ($__artifact in (Get-ChildItem -Path "${env:PROJECT_PATH_ROOT}\${env:PROJECT_PATH_BUILD}")) { + $__artifact = $__artifact.FullName + if ($(hestiaFS-Is-File "${__artifact}") -ne ${env:hestiaKERNEL_ERROR_OK}) { + continue + } + + + # parse build candidate + $TARGET_FILENAME = hestiaFS-Get-File "${__artifact}" + $TARGET_FILENAME = $TARGET_FILENAME -replace "\..*$" + $TARGET_OS = $TARGET_FILENAME -replace ".*_" + $TARGET_FILENAME = $TARGET_FILENAME -replace "_.*" + $TARGET_ARCH = $TARGET_OS -replace ".*-" + $TARGET_ARCH = $TARGET_ARCH -replace "\..*$" + $TARGET_OS = $TARGET_OS -replace "-.*" + $TARGET_OS = $TARGET_OS -replace "\..*$" + $TAG_COMMON = "${TARGET_FILENAME}|${__artifact}|${TARGET_OS}|${TARGET_ARCH}|${PACKAGE_TIME}" + + if ( + ($(hestiaSTRING-Is-Empty "${TARGET_OS}") -eq ${env:hestiaKERNEL_ERROR_OK}) -or + ($(hestiaSTRING-Is-Empty "${TARGET_ARCH}") -eq ${env:hestiaKERNEL_ERROR_OK}) -or + ($(hestiaSTRING-Is-Empty "${TARGET_FILENAME}") -eq ${env:hestiaKERNEL_ERROR_OK}) + ) { + continue + } + + + # register classcial single / archive packages + $___process = hestiaFS-Append-File "${DIRECTORY_PARALLEL}/control.txt" @" +${TAG_COMMON}|${DIRECTORY_OUTPUT}|${DIRECTORY_LOG}|PACKAGE-SINGLE "@ - if ($___process -ne 0) { - return 1 - } - } - - if (($(FS-Is-Target-A-Library "${i}") -eq 0) -and - ($(STRINGS-Is-Empty "${env:PROJECT_RELEASE_ARCHIVE}") -ne 0)) { - $__log = "lib_${TARGET_FILENAME}_${TARGET_OS}-${TARGET_ARCH}.log" - $__log = "${__log_directory}\${__log}" - $___process = FS-Append-File "${__parallel_control}" @" -${__common}|${__log}|PACKAGE-Run-LIB + if ($___process -ne ${env:hestiaKERNEL_ERROR_OK}) { + return ${env:hestiaKERNEL_ERROR_BAD_EXEC} + } -"@ - if ($___process -ne 0) { - return 1 - } - } - - # NOTE: MSI only works in windows - if ($(STRINGS-Is-Empty "${env:PROJECT_MSI_INSTALL_DIRECTORY}") -ne 0) { - switch ("${TARGET_OS}") { - { $_ -in "any", "windows" } { - $__log = "msi_${TARGET_FILENAME}_${TARGET_OS}-${TARGET_ARCH}.log" - $__log = "${__log_directory}\${__log}" - $___process = FS-Append-File "${__parallel_control}" @" -${__common}|${MSI_WORKSPACE}|${__log}|PACKAGE-Run-MSI -"@ - if ($___process -ne 0) { - return 1 - } - } default { - }} - } - - if ($(FS-Is-Target-A-PDF "${i}") -eq 0) { - $__log = "PDF_${TARGET_FILENAME}_${TARGET_OS}-${TARGET_ARCH}.log" - $__log = "${__log_directory}\${__log}" - $___process = FS-Append-File "${__parallel_control}" @" -${__common}|${__log}|PACKAGE-Run-PDF + # register app-only sandboxed|containerized packages -"@ - if ($___process -ne 0) { - return 1 - } - } - if ($(STRINGS-Is-Empty "${env:PROJECT_PYTHON}") -ne 0) { - $__log = "pypi_${TARGET_FILENAME}_${TARGET_OS}-${TARGET_ARCH}.log" - $__log = "${__log_directory}\${__log}" - $___process = FS-Append-File "${__parallel_control}" @" -${__common}|${__log}|PACKAGE-Run-PYPI + # register unix OS packages -"@ - if ($___process -ne 0) { - return 1 - } - } - - # NOTE: RPM only serve linux - if ($(STRINGS-Is-Empty "${env:PROJECT_RPM_URL}") -ne 0) { - switch ("${TARGET_OS}") { - { $_ -in "any", "linux" } { - $__log = "rpm_${TARGET_FILENAME}_${TARGET_OS}-${TARGET_ARCH}.log" - $__log = "${__log_directory}\${__log}" - $___process = FS-Append-File "${__parallel_control}" @" -${__common}|${__log}|PACKAGE-Run-RPM -"@ - if ($___process -ne 0) { - return 1 - } - } default { - }} - } -} -} + # register windows OS packages -$null = I18N-Sync-Run -$___process = FS-Is-File "${__parallel_control}" -if ($___process -eq 0) { - $___process = SYNC-Exec-Parallel ` - ${function:SUBROUTINE-Package}.ToString() ` - "${__parallel_control}" ` - "${__control_directory}" - if ($___process -ne 0) { - $null = I18N-Sync-Failed - return 1 - } + # register consolidation packages } -if ($(STRINGS-Is-Empty "${env:PROJECT_HOMEBREW_URL}") -ne 0) { - $null = I18N-Newline - $null = I18N-Newline - - $__dest = "${env:PROJECT_SKU}.rb" - $null = I18N-Export "${__dest}" - $__dest = "${env:PROJECT_PATH_ROOT}\${env:PROJECT_PATH_PKG}\${__dest}" - $___process = HOMEBREW-Seal "${__dest}" ` - "${env:PROJECT_SKU}-homebrew_${env:PROJECT_VERSION}_any-any.tar.xz" ` - "${HOMEBREW_WORKSPACE}" ` - "${env:PROJECT_SKU}" ` - "${env:PROJECT_PITCH}" ` - "${env:PROJECT_CONTACT_WEBSITE}" ` - "${env:PROJECT_LICENSE}" ` - "${env:PROJECT_HOMEBREW_URL}" - if ($___process -ne 0) { - $null = I18N-Export-Failed - return 1 - } +# execute in parallel +$null = hestiaCONSOLE-Log-Run "$DIRECTORY_PARALLEL" +if ($(hestiaFS-Is-File "${DIRECTORY_PARALLEL}\control.txt") -eq ${env:hestiaKERNEL_ERROR_OK}) { + $___process = hestiaKERNEL-Run-Parallel-Sentinel ` + ${function:SUBROUTINE-Package}.ToString() ` + "$DIRECTORY_PARALLEL" + if ($___process -ne ${env:hestiaKERNEL_ERROR_OK}) { + $null = hestiaCONSOLE-Log-Run-Failed + return ${env:hestiaKERNEL_ERROR_BAD_EXEC} + } } -if ($(STRINGS-Is-Empty "${env:PROJECT_MSI_INSTALL_DIRECTORY}") -ne 0) { - $null = I18N-Newline - $null = I18N-Newline - +# execute consolidated packages - # sort 'any' arch into others - $___process = PACKAGE-Sort-MSI "${MSI_WORKSPACE}" - if ($___process -ne 0) { - return 1 - } - # seal all MSI packages - foreach ($_candidate in (Get-ChildItem -Path "${MSI_WORKSPACE}" -Directory)) { - $_candidate = $_candidate.FullName - - $null = I18N-Newline - - $___process = PACKAGE-Seal-MSI ` - "${_candidate}" ` - "${env:PROJECT_PATH_ROOT}\${env:PROJECT_PATH_PKG}" - if ($___process -ne 0) { - return 1 - } - } +# execute in serial +$null = hestiaCONSOLE-Log-Run "$DIRECTORY_SERIAL" +if ($(hestiaFS-Is-File "${DIRECTORY_SERIAL}\control.txt") -eq ${env:hestiaKERNEL_ERROR_OK}) { + $___process = hestiaKERNEL-Run-Parallel-Sentinel ` + ${function:SUBROUTINE-Package}.ToString() ` + "$DIRECTORY_SERIAL" ` + "1" + if ($___process -ne ${env:hestiaKERNEL_ERROR_OK}) { + $null = hestiaCONSOLE-Log-Run-Failed + return ${env:hestiaKERNEL_ERROR_BAD_EXEC} + } } -$null = I18N-Sync-Run-Series -$___process = FS-Is-File "${__serial_control}" -if ($___process -eq 0) { - $___process = SYNC-Exec-Serial ` - ${function:SUBROUTINE-Package}.ToString() ` - "${__serial_control}" - if ($___process -ne 0) { - $null = I18N-Sync-Failed - return 1 - } -} - - - - # report status -$null = I18N-Run-Successful -return 0 +$null = hestiaCONSOLE-Log-Success +return ${env:hestiaKERNEL_ERROR_OK} 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/hestiaCHANGELOG/Assemble_DEB.sh.ps1 b/automataCI/services/hestiaCHANGELOG/Assemble_DEB.sh.ps1 new file mode 100644 index 0000000..ace940d --- /dev/null +++ b/automataCI/services/hestiaCHANGELOG/Assemble_DEB.sh.ps1 @@ -0,0 +1,254 @@ +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\Vanilla.sh.ps1" +. "${env:LIBS_HESTIA}\hestiaGIT\Is_Available.sh.ps1" +. "${env:LIBS_HESTIA}\hestiaGZ\Compress.sh.ps1" +. "${env:LIBS_HESTIA}\hestiaKERNEL\Vanilla.sh.ps1" +. "${env:LIBS_HESTIA}\hestiaSTRING\Is_Empty.sh.ps1" + + + + +function hestiaCHANGELOG-Assemble-DEB { + param ( + [string]$___filepath, + [string]$___data_directory, + [string]$___version + ) + + + # validate input + if ($(hestiaGIT-Is-Available) -ne ${env:hestiaKERNEL_ERROR_OK}) { + return ${env:hestiaKERNEL_ERROR_NOT_POSSIBLE} + } + + if ($(hestiaSTRING-Is-Empty "${___filepath}") -eq ${env:hestiaKERNEL_ERROR_OK}) { + return ${env:hestiaKERNEL_ERROR_ENTITY_EMPTY} + } + + if ($(hestiaSTRING-Is-Empty "${___data_directory}") -eq ${env:hestiaKERNEL_ERROR_OK}) { + return ${env:hestiaKERNEL_ERROR_DATA_EMPTY} + } + + if ($(hestiaSTRING-Is-Empty "${___version}") -eq ${env:hestiaKERNEL_ERROR_OK}) { + return ${env:hestiaKERNEL_ERROR_DATA_EMPTY} + } + + if ( + ($(hestiaFS-Is-File "${___filepath}") -eq ${env:hestiaKERNEL_ERROR_OK}) -or + ($(hestiaFS-Is-File "${___filepath}.gz") -eq ${env:hestiaKERNEL_ERROR_OK}) + ) { + return ${env:hestiaKERNEL_ERROR_ENTITY_EXIST} + } + + if ($(hestiaFS-Is-Directory "${___data_directory}") -ne ${env:hestiaKERNEL_ERROR_OK}) { + return ${env:hestiaKERNEL_ERROR_DATA_IS_NOT_DIRECTORY} + } + + + # execute + $null = hestiaFS-Create-Directory "$(hestiaFS-Get-Directory "${___filepath}")" + + + # write the latest first + if ($(hestiaFS-Is-File "${___data_directory}\latest") -ne ${env:hestiaKERNEL_ERROR_OK}) { + return ${env:hestiaKERNEL_ERROR_DATA_INVALID} + } + + $___initiated = ${env:hestiaKERNEL_DATA_MISSING} + foreach ($___line in (Get-Content "${___data_directory}\latest")) { + $___process = hestiaFS-Append-File "${___filepath}" "${___line}`n" + if ($___process -ne ${env:hestiaKERNEL_ERROR_OK}) { + return ${env:hestiaKERNEL_ERROR_BAD_EXEC} + } + + $___initiated = ${env:hestiaKERNEL_ERROR_OK} + } + + + # loop through each git tag and append accordingly + foreach ($___tag in (Invoke-Expression "git tag --sort -version:refname")) { + if ($(hestiaFS-Is-File "${___data_directory}\$($___tag -replace ".*v", '')") -ne ${env:hestiaKERNEL_ERROR_OK}) { + return ${env:hestiaKERNEL_ERROR_DATA_INVALID} + } + + foreach ($___line in (Get-Content "${___data_directory}\$($___tag -replace ".*v", '')")) { + $___process = hestiaFS-Append-File "${___filepath}" "${___line}`n" + if ($___process -ne ${env:hestiaKERNEL_ERROR_OK}) { + return ${env:hestiaKERNEL_ERROR_BAD_EXEC} + } + + if ($___initiated -eq ${env:hestiaKERNEL_ERROR_OK}) { + $___process = hestiaFS-Append-File "${___filepath}" "`n`n" + if ($___process -ne ${env:hestiaKERNEL_ERROR_OK}) { + return ${env:hestiaKERNEL_ERROR_BAD_EXEC} + } + } + + $___initiated = ${env:hestiaKERNEL_ERROR_OK} + } + } + + + # gunzip the target + $___process = hestiaGZ-Compress "${___filepath}" + 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}/hestiaFS/Vanilla.sh.ps1" +. "${LIBS_HESTIA}/hestiaGIT/Is_Available.sh.ps1" +. "${LIBS_HESTIA}/hestiaGZ/Compress.sh.ps1" +. "${LIBS_HESTIA}/hestiaKERNEL/Vanilla.sh.ps1" +. "${LIBS_HESTIA}/hestiaSTRING/Is_Empty.sh.ps1" + + + + +hestiaCHANGELOG_Assemble_DEB() { + #___filepath="$1" + #___data_directory="$2" + #___version="$3" + + + # validate input + if [ $(hestiaGIT_Is_Available) -ne $hestiaKERNEL_ERROR_OK ]; then + return $hestiaKERNEL_ERROR_NOT_POSSIBLE + fi + + if [ $(hestiaSTRING_Is_Empty "$1") -eq $hestiaKERNEL_ERROR_OK ]; then + return $hestiaKERNEL_ERROR_ENTITY_EMPTY + fi + + if [ $(hestiaSTRING_Is_Empty "$2") -eq $hestiaKERNEL_ERROR_OK ]; then + return $hestiaKERNEL_ERROR_DATA_EMPTY + fi + + if [ $(hestiaSTRING_Is_Empty "$3") -eq $hestiaKERNEL_ERROR_OK ]; then + return $hestiaKERNEL_ERROR_DATA_EMPTY + fi + + if [ $(hestiaFS_Is_File "$1") -eq $hestiaKERNEL_ERROR_OK ] || + [ $(hestiaFS_Is_File "${1}.gz") -eq $hestiaKERNEL_ERROR_OK ]; then + return $hestiaKERNEL_ERROR_ENTITY_EXIST + fi + + if [ $(hestiaFS_Is_Directory "$2") -ne $hestiaKERNEL_ERROR_OK ]; then + return $hestiaKERNEL_ERROR_DATA_IS_NOT_DIRECTORY + fi + + + # execute + hestiaFS_Create_Directory "$(hestiaFS_Get_Directory "$1")" + + + # write the latest first + if [ $(hestiaFS_Is_File "${2}/latest") -ne $hestiaKERNEL_ERROR_OK ]; then + return $hestiaKERNEL_ERROR_DATA_INVALID + fi + + ___initiated=$hestiaKERNEL_DATA_MISSING + ___old_IFS="$IFS" + while IFS="" read -r ___line || [ -n "$___line" ]; do + hestiaFS_Append_File "$1" "${___line}\n" + if [ $? -ne $hestiaKERNEL_ERROR_OK ]; then + return $hestiaKERNEL_ERROR_BAD_EXEC + fi + + ___initiated=$hestiaKERNEL_ERROR_OK + done < "${2}/latest" + IFS="$___old_IFS" + unset ___old_IFS + + + # loop through each git tag and append accordingly + for ___tag in $(git tag --sort -version:refname); do + if [ $(hestiaFS_Is_File "${2}/${___tag##*v}") -ne $hestiaKERNEL_ERROR_OK ]; then + return $hestiaKERNEL_ERROR_DATA_INVALID + fi + + if [ $___initiated -eq $hestiaKERNEL_ERROR_OK ]; then + hestiaFS_Append_File "$1" "\n\n" + if [ $? -ne $hestiaKERNEL_ERROR_OK ]; then + return $hestiaKERNEL_ERROR_BAD_EXEC + fi + fi + + ___old_IFS="$IFS" + while IFS="" read -r ___line || [ -n "$___line" ]; do + hestiaFS_Append_File "$1" "${___line}\n" + if [ $? -ne $hestiaKERNEL_ERROR_OK ]; then + return $hestiaKERNEL_ERROR_BAD_EXEC + fi + + ___initiated=$hestiaKERNEL_ERROR_OK + done < "${2}/${___tag##*v}" + IFS="$___old_IFS" + unset ___old_IFS + done + + + # gunzip the target + hestiaGZ_Compress "$1" + 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/hestiaCHANGELOG/Assemble_MARKDOWN.sh.ps1 b/automataCI/services/hestiaCHANGELOG/Assemble_MARKDOWN.sh.ps1 new file mode 100644 index 0000000..3b4b140 --- /dev/null +++ b/automataCI/services/hestiaCHANGELOG/Assemble_MARKDOWN.sh.ps1 @@ -0,0 +1,248 @@ +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\Vanilla.sh.ps1" +. "${env:LIBS_HESTIA}\hestiaGIT\Is_Available.sh.ps1" +. "${env:LIBS_HESTIA}\hestiaKERNEL\Vanilla.sh.ps1" +. "${env:LIBS_HESTIA}\hestiaSTRING\Is_Empty.sh.ps1" + + + + +function hestiaCHANGELOG-Assemble-MARKDOWN { + param ( + [string]$___filepath, + [string]$___data_directory, + [string]$___title, + [string]$___version + ) + + + # validate input + if ($(hestiaGIT-Is-Available) -ne ${env:hestiaKERNEL_ERROR_OK}) { + return ${env:hestiaKERNEL_ERROR_NOT_POSSIBLE} + } + + if ($(hestiaSTRING-Is-Empty "${___filepath}") -eq ${env:hestiaKERNEL_ERROR_OK}) { + return ${env:hestiaKERNEL_ERROR_ENTITY_EMPTY} + } + + if ($(hestiaSTRING-Is-Empty "${___data_directory}") -eq ${env:hestiaKERNEL_ERROR_OK}) { + return ${env:hestiaKERNEL_ERROR_DATA_EMPTY} + } + + if ($(hestiaSTRING-Is-Empty "${___title}") -eq ${env:hestiaKERNEL_ERROR_OK}) { + return ${env:hestiaKERNEL_ERROR_DATA_EMPTY} + } + + if ($(hestiaSTRING-Is-Empty "${___version}") -eq ${env:hestiaKERNEL_ERROR_OK}) { + return ${env:hestiaKERNEL_ERROR_DATA_EMPTY} + } + + if ($(hestiaFS-Is-File "${___filepath}") -eq ${env:hestiaKERNEL_ERROR_OK}) { + return ${env:hestiaKERNEL_ERROR_ENTITY_EXIST} + } + + if ($(hestiaFS-Is-Directory "${___data_directory}") -ne ${env:hestiaKERNEL_ERROR_OK}) { + return ${env:hestiaKERNEL_ERROR_DATA_IS_NOT_DIRECTORY} + } + + + # execute + $null = hestiaFS-Create-Directory "$(hestiaFS-Get-Directory "${___filepath}")" + $___process = hestiaFS-Write-File "${___filepath}" "# ${___title}`n`n" + if ($___process -ne ${env:hestiaKERNEL_ERROR_OK}) { + return ${env:hestiaKERNEL_ERROR_BAD_EXEC} + } + + + # write the latest first + if ($(hestiaFS-Is-File "${___data_directory}\latest") -ne ${env:hestiaKERNEL_ERROR_OK}) { + return ${env:hestiaKERNEL_ERROR_DATA_INVALID} + } + + $___process = hestiaFS-Append-File "${___filepath}" "`n## ${___version}`n`n" + if ($___process -ne ${env:hestiaKERNEL_ERROR_OK}) { + return ${env:hestiaKERNEL_ERROR_BAD_EXEC} + } + + foreach ($___line in (Get-Content "${___data_directory}\latest")) { + $___process = hestiaFS-Append-File "${___filepath}" "* ${___line}`n" + if ($___process -ne ${env:hestiaKERNEL_ERROR_OK}) { + return ${env:hestiaKERNEL_ERROR_BAD_EXEC} + } + } + + + # loop through each git tag and append accordingly + foreach ($___tag in (Invoke-Expression "git tag --sort -version:refname")) { + if ($(hestiaFS-Is-File "${___data_directory}\$($___tag -replace ".*v", '')") -ne ${env:hestiaKERNEL_ERROR_OK}) { + return ${env:hestiaKERNEL_ERROR_DATA_INVALID} + } + + $___process = hestiaFS-Append-File "${___filepath}" "`n`n## ${___tag}`n`n" + if ($___process -ne ${env:hestiaKERNEL_ERROR_OK}) { + return ${env:hestiaKERNEL_ERROR_BAD_EXEC} + } + + foreach ($___line in (Get-Content "${___data_directory}\$($___tag -replace ".*v", '')")) { + $___process = hestiaFS-Append-File "${___filepath}" "* ${___line}`n" + 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}/hestiaFS/Vanilla.sh.ps1" +. "${LIBS_HESTIA}/hestiaGIT/Is_Available.sh.ps1" +. "${LIBS_HESTIA}/hestiaKERNEL/Vanilla.sh.ps1" +. "${LIBS_HESTIA}/hestiaSTRING/Is_Empty.sh.ps1" + + + + +hestiaCHANGELOG_Assemble_MARKDOWN() { + #___filepath="$1" + #___data_directory="$2" + #___title="$3" + #___version="$4" + + + # validate input + if [ $(hestiaGIT_Is_Available) -ne $hestiaKERNEL_ERROR_OK ]; then + return $hestiaKERNEL_ERROR_NOT_POSSIBLE + fi + + if [ $(hestiaSTRING_Is_Empty "$1") -eq $hestiaKERNEL_ERROR_OK ]; then + return $hestiaKERNEL_ERROR_ENTITY_EMPTY + fi + + if [ $(hestiaSTRING_Is_Empty "$2") -eq $hestiaKERNEL_ERROR_OK ]; then + return $hestiaKERNEL_ERROR_DATA_EMPTY + fi + + if [ $(hestiaSTRING_Is_Empty "$3") -eq $hestiaKERNEL_ERROR_OK ]; then + return $hestiaKERNEL_ERROR_DATA_EMPTY + fi + + if [ $(hestiaSTRING_Is_Empty "$4") -eq $hestiaKERNEL_ERROR_OK ]; then + return $hestiaKERNEL_ERROR_DATA_EMPTY + fi + + if [ $(hestiaFS_Is_File "$1") -eq $hestiaKERNEL_ERROR_OK ]; then + return $hestiaKERNEL_ERROR_ENTITY_EXIST + fi + + if [ $(hestiaFS_Is_Directory "$2") -ne $hestiaKERNEL_ERROR_OK ]; then + return $hestiaKERNEL_ERROR_DATA_IS_NOT_DIRECTORY + fi + + + # execute + hestiaFS_Create_Directory "$(hestiaFS_Get_Directory "$1")" + hestiaFS_Write_File "$1" "# ${3}\n\n" + if [ $? -ne $hestiaKERNEL_ERROR_OK ]; then + return $hestiaKERNEL_ERROR_BAD_EXEC + fi + + + # write the latest first + if [ $(hestiaFS_Is_File "${2}/latest") -ne $hestiaKERNEL_ERROR_OK ]; then + return $hestiaKERNEL_ERROR_DATA_INVALID + fi + + hestiaFS_Append_File "$1" "\n## ${4}\n\n" + if [ $? -ne $hestiaKERNEL_ERROR_OK ]; then + return $hestiaKERNEL_ERROR_BAD_EXEC + fi + + ___old_IFS="$IFS" + while IFS="" read -r ___line || [ -n "$___line" ]; do + hestiaFS_Append_File "$1" "* ${___line}\n" + if [ $? -ne $hestiaKERNEL_ERROR_OK ]; then + return $hestiaKERNEL_ERROR_BAD_EXEC + fi + done < "${2}/latest" + IFS="$___old_IFS" + unset ___old_IFS + + + # loop through each git tag and append accordingly + for ___tag in $(git tag --sort -version:refname); do + if [ $(hestiaFS_Is_File "${2}/${___tag##*v}") -ne $hestiaKERNEL_ERROR_OK ]; then + return $hestiaKERNEL_ERROR_DATA_INVALID + fi + + hestiaFS_Append_File "$1" "\n\n## ${___tag}\n\n" + if [ $? -ne $hestiaKERNEL_ERROR_OK ]; then + return $hestiaKERNEL_ERROR_BAD_EXEC + fi + + ___old_IFS="$IFS" + while IFS="" read -r ___line || [ -n "$___line" ]; do + hestiaFS_Append_File "$1" "* ${___line}\n" + if [ $? -ne $hestiaKERNEL_ERROR_OK ]; then + return $hestiaKERNEL_ERROR_BAD_EXEC + fi + done < "${2}/${___tag##*v}" + IFS="$___old_IFS" + unset ___old_IFS + done + + + # report status + return $hestiaKERNEL_ERROR_OK +} +################################################################################ +# Unix Main Codes # +################################################################################ +return 0 +#> diff --git a/automataCI/services/hestiaCHANGELOG/Assemble_RPM.sh.ps1 b/automataCI/services/hestiaCHANGELOG/Assemble_RPM.sh.ps1 new file mode 100644 index 0000000..49c4432 --- /dev/null +++ b/automataCI/services/hestiaCHANGELOG/Assemble_RPM.sh.ps1 @@ -0,0 +1,264 @@ +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\Vanilla.sh.ps1" +. "${env:LIBS_HESTIA}\hestiaKERNEL\Vanilla.sh.ps1" +. "${env:LIBS_HESTIA}\hestiaSTRING\Is_Empty.sh.ps1" + + + + +function hestiaCHANGELOG-Assemble-RPM { + param ( + [string]$___filepath, + [string]$___data_directory, + [string]$___date, + [string]$___name, + [string]$___email, + [string]$___version, + [string]$___cadence + ) + + + # validate input + if ($(hestiaSTRING-Is-Empty "${___filepath}") -eq ${env:hestiaKERNEL_ERROR_OK}) { + return ${env:hestiaKERNEL_ERROR_ENTITY_EMPTY} + } + + if ($(hestiaSTRING-Is-Empty "${___data_directory}") -eq ${env:hestiaKERNEL_ERROR_OK}) { + return ${env:hestiaKERNEL_ERROR_DATA_EMPTY} + } + + if ($(hestiaSTRING-Is-Empty "${___date}") -eq ${env:hestiaKERNEL_ERROR_OK}) { + return ${env:hestiaKERNEL_ERROR_DATA_EMPTY} + } + + if ($(hestiaSTRING-Is-Empty "${___name}") -eq ${env:hestiaKERNEL_ERROR_OK}) { + return ${env:hestiaKERNEL_ERROR_DATA_EMPTY} + } + + if ($(hestiaSTRING-Is-Empty "${___email}") -eq ${env:hestiaKERNEL_ERROR_OK}) { + return ${env:hestiaKERNEL_ERROR_DATA_EMPTY} + } + + if ($(hestiaSTRING-Is-Empty "${___version}") -eq ${env:hestiaKERNEL_ERROR_OK}) { + return ${env:hestiaKERNEL_ERROR_DATA_EMPTY} + } + + if ($(hestiaSTRING-Is-Empty "${___cadence}") -eq ${env:hestiaKERNEL_ERROR_OK}) { + return ${env:hestiaKERNEL_ERROR_DATA_EMPTY} + } + + if ( + ($(hestiaFS-Is-File "${___filepath}") -eq ${env:hestiaKERNEL_ERROR_OK}) -or + ($(hestiaFS-Is-File "${___filepath}.gz") -eq ${env:hestiaKERNEL_ERROR_OK}) + ) { + return ${env:hestiaKERNEL_ERROR_ENTITY_EXIST} + } + + if ($(hestiaFS-Is-Directory "${___data_directory}") -ne ${env:hestiaKERNEL_ERROR_OK}) { + return ${env:hestiaKERNEL_ERROR_DATA_IS_NOT_DIRECTORY} + } + + + # execute + $null = hestiaFS-Create-Directory "$(hestiaFS-Get-Directory "${___filepath}")" + + + # emit stanza + $___process = hestiaFS-Write-File "${___filepath}" "%%changelog`n" + if ($___process -ne ${env:hestiaKERNEL_ERROR_OK}) { + return ${env:hestiaKERNEL_ERROR_BAD_EXEC} + } + + + # emit latest changelog + if ($(hestiaFS-Is-File "${___data_directory}\latest") -eq ${env:hestiaKERNEL_ERROR_OK}) { + $___process = hestiaFS-Append-File "${___filepath}" @" +* ${___date} ${___name} <${___email}> - ${___version}-${___cadence} + +"@ + if ($___process -ne ${env:hestiaKERNEL_ERROR_OK}) { + return ${env:hestiaKERNEL_ERROR_BAD_EXEC} + } + + foreach ($___line in (Get-Content "${___data_directory}\latest")) { + $___process = hestiaFS-Append-File "${___filepath}" "- ${___line}`n" + if ($___process -ne ${env:hestiaKERNEL_ERROR_OK}) { + return ${env:hestiaKERNEL_ERROR_BAD_EXEC} + } + } + } else { + $___process = hestiaFS-Append-File "${___filepath}" "# unavailable`n" + if ($___process -ne ${env:hestiaKERNEL_ERROR_OK}) { + return ${env:hestiaKERNEL_ERROR_BAD_EXEC} + } + } + + + # emit tailing newline + $___process = hestiaFS-Append-File "${___filepath}" "`n" + 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}/hestiaFS/Vanilla.sh.ps1" +. "${LIBS_HESTIA}/hestiaKERNEL/Vanilla.sh.ps1" +. "${LIBS_HESTIA}/hestiaSTRING/Is_Empty.sh.ps1" + + + + +hestiaCHANGELOG_Assemble_RPM() { + #___filepath="$1" + #___data_directory="$2" + #___date="$3" + #___name="$4" + #___email="$5" + #___version="$6" + #___cadence="$7" + + + # validate input + if [ $(hestiaSTRING_Is_Empty "$1") -eq $hestiaKERNEL_ERROR_OK ]; then + return $hestiaKERNEL_ERROR_ENTITY_EMPTY + fi + + if [ $(hestiaSTRING_Is_Empty "$2") -eq $hestiaKERNEL_ERROR_OK ]; then + return $hestiaKERNEL_ERROR_DATA_EMPTY + fi + + if [ $(hestiaSTRING_Is_Empty "$3") -eq $hestiaKERNEL_ERROR_OK ]; then + return $hestiaKERNEL_ERROR_DATA_EMPTY + fi + + if [ $(hestiaSTRING_Is_Empty "$4") -eq $hestiaKERNEL_ERROR_OK ]; then + return $hestiaKERNEL_ERROR_DATA_EMPTY + fi + + if [ $(hestiaSTRING_Is_Empty "$5") -eq $hestiaKERNEL_ERROR_OK ]; then + return $hestiaKERNEL_ERROR_DATA_EMPTY + fi + + if [ $(hestiaSTRING_Is_Empty "$6") -eq $hestiaKERNEL_ERROR_OK ]; then + return $hestiaKERNEL_ERROR_DATA_EMPTY + fi + + if [ $(hestiaSTRING_Is_Empty "$7") -eq $hestiaKERNEL_ERROR_OK ]; then + return $hestiaKERNEL_ERROR_DATA_EMPTY + fi + + if [ $(hestiaFS_Is_File "$1") -eq $hestiaKERNEL_ERROR_OK ]; then + return $hestiaKERNEL_ERROR_ENTITY_EXIST + fi + + if [ $(hestiaFS_Is_Directory "$2") -ne $hestiaKERNEL_ERROR_OK ]; then + return $hestiaKERNEL_ERROR_DATA_IS_NOT_DIRECTORY + fi + + + # execute + hestiaFS_Create_Directory "$(hestiaFS_Get_Directory "$1")" + + + # emit stanza + hestiaFS_Append_File "$1" "%%changelog\n" + if [ $? -ne $hestiaKERNEL_ERROR_OK ]; then + return $hestiaKERNEL_ERROR_BAD_EXEC + fi + + + # emit latest changelog + if [ $(hestiaFS_Is_File "${2}/latest") -eq $hestiaKERNEL_ERROR_OK ]; then + hestiaFS_Append_File "$1" "\ +* ${3} ${4} <${5}> - ${6}-${7} +" + if [ $? -ne $hestiaKERNEL_ERROR_OK ]; then + return $hestiaKERNEL_ERROR_BAD_EXEC + fi + + ___old_IFS="$IFS" + while IFS="" read -r ___line || [ -n "$___line" ]; do + ___line="${___line%%#*}" + if [ $(hestiaSTRING_Is_Empty "$___line") -eq $hestiaKERNEL_ERROR_OK ]; then + continue + fi + + hestiaFS_Append_File "$1" "- ${___line}\n" + if [ $? -ne $hestiaKERNEL_ERROR_OK ]; then + return $hestiaKERNEL_ERROR_BAD_EXEC + fi + done < "${2}/latest" + IFS="$___old_IFS" + unset ___old_IFS + else + hestiaFS_Append_File "$1" "# unavailable\n" + if [ $? -ne $hestiaKERNEL_ERROR_OK ]; then + return $hestiaKERNEL_ERROR_BAD_EXEC + fi + fi + + + # emit tailing newline + hestiaFS_Append_File "$1" "\n" + 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/hestiaCHANGELOG/Vanilla.sh.ps1 b/automataCI/services/hestiaCHANGELOG/Vanilla.sh.ps1 new file mode 100644 index 0000000..dc10ab2 --- /dev/null +++ b/automataCI/services/hestiaCHANGELOG/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}\hestiaCHANGELOG\Assemble_DEB.sh.ps1" +. "${env:LIBS_HESTIA}\hestiaCHANGELOG\Assemble_MARKDOWN.sh.ps1" +. "${env:LIBS_HESTIA}\hestiaCHANGELOG\Assemble_RPM.sh.ps1" +################################################################################ +# Windows POWERSHELL Codes # +################################################################################ +return +<# +RUN_AS_POWERSHELL + + + + +################################################################################ +# Unix Main Codes # +################################################################################ +. "${LIBS_HESTIA}/hestiaCHANGELOG/Assemble_DEB.sh.ps1" +. "${LIBS_HESTIA}/hestiaCHANGELOG/Assemble_MARKDOWN.sh.ps1" +. "${LIBS_HESTIA}/hestiaCHANGELOG/Assemble_RPM.sh.ps1" +################################################################################ +# Unix Main Codes # +################################################################################ +return 0 +#> diff --git a/automataCI/services/hestiaCITATION/Assemble.sh.ps1 b/automataCI/services/hestiaCITATION/Assemble.sh.ps1 new file mode 100644 index 0000000..bc39f61 --- /dev/null +++ b/automataCI/services/hestiaCITATION/Assemble.sh.ps1 @@ -0,0 +1,578 @@ +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\Vanilla.sh.ps1" +. "${env:LIBS_HESTIA}\hestiaKERNEL\Vanilla.sh.ps1" +. "${env:LIBS_HESTIA}\hestiaSTRING\Is_Empty.sh.ps1" + + + + +function hestiaCITATION-Assemble { + param( + [string]$___filepath, + [string]$___abstract_filepath, + [string]$___citation_filepath, + [string]$___cff_version, + [string]$___type, + [string]$___date, + [string]$___title, + [string]$___version, + [string]$___license, + [string]$___repo, + [string]$___repo_code, + [string]$___repo_artifact, + [string]$___contact_name, + [string]$___contact_website, + [string]$___contact_email + ) + + + # validate input + if ($(hestiaSTRING-Is-Empty "${___cff_version}") -eq ${env:hestiaKERNEL_ERROR_OK}) { + return ${env:hestiaKERNEL_ERROR_OK} # disabled by explicit request + } + + if ($(hestiaSTRING-Is-Empty "${___filepath}") -eq ${env:hestiaKERNEL_ERROR_OK}) { + return ${env:hestiaKERNEL_ERROR_ENTITY_EMPTY} + } + + if ($(hestiaSTRING-Is-Empty "${___abstract_filepath}") -eq ${env:hestiaKERNEL_ERROR_OK}) { + return ${env:hestiaKERNEL_ERROR_DATA_EMPTY} + } + + if ($(hestiaSTRING-Is-Empty "${___citation_filepath}") -eq ${env:hestiaKERNEL_ERROR_OK}) { + return ${env:hestiaKERNEL_ERROR_DATA_EMPTY} + } + + if ($(hestiaFS-Is-File "${___filepath}") -eq ${env:hestiaKERNEL_ERROR_OK}) { + return ${env:hestiaKERNEL_ERROR_ENTITY_EXIST} + } + + if ($(hestiaFS-Is-File "${___abstract_filepath}") -ne ${env:hestiaKERNEL_ERROR_OK}) { + return ${env:hestiaKERNEL_ERROR_DATA_IS_NOT_FILE} + } + + if ($(hestiaFS-Is-File "${___citation_filepath}") -ne ${env:hestiaKERNEL_ERROR_OK}) { + return ${env:hestiaKERNEL_ERROR_DATA_IS_NOT_FILE} + } + + if ($(hestiaSTRING-Is-Empty "${___type}") -eq ${env:hestiaKERNEL_ERROR_OK}) { + return ${env:hestiaKERNEL_ERROR_DATA_EMPTY} + } + + if ($(hestiaSTRING-Is-Empty "${___title}") -eq ${env:hestiaKERNEL_ERROR_OK}) { + return ${env:hestiaKERNEL_ERROR_DATA_EMPTY} + } + + + # execute + $null = hestiaFS-Create-Directory "$(hestiaFS-Get-Directory "${___filepath}")" + + + $___process = hestiaFS-Write-File "${___filepath}" @" +# WARNING: auto-generated by AutomataCI + +cff-version: `"${___cff_version}`" +type: `"${___type}`" + +"@ + if ($___process -ne ${env:hestiaKERNEL_ERROR_OK}) { + return ${env:hestiaKERNEL_ERROR_BAD_EXEC} + } + + + # write date field + if ($(hestiaSTRING-Is-Empty "${___date}") -ne ${env:hestiaKERNEL_ERROR_OK}) { + $___process = hestiaFS-Append-File "${___filepath}" @" +date-released: "${___date}" + +"@ + if ($___process -ne ${env:hestiaKERNEL_ERROR_OK}) { + return ${env:hestiaKERNEL_ERROR_BAD_EXEC} + } + } + + + # write title field + if ($(STRINGS-Is-Empty "${___title}") -ne ${env:hestiaKERNEL_ERROR_OK}) { + $___process = hestiaFS-Append-File "${___filepath}" @" +title: "${___title}" + +"@ + if ($___process -ne ${env:hestiaKERNEL_ERROR_OK}) { + return ${env:hestiaKERNEL_ERROR_BAD_EXEC} + } + } + + + # write version field + if ($(hestiaSTRING-Is-Empty "${___version}") -ne ${env:hestiaKERNEL_ERROR_OK}) { + $___process = hestiaFS-Append-File "${___filepath}" @" +version: "${___version}" + +"@ + if ($___process -ne ${env:hestiaKERNEL_ERROR_OK}) { + return ${env:hestiaKERNEL_ERROR_BAD_EXEC} + } + } + + + # write license field + if ($(hestiaSTRING-Is-Empty "${___license}") -ne ${env:hestiaKERNEL_ERROR_OK}) { + $___process = hestiaFS-Append-File "${___filepath}" @" +license: "${___license}" + +"@ + if ($___process -ne ${env:hestiaKERNEL_ERROR_OK}) { + return ${env:hestiaKERNEL_ERROR_BAD_EXEC} + } + } + + + # write repository field + if ($(hestiaSTRING-Is-Empty "${___repo}") -ne ${env:hestiaKERNEL_ERROR_OK}) { + $___process = hestiaFS-Append-File "${___filepath}" @" +repository: "${___repo}" + +"@ + if ($___process -ne ${env:hestiaKERNEL_ERROR_OK}) { + return ${env:hestiaKERNEL_ERROR_BAD_EXEC} + } + } + + + # write repository code field + if ($(hestiaSTRING-Is-Empty "${___repo_code}") -ne ${env:hestiaKERNEL_ERROR_OK}) { + $___process = hestiaFS-Append-File "${___filepath}" @" +repository-code: "${___repo_code}" + +"@ + if ($___process -ne ${env:hestiaKERNEL_ERROR_OK}) { + return ${env:hestiaKERNEL_ERROR_BAD_EXEC} + } + } + + + # write repository artifact field + if ($(hestiaSTRING-Is-Empty "${___repo_artifact}") -ne ${env:hestiaKERNEL_ERROR_OK}) { + $___process = hestiaFS-Append-File "${___filepath}" @" +repository-artifact: "${___repo_artifact}" + +"@ + if ($___process -ne ${env:hestiaKERNEL_ERROR_OK}) { + return ${env:hestiaKERNEL_ERROR_BAD_EXEC} + } + } + + + # write url field + if ($(hestiaSTRING-Is-Empty "${___contact_website}") -ne ${env:hestiaKERNEL_ERROR_OK}) { + $___process = hestiaFS-Append-File "${___filepath}" @" +url: "${___contact_website}" + +"@ + if ($___process -ne ${env:hestiaKERNEL_ERROR_OK}) { + return ${env:hestiaKERNEL_ERROR_BAD_EXEC} + } + } + + + # write contact field + if ($(hestiaSTRING-Is-Empty "${___contact_name}") -ne ${env:hestiaKERNEL_ERROR_OK}) { + if ( + ($(hestiaSTRING-Is-Empty "${___contact_website}") -ne ${env:hestiaKERNEL_ERROR_OK}) -or + ($(hestiaSTRING-Is-Empty "${___contact_email}") -ne ${env:hestiaKERNEL_ERROR_OK}) + ) { + $___process = hestiaFS-Append-File "${___filepath}" @" +contact: + - affiliation: "${___contact_name}" + +"@ + if ($___process -ne ${env:hestiaKERNEL_ERROR_OK}) { + return ${env:hestiaKERNEL_ERROR_BAD_EXEC} + } + + + # write contact email field + if ($(hestiaSTRING-Is-Empty "${___contact_email}") -ne ${env:hestiaKERNEL_ERROR_OK}) { + $___process = hestiaFS-Append-File "${___filepath}" @" + email: "${___contact_email}" + +"@ + if ($___process -ne ${env:hestiaKERNEL_ERROR_OK}) { + return ${env:hestiaKERNEL_ERROR_BAD_EXEC} + } + } + + + # write contact website field + if ($(hestiaSTRING-Is-Empty "${___contact_website}") -ne ${env:hestiaKERNEL_ERROR_OK}) { + $___process = hestiaFS-Append-File "${___filepath}" @" + website: "${___contact_website}" + +"@ + if ($___process -ne ${env:hestiaKERNEL_ERROR_OK}) { + return ${env:hestiaKERNEL_ERROR_BAD_EXEC} + } + } + } + } + + + # write abstract field + $___process = hestiaFS-Append-File "${___filepath}" @" +abstract: |- + +"@ + if ($___process -ne ${env:hestiaKERNEL_ERROR_OK}) { + return ${env:hestiaKERNEL_ERROR_BAD_EXEC} + } + + foreach ($___line in (Get-Content "${___abstract_filepath}")) { + if ( + ($(hestiaSTRING-Is-Empty "${___line}") -ne ${env:hestiaKERNEL_ERROR_OK}) -and + ($(hestiaSTRING-Is-Empty "$($___line -replace "#.*$", '')") -eq ${env:hestiaKERNEL_ERROR_OK}) + ) { + continue + } + + $___line = $___line -replace '#.*', '' + if ($(hestiaSTRING-Is-Empty "${___line}") -ne ${env:hestiaKERNEL_ERROR_OK}) { + $___line = " ${___line}" + } + + $___process = hestiaFS-Append-File "${___filepath}" "${___line}`n" + if ($___process -ne 0) { + return 1 + } + } + + + # append remaining fields from citation_filepath + foreach ($___line in (Get-Content "${___citation_filepath}")) { + if ( + ($(hestiaSTRING-Is-Empty "${___line}") -ne ${env:hestiaKERNEL_ERROR_OK}) -and + ($(hestiaSTRING-Is-Empty "$($___line -replace "#.*$", '')") -eq ${env:hestiaKERNEL_ERROR_OK}) + ) { + continue + } + + $___line = $___line -replace '#.*' + if ($(STRINGS-Is-Empty "${___line}") -eq 0) { + continue + } + + $___process = hestiaFS-Append-File "${___filepath}" "${___line}`n" + 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}/hestiaFS/Vanilla.sh.ps1" +. "${LIBS_HESTIA}/hestiaKERNEL/Vanilla.sh.ps1" +. "${LIBS_HESTIA}/hestiaSTRING/Is_Empty.sh.ps1" + + + + +hestiaCITATION_Assemble() { + #___filepath="$1" + #___abstract_filepath="$2" + #___citation_filepath="$3" + #___cff_version="$4" + #___type="$5" + #___date="$6" + #___title="$7" + #___version="$8" + #___license="$9" + #___repo="${10}" + #___repo_code="${11}" + #___repo_artifact="${12}" + #___contact_name="${13}" + #___contact_website="${14}" + #___contact_email="${15}" + + + # validate input + if [ $(hestiaSTRING_Is_Empty "$4") -eq $hestiaKERNEL_ERROR_OK ]; then + return $hestiaKERNEL_ERROR_OK # disabled by explicit request + fi + + if [ $(hestiaSTRING_Is_Empty "$1") -eq $hestiaKERNEL_ERROR_OK ]; then + return $hestiaKERNEL_ERROR_ENTITY_EMPTY + fi + + if [ $(hestiaSTRING_Is_Empty "$2") -eq $hestiaKERNEL_ERROR_OK ]; then + return $hestiaKERNEL_ERROR_DATA_EMPTY + fi + + if [ $(hestiaSTRING_Is_Empty "$3") -eq $hestiaKERNEL_ERROR_OK ]; then + return $hestiaKERNEL_ERROR_DATA_EMPTY + fi + + if [ $(hestiaFS_Is_File "$1") -eq $hestiaKERNEL_ERROR_OK ]; then + return $hestiaKERNEL_ERROR_ENTITY_EXIST + fi + + if [ $(hestiaFS_Is_File "$2") -ne $hestiaKERNEL_ERROR_OK ]; then + return $hestiaKERNEL_ERROR_DATA_IS_NOT_FILE + fi + + if [ $(hestiaFS_Is_File "$3") -ne $hestiaKERNEL_ERROR_OK ]; then + return $hestiaKERNEL_ERROR_DATA_IS_NOT_FILE + fi + + if [ $(hestiaSTRING_Is_Empty "$5") -eq $hestiaKERNEL_ERROR_OK ]; then + return $hestiaKERNEL_ERROR_DATA_EMPTY + fi + + if [ $(hestiaSTRING_Is_Empty "$7") -eq $hestiaKERNEL_ERROR_OK ]; then + return $hestiaKERNEL_ERROR_DATA_EMPTY + fi + + + # execute + # write compulsory fields + hestiaFS_Create_Directory "$(hestiaFS_Get_Directory "$1")" + hestiaFS_Write_File "$1" "\ +# WARNING: auto-generated by AutomataCI + +cff-version: \"${4}\" +type: \"${5}\" +" + if [ $? -ne $hestiaKERNEL_ERROR_OK ]; then + return $hestiaKERNEL_ERROR_BAD_EXEC + fi + + + # write date field + if [ $(hestiaSTRING_Is_Empty "$6") -ne $hestiaKERNEL_ERROR_OK ]; then + hestiaFS_Append_File "$1" "\ +date-released: \"${6}\" +" + if [ $? -ne $hestiaKERNEL_ERROR_OK ]; then + return $hestiaKERNEL_ERROR_BAD_EXEC + fi + fi + + + # write title field + if [ $(hestiaSTRING_Is_Empty "$7") -ne $hestiaKERNEL_ERROR_OK ]; then + hestiaFS_Append_File "$1" "\ +title: \"${7}\" +" + if [ $? -ne $hestiaKERNEL_ERROR_OK ]; then + return $hestiaKERNEL_ERROR_BAD_EXEC + fi + fi + + + # write version field + if [ $(hestiaSTRING_Is_Empty "$8") -ne $hestiaKERNEL_ERROR_OK ]; then + hestiaFS_Append_File "$1" "\ +version: \"${8}\" +" + if [ $? -ne $hestiaKERNEL_ERROR_OK ]; then + return $hestiaKERNEL_ERROR_BAD_EXEC + fi + fi + + + # write license field + if [ $(hestiaSTRING_Is_Empty "$9") -ne $hestiaKERNEL_ERROR_OK ]; then + hestiaFS_Append_File "$1" "\ +license: \"${9}\" +" + if [ $? -ne $hestiaKERNEL_ERROR_OK ]; then + return $hestiaKERNEL_ERROR_BAD_EXEC + fi + fi + + + # write repository field + if [ $(hestiaSTRING_Is_Empty "${10}") -ne $hestiaKERNEL_ERROR_OK ]; then + hestiaFS_Append_File "$1" "\ +repository: \"${10}\" +" + if [ $? -ne $hestiaKERNEL_ERROR_OK ]; then + return $hestiaKERNEL_ERROR_BAD_EXEC + fi + fi + + + # write repository code field + if [ $(hestiaSTRING_Is_Empty "${11}") -ne $hestiaKERNEL_ERROR_OK ]; then + hestiaFS_Append_File "$1" "\ +repository-code: \"${11}\" +" + if [ $? -ne $hestiaKERNEL_ERROR_OK ]; then + return $hestiaKERNEL_ERROR_BAD_EXEC + fi + fi + + + # write repository artifact field + if [ $(hestiaSTRING_Is_Empty "${12}") -ne $hestiaKERNEL_ERROR_OK ]; then + hestiaFS_Append_File "$1" "\ +repository-artifact: \"${12}\" +" + if [ $? -ne $hestiaKERNEL_ERROR_OK ]; then + return $hestiaKERNEL_ERROR_BAD_EXEC + fi + fi + + + # write url field + if [ $(hestiaSTRING_Is_Empty "${14}") -ne $hestiaKERNEL_ERROR_OK ]; then + hestiaFS_Append_File "$1" "\ +url: \"${14}\" +" + if [ $? -ne $hestiaKERNEL_ERROR_OK ]; then + return $hestiaKERNEL_ERROR_BAD_EXEC + fi + fi + + + # write contact field + if [ $(hestiaSTRING_Is_Empty "${13}") -ne $hestiaKERNEL_ERROR_OK ]; then + if [ $(hestiaSTRING_Is_Empty "${14}") -ne $hestiaKERNEL_ERROR_OK ] || + [ $(hestiaSTRING_Is_Empty "${15}") -ne $hestiaKERNEL_ERROR_OK ]; then + hestiaFS_Append_File "$1" "\ +contact: + - affiliation: \"${13}\" +" + if [ $? -ne $hestiaKERNEL_ERROR_OK ]; then + return $hestiaKERNEL_ERROR_BAD_EXEC + fi + + + # write contact email field + if [ $(hestiaSTRING_Is_Empty "${15}") -ne $hestiaKERNEL_ERROR_OK ]; then + hestiaFS_Append_File "$1" "\ + email: \"${15}\" +" + if [ $? -ne $hestiaKERNEL_ERROR_OK ]; then + return $hestiaKERNEL_ERROR_BAD_EXEC + fi + fi + + + # write contact website field + if [ $(hestiaSTRING_Is_Empty "${14}") -ne $hestiaKERNEL_ERROR_OK ]; then + hestiaFS_Append_File "$1" "\ + website: \"${14}\" +" + if [ $? -ne $hestiaKERNEL_ERROR_OK ]; then + return $hestiaKERNEL_ERROR_BAD_EXEC + fi + fi + fi + fi + + + # write abstract field + hestiaFS_Append_File "$1" "\ +abstract: |- +" + if [ $? -ne $hestiaKERNEL_ERROR_OK ]; then + return $hestiaKERNEL_ERROR_BAD_EXEC + fi + + ___old_IFS="$IFS" + while IFS="" read -r ___line || [ -n "$___line" ]; do + if [ $(hestiaSTRING_Is_Empty "$___line") -ne $hestiaKERNEL_ERROR_OK ] && + [ $(hestiaSTRING_Is_Empty "${___line%%#*}") -eq $hestiaKERNEL_ERROR_OK ]; then + continue + fi + + ___line="${___line%%#*}" + if [ $(hestiaSTRING_Is_Empty "$___line") -ne $hestiaKERNEL_ERROR_OK ]; then + ___line=" ${___line}" + fi + + hestiaFS_Append_File "$1" "${___line}\n" + if [ $? -ne $hestiaKERNEL_ERROR_OK ]; then + return $hestiaKERNEL_ERROR_BAD_EXEC + fi + done < "$2" + IFS="$___old_IFS" && unset ___old_IFS + + + # append remaining fields from citation_filepath + ___old_IFS="$IFS" + while IFS="" read -r ___line || [ -n "$___line" ]; do + if [ $(hestiaSTRING_Is_Empty "$___line") -ne $hestiaKERNEL_ERROR_OK ] && + [ $(hestiaSTRING_Is_Empty "${___line%%#*}") -eq $hestiaKERNEL_ERROR_OK ]; then + continue + fi + + ___line="${___line%%#*}" + if [ $(hestiaSTRING_Is_Empty "$___line") -eq $hestiaKERNEL_ERROR_OK ]; then + continue + fi + + hestiaFS_Append_File "$1" "${___line}\n" + if [ $? -ne $hestiaKERNEL_ERROR_OK ]; then + return $hestiaKERNEL_ERROR_BAD_EXEC + fi + done < "$3" + IFS="$___old_IFS" && unset ___old_IFS + + + # report status + return $hestiaKERNEL_ERROR_OK +} +################################################################################ +# Unix Main Codes # +################################################################################ +return 0 +#> diff --git a/automataCI/services/hestiaCITATION/Vanilla.sh.ps1 b/automataCI/services/hestiaCITATION/Vanilla.sh.ps1 new file mode 100644 index 0000000..76e2db3 --- /dev/null +++ b/automataCI/services/hestiaCITATION/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}\hestiaCITATION\Assemble.sh.ps1" +################################################################################ +# Windows POWERSHELL Codes # +################################################################################ +return +<# +RUN_AS_POWERSHELL + + + + +################################################################################ +# Unix Main Codes # +################################################################################ +. "${LIBS_HESTIA}/hestiaCITATION/Assemble.sh.ps1" +################################################################################ +# Unix Main Codes # +################################################################################ +return 0 +#> diff --git a/automataCI/services/hestiaCONSOLE/Log.sh.ps1 b/automataCI/services/hestiaCONSOLE/Log.sh.ps1 new file mode 100644 index 0000000..19eef8c --- /dev/null +++ b/automataCI/services/hestiaCONSOLE/Log.sh.ps1 @@ -0,0 +1,213 @@ +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 { + $___tag = "" + $___color = "" + $___foreground_color = "" + }} + + 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 "$3")" + ___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 -- "%-17s " "$___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_Assemble.sh.ps1 b/automataCI/services/hestiaCONSOLE/Log_Assemble.sh.ps1 new file mode 100644 index 0000000..76b7b3b --- /dev/null +++ b/automataCI/services/hestiaCONSOLE/Log_Assemble.sh.ps1 @@ -0,0 +1,103 @@ +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_Assemble.sh.ps1" + + + + +function hestiaCONSOLE-Log-Assemble { + param( + [string]$___destination, + [string]$___source, + [string]$___lang + ) + + + # execute + $___lang = "$(hestiaLOCALE-Get-Lang "${___lang}")" + $null = hestiaCONSOLE-Log info ` + "$(hestiaI18N-Translate-Assemble ` + "${___lang}" ` + "${___destination}" ` + "${___source}")`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_Assemble.sh.ps1" + + + + +hestiaCONSOLE_Log_Assemble() { + #___destination="$1" + #___source="$2" + #___lang="$3" + + + # execute + ___lang="$(hestiaLOCALE_Get_Lang "$3")" + hestiaCONSOLE_Log info \ + "$(hestiaI18N_Translate_Assemble "$___lang" "$1" "$2")\n" \ + "$___lang" + + + # report status + return 0 +} +################################################################################ +# Unix Main Codes # +################################################################################ +return 0 +#> diff --git a/automataCI/services/hestiaCONSOLE/Log_Assemble_Failed.sh.ps1 b/automataCI/services/hestiaCONSOLE/Log_Assemble_Failed.sh.ps1 new file mode 100644 index 0000000..319d386 --- /dev/null +++ b/automataCI/services/hestiaCONSOLE/Log_Assemble_Failed.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_Assemble_Failed.sh.ps1" + + + + +function hestiaCONSOLE-Log-Assemble-Failed { + param ( + [string]$___lang + ) + + + # execute + $___lang = "$(hestiaLOCALE-Get-Lang "${___lang}")" + $null = hestiaCONSOLE-Log error ` + "$(hestiaI18N-Translate-Assemble-Failed "${___lang}")`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_Assemble_Failed.sh.ps1" + + + + +hestiaCONSOLE_Log_Assemble_Failed() { + #___lang="$1" + + + # execute + ___lang="$(hestiaLOCALE_Get_Lang "$1")" + hestiaCONSOLE_Log error \ + "$(hestiaI18N_Translate_Assemble_Failed "$___lang")\n" \ + "$___lang" + + + # report status + return 0 +} +################################################################################ +# Unix Main Codes # +################################################################################ +return 0 +#> diff --git a/automataCI/services/hestiaCONSOLE/Log_Assemble_Simulate.sh.ps1 b/automataCI/services/hestiaCONSOLE/Log_Assemble_Simulate.sh.ps1 new file mode 100644 index 0000000..8539f6b --- /dev/null +++ b/automataCI/services/hestiaCONSOLE/Log_Assemble_Simulate.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_Assemble_Simulate.sh.ps1" + + + + +function hestiaCONSOLE-Log-Assemble-Simulate { + param ( + [string]$___lang + ) + + + # execute + $___lang = "$(hestiaLOCALE-Get-Lang "${___lang}")" + $null = hestiaCONSOLE-Log warning ` + "$(hestiaI18N-Translate-Assemble-Simulate "${___lang}")`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_Assemble_Simulate.sh.ps1" + + + + +hestiaCONSOLE_Log_Assemble_Simulate() { + #___lang="$1" + + + # execute + ___lang="$(hestiaLOCALE_Get_Lang "$1")" + hestiaCONSOLE_Log info \ + "$(hestiaI18N_Translate_Assemble_Simulate "$___lang")\n" \ + "$___lang" + + + # report status + return 0 +} +################################################################################ +# Unix Main Codes # +################################################################################ +return 0 +#> diff --git a/automataCI/services/hestiaCONSOLE/Log_Check.sh.ps1 b/automataCI/services/hestiaCONSOLE/Log_Check.sh.ps1 new file mode 100644 index 0000000..4a46085 --- /dev/null +++ b/automataCI/services/hestiaCONSOLE/Log_Check.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_Check.sh.ps1" + + + + +function hestiaCONSOLE-Log-Check { + param ( + [string]$___subject, + [string]$___lang + ) + + + # execute + $___lang = "$(hestiaLOCALE-Get-Lang "${___lang}")" + $null = hestiaCONSOLE-Log info ` + "$(hestiaI18N-Translate-Check "${___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_Check.sh.ps1" + + + + +hestiaCONSOLE_Log_Check() { + #___subject="$1" + #___lang="$2" + + + # execute + ___lang="$(hestiaLOCALE_Get_Lang "$2")" + hestiaCONSOLE_Log info "$(hestiaI18N_Translate_Check "$___lang" "$1")\n" "$___lang" + + + # report status + return 0 +} +################################################################################ +# Unix Main Codes # +################################################################################ +return 0 +#> diff --git a/automataCI/services/hestiaCONSOLE/Log_Check_Availability.sh.ps1 b/automataCI/services/hestiaCONSOLE/Log_Check_Availability.sh.ps1 new file mode 100644 index 0000000..adfa29b --- /dev/null +++ b/automataCI/services/hestiaCONSOLE/Log_Check_Availability.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_Check_Availability.sh.ps1" + + + + +function hestiaCONSOLE-Log-Check-Availability { + param ( + [string]$___subject, + [string]$___lang + ) + + + # execute + $___lang = "$(hestiaLOCALE-Get-Lang "${___lang}")" + $null = hestiaCONSOLE-Log info ` + "$(hestiaI18N-Translate-Check-Availability "${___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_Check_Availability.sh.ps1" + + + + +hestiaCONSOLE_Log_Check_Availability() { + #___subject="$1" + #___lang="$2" + + + # execute + ___lang="$(hestiaLOCALE_Get_Lang "$2")" + hestiaCONSOLE_Log info \ + "$(hestiaI18N_Translate_Check_Availability "$___lang" "$1")\n" \ + "$___lang" + + + # report status + return 0 +} +################################################################################ +# Unix Main Codes # +################################################################################ +return 0 +#> diff --git a/automataCI/services/hestiaCONSOLE/Log_Check_Failed.sh.ps1 b/automataCI/services/hestiaCONSOLE/Log_Check_Failed.sh.ps1 new file mode 100644 index 0000000..369bce7 --- /dev/null +++ b/automataCI/services/hestiaCONSOLE/Log_Check_Failed.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_Check_Failed.sh.ps1" + + + + +function hestiaCONSOLE-Log-Check-Failed { + param ( + [string]$___lang + ) + + + # execute + $___lang = "$(hestiaLOCALE-Get-Lang "${___lang}")" + $null = hestiaCONSOLE-Log error ` + "$(hestiaI18N-Translate-Check-Failed "${___lang}")`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_Check_Failed.sh.ps1" + + + + +hestiaCONSOLE_Log_Check_Failed() { + #___lang="$1" + + + # execute + ___lang="$(hestiaLOCALE_Get_Lang "$1")" + hestiaCONSOLE_Log error \ + "$(hestiaI18N_Translate_Check_Failed "$___lang")\n" \ + "$___lang" + + + # report status + return 0 +} +################################################################################ +# Unix Main Codes # +################################################################################ +return 0 +#> diff --git a/automataCI/services/hestiaCONSOLE/Log_Check_Simulate.sh.ps1 b/automataCI/services/hestiaCONSOLE/Log_Check_Simulate.sh.ps1 new file mode 100644 index 0000000..be12df4 --- /dev/null +++ b/automataCI/services/hestiaCONSOLE/Log_Check_Simulate.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_Check_Simulate.sh.ps1" + + + + +function hestiaCONSOLE-Log-Check-Simulate { + param ( + [string]$___lang + ) + + + # execute + $___lang = "$(hestiaLOCALE-Get-Lang "${___lang}")" + $null = hestiaCONSOLE-Log warning ` + "$(hestiaI18N-Translate-Check-Simulate "${___lang}")`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_Check_Simulate.sh.ps1" + + + + +hestiaCONSOLE_Log_Check_Simulate() { + #___lang="$1" + + + # execute + ___lang="$(hestiaLOCALE_Get_Lang "$1")" + hestiaCONSOLE_Log warning \ + "$(hestiaI18N_Translate_Check_Simulate "$___lang")\n" \ + "$___lang" + + + # report status + return 0 +} +################################################################################ +# Unix Main Codes # +################################################################################ +return 0 +#> diff --git a/automataCI/services/hestiaCONSOLE/Log_Create.sh.ps1 b/automataCI/services/hestiaCONSOLE/Log_Create.sh.ps1 new file mode 100644 index 0000000..9902528 --- /dev/null +++ b/automataCI/services/hestiaCONSOLE/Log_Create.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_Create.sh.ps1" + + + + +function hestiaCONSOLE-Log-Create { + param ( + [string]$___subject, + [string]$___lang + ) + + + # execute + $___lang = "$(hestiaLOCALE-Get-Lang "${___lang}")" + $null = hestiaCONSOLE-Log info ` + "$(hestiaI18N-Translate-Create "${___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_Create.sh.ps1" + + + + +hestiaCONSOLE_Log_Create() { + #___subject="$1" + #___lang="$2" + + + # execute + ___lang="$(hestiaLOCALE_Get_Lang "$2")" + hestiaCONSOLE_Log info "$(hestiaI18N_Translate_Create "$___lang" "$1")\n" "$___lang" + + + # report status + return 0 +} +################################################################################ +# Unix Main Codes # +################################################################################ +return 0 +#> diff --git a/automataCI/services/hestiaCONSOLE/Log_Create_Failed.sh.ps1 b/automataCI/services/hestiaCONSOLE/Log_Create_Failed.sh.ps1 new file mode 100644 index 0000000..c12f2d9 --- /dev/null +++ b/automataCI/services/hestiaCONSOLE/Log_Create_Failed.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_Create_Failed.sh.ps1" + + + + +function hestiaCONSOLE-Log-Create-Failed { + param ( + [string]$___lang + ) + + + # execute + $___lang = "$(hestiaLOCALE-Get-Lang "${___lang}")" + $null = hestiaCONSOLE-Log error ` + "$(hestiaI18N-Translate-Create-Failed "${___lang}")`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_Create_Failed.sh.ps1" + + + + +hestiaCONSOLE_Log_Create_Failed() { + #___lang="$1" + + + # execute + ___lang="$(hestiaLOCALE_Get_Lang "$1")" + hestiaCONSOLE_Log error \ + "$(hestiaI18N_Translate_Create_Failed "$___lang")\n" \ + "$___lang" + + + # report status + return 0 +} +################################################################################ +# Unix Main Codes # +################################################################################ +return 0 +#> diff --git a/automataCI/services/hestiaCONSOLE/Log_Create_Simulate.sh.ps1 b/automataCI/services/hestiaCONSOLE/Log_Create_Simulate.sh.ps1 new file mode 100644 index 0000000..613330b --- /dev/null +++ b/automataCI/services/hestiaCONSOLE/Log_Create_Simulate.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_Create_Simulate.sh.ps1" + + + + +function hestiaCONSOLE-Log-Create-Simulate { + param ( + [string]$___lang + ) + + + # execute + $___lang = "$(hestiaLOCALE-Get-Lang "${___lang}")" + $null = hestiaCONSOLE-Log warning ` + "$(hestiaI18N-Translate-Create-Simulate "${___lang}")`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_Create_Simulate.sh.ps1" + + + + +hestiaCONSOLE_Log_Create_Simulate() { + #___lang="$1" + + + # execute + ___lang="$(hestiaLOCALE_Get_Lang "$1")" + hestiaCONSOLE_Log warning \ + "$(hestiaI18N_Translate_Create_Simulate "$___lang")\n" \ + "$___lang" + + + # report status + return 0 +} +################################################################################ +# Unix Main Codes # +################################################################################ +return 0 +#> diff --git a/automataCI/services/hestiaCONSOLE/Log_Package.sh.ps1 b/automataCI/services/hestiaCONSOLE/Log_Package.sh.ps1 new file mode 100644 index 0000000..d806a75 --- /dev/null +++ b/automataCI/services/hestiaCONSOLE/Log_Package.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_Package.sh.ps1" + + + + +function hestiaCONSOLE-Log-Package { + param ( + [string]$___subject, + [string]$___lang + ) + + + # execute + $___lang = "$(hestiaLOCALE-Get-Lang "${___lang}")" + $null = hestiaCONSOLE-Log info ` + "$(hestiaI18N-Translate-Package "${___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_Package.sh.ps1" + + + + +hestiaCONSOLE_Log_Package() { + #___subject="$1" + #___lang="$2" + + + # execute + ___lang="$(hestiaLOCALE_Get_Lang "$2")" + hestiaCONSOLE_Log info "$(hestiaI18N_Translate_Package "$___lang" "$1")\n" "$___lang" + + + # report status + return 0 +} +################################################################################ +# Unix Main Codes # +################################################################################ +return 0 +#> diff --git a/automataCI/services/hestiaCONSOLE/Log_Package_Failed.sh.ps1 b/automataCI/services/hestiaCONSOLE/Log_Package_Failed.sh.ps1 new file mode 100644 index 0000000..1cd7c87 --- /dev/null +++ b/automataCI/services/hestiaCONSOLE/Log_Package_Failed.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_Package_Failed.sh.ps1" + + + + +function hestiaCONSOLE-Log-Package-Failed { + param ( + [string]$___lang + ) + + + # execute + $___lang = "$(hestiaLOCALE-Get-Lang "${___lang}")" + $null = hestiaCONSOLE-Log error ` + "$(hestiaI18N-Translate-Package-Failed "${___lang}")`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_Package_Failed.sh.ps1" + + + + +hestiaCONSOLE_Log_Package_Failed() { + #___lang="$1" + + + # execute + ___lang="$(hestiaLOCALE_Get_Lang "$1")" + hestiaCONSOLE_Log error \ + "$(hestiaI18N_Translate_Package_Failed "$___lang")\n" \ + "$___lang" + + + # report status + return 0 +} +################################################################################ +# Unix Main Codes # +################################################################################ +return 0 +#> diff --git a/automataCI/services/hestiaCONSOLE/Log_Package_Simulate.sh.ps1 b/automataCI/services/hestiaCONSOLE/Log_Package_Simulate.sh.ps1 new file mode 100644 index 0000000..c7a6ab9 --- /dev/null +++ b/automataCI/services/hestiaCONSOLE/Log_Package_Simulate.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_Package_Simulate.sh.ps1" + + + + +function hestiaCONSOLE-Log-Package-Simulate { + param ( + [string]$___lang + ) + + + # execute + $___lang = "$(hestiaLOCALE-Get-Lang "${___lang}")" + $null = hestiaCONSOLE-Log warning ` + "$(hestiaI18N-Translate-Package-Simulate "${___lang}")`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_Package_Simulate.sh.ps1" + + + + +hestiaCONSOLE_Log_Publish_Simulate() { + #___lang="$1" + + + # execute + ___lang="$(hestiaLOCALE_Get_Lang "$1")" + hestiaCONSOLE_Log warning \ + "$(hestiaI18N_Translate_Package_Simulate "$___lang")\n" \ + "$___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 100644 index 0000000..a23b777 --- /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 "$2")" + 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 100644 index 0000000..db7bc52 --- /dev/null +++ b/automataCI/services/hestiaCONSOLE/Log_Publish_Failed.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_Failed.sh.ps1" + + + + +function hestiaCONSOLE-Log-Publish-Failed { + param ( + [string]$___lang + ) + + + # execute + $___lang = "$(hestiaLOCALE-Get-Lang "${___lang}")" + $null = hestiaCONSOLE-Log error ` + "$(hestiaI18N-Translate-Publish-Failed "${___lang}")`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() { + #___lang="$1" + + + # execute + ___lang="$(hestiaLOCALE_Get_Lang "$1")" + hestiaCONSOLE_Log error \ + "$(hestiaI18N_Translate_Publish_Failed "$___lang")\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 100644 index 0000000..aff04c1 --- /dev/null +++ b/automataCI/services/hestiaCONSOLE/Log_Publish_Simulate.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_Simulate.sh.ps1" + + + + +function hestiaCONSOLE-Log-Publish-Simulate { + param ( + [string]$___lang + ) + + + # execute + $___lang = "$(hestiaLOCALE-Get-Lang "${___lang}")" + $null = hestiaCONSOLE-Log warning ` + "$(hestiaI18N-Translate-Publish-Simulate "${___lang}")`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() { + #___lang="$1" + + + # execute + ___lang="$(hestiaLOCALE_Get_Lang "$1")" + hestiaCONSOLE_Log warning \ + "$(hestiaI18N_Translate_Publish_Simulate "$___lang")\n" \ + "$___lang" + + + # report status + return 0 +} +################################################################################ +# Unix Main Codes # +################################################################################ +return 0 +#> diff --git a/automataCI/services/hestiaCONSOLE/Log_Recreate.sh.ps1 b/automataCI/services/hestiaCONSOLE/Log_Recreate.sh.ps1 new file mode 100644 index 0000000..408b778 --- /dev/null +++ b/automataCI/services/hestiaCONSOLE/Log_Recreate.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_Recreate.sh.ps1" + + + + +function hestiaCONSOLE-Log-Recreate { + param ( + [string]$___subject, + [string]$___lang + ) + + + # execute + $___lang = "$(hestiaLOCALE-Get-Lang "${___lang}")" + $null = hestiaCONSOLE-Log info ` + "$(hestiaI18N-Translate-Recreate "${___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_Recreate.sh.ps1" + + + + +hestiaCONSOLE_Log_Recreate() { + #___subject="$1" + #___lang="$2" + + + # execute + ___lang="$(hestiaLOCALE_Get_Lang "$2")" + hestiaCONSOLE_Log info "$(hestiaI18N_Translate_Recreate "$___lang" "$1")\n" "$___lang" + + + # report status + return 0 +} +################################################################################ +# Unix Main Codes # +################################################################################ +return 0 +#> diff --git a/automataCI/services/hestiaCONSOLE/Log_Recreate_Failed.sh.ps1 b/automataCI/services/hestiaCONSOLE/Log_Recreate_Failed.sh.ps1 new file mode 100644 index 0000000..af9c7e1 --- /dev/null +++ b/automataCI/services/hestiaCONSOLE/Log_Recreate_Failed.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_Recreate_Failed.sh.ps1" + + + + +function hestiaCONSOLE-Log-Recreate-Failed { + param ( + [string]$___lang + ) + + + # execute + $___lang = "$(hestiaLOCALE-Get-Lang "${___lang}")" + $null = hestiaCONSOLE-Log error ` + "$(hestiaI18N-Translate-Recreate-Failed "${___lang}")`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_Recreate_Failed.sh.ps1" + + + + +hestiaCONSOLE_Log_Recreate_Failed() { + #___lang="$1" + + + # execute + ___lang="$(hestiaLOCALE_Get_Lang "$1")" + hestiaCONSOLE_Log error \ + "$(hestiaI18N_Translate_Recreate_Failed "$___lang")\n" \ + "$___lang" + + + # report status + return 0 +} +################################################################################ +# Unix Main Codes # +################################################################################ +return 0 +#> diff --git a/automataCI/services/hestiaCONSOLE/Log_Recreate_Simulate.sh.ps1 b/automataCI/services/hestiaCONSOLE/Log_Recreate_Simulate.sh.ps1 new file mode 100644 index 0000000..f1ce547 --- /dev/null +++ b/automataCI/services/hestiaCONSOLE/Log_Recreate_Simulate.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_Recreate_Simulate.sh.ps1" + + + + +function hestiaCONSOLE-Log-Recreate-Simulate { + param ( + [string]$___lang + ) + + + # execute + $___lang = "$(hestiaLOCALE-Get-Lang "${___lang}")" + $null = hestiaCONSOLE-Log warning ` + "$(hestiaI18N-Translate-Recreate-Simulate "${___lang}")`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_Recreate_Simulate.sh.ps1" + + + + +hestiaCONSOLE_Log_Recreate_Simulate() { + #___lang="$1" + + + # execute + ___lang="$(hestiaLOCALE_Get_Lang "$1")" + hestiaCONSOLE_Log warning \ + "$(hestiaI18N_Translate_Recreate_Simulate "$___lang")\n" \ + "$___lang" + + + # report status + return 0 +} +################################################################################ +# Unix Main Codes # +################################################################################ +return 0 +#> diff --git a/automataCI/services/hestiaCONSOLE/Log_Run.sh.ps1 b/automataCI/services/hestiaCONSOLE/Log_Run.sh.ps1 new file mode 100644 index 0000000..43f800c --- /dev/null +++ b/automataCI/services/hestiaCONSOLE/Log_Run.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_Run.sh.ps1" + + + + +function hestiaCONSOLE-Log-Run { + param ( + [string]$___subject, + [string]$___lang + ) + + + # execute + $___lang = "$(hestiaLOCALE-Get-Lang "${___lang}")" + $null = hestiaCONSOLE-Log info ` + "$(hestiaI18N-Translate-Run "${___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_Run.sh.ps1" + + + + +hestiaCONSOLE_Log_Run() { + #___subject="$1" + #___lang="$2" + + + # execute + ___lang="$(hestiaLOCALE_Get_Lang "$2")" + hestiaCONSOLE_Log info "$(hestiaI18N_Translate_Run "$___lang" "$1")\n" "$___lang" + + + # report status + return 0 +} +################################################################################ +# Unix Main Codes # +################################################################################ +return 0 +#> diff --git a/automataCI/services/hestiaCONSOLE/Log_Run_Failed.sh.ps1 b/automataCI/services/hestiaCONSOLE/Log_Run_Failed.sh.ps1 new file mode 100644 index 0000000..46b4b2c --- /dev/null +++ b/automataCI/services/hestiaCONSOLE/Log_Run_Failed.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_Run_Failed.sh.ps1" + + + + +function hestiaCONSOLE-Log-Run-Failed { + param ( + [string]$___lang + ) + + + # execute + $___lang = "$(hestiaLOCALE-Get-Lang "${___lang}")" + $null = hestiaCONSOLE-Log error ` + "$(hestiaI18N-Translate-Run-Failed "${___lang}")`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_Run_Failed.sh.ps1" + + + + +hestiaCONSOLE_Log_Run_Failed() { + #___lang="$1" + + + # execute + ___lang="$(hestiaLOCALE_Get_Lang "$1")" + hestiaCONSOLE_Log error \ + "$(hestiaI18N_Translate_Run_Failed "$___lang")\n" \ + "$___lang" + + + # report status + return 0 +} +################################################################################ +# Unix Main Codes # +################################################################################ +return 0 +#> diff --git a/automataCI/services/hestiaCONSOLE/Log_Run_Simulate.sh.ps1 b/automataCI/services/hestiaCONSOLE/Log_Run_Simulate.sh.ps1 new file mode 100644 index 0000000..39b15f5 --- /dev/null +++ b/automataCI/services/hestiaCONSOLE/Log_Run_Simulate.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_Run_Simulate.sh.ps1" + + + + +function hestiaCONSOLE-Log-Run-Simulate { + param ( + [string]$___lang + ) + + + # execute + $___lang = "$(hestiaLOCALE-Get-Lang "${___lang}")" + $null = hestiaCONSOLE-Log warning ` + "$(hestiaI18N-Translate-Run-Simulate "${___lang}")`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_Run_Simulate.sh.ps1" + + + + +hestiaCONSOLE_Log_Run_Simulate() { + #___lang="$1" + + + # execute + ___lang="$(hestiaLOCALE_Get_Lang "$1")" + hestiaCONSOLE_Log warning \ + "$(hestiaI18N_Translate_Run_Simulate "$___lang")\n" \ + "$___lang" + + + # report status + return 0 +} +################################################################################ +# Unix Main Codes # +################################################################################ +return 0 +#> diff --git a/automataCI/services/hestiaCONSOLE/Log_Run_Skipped.sh.ps1 b/automataCI/services/hestiaCONSOLE/Log_Run_Skipped.sh.ps1 new file mode 100644 index 0000000..0e46f9d --- /dev/null +++ b/automataCI/services/hestiaCONSOLE/Log_Run_Skipped.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_Run_Skipped.sh.ps1" + + + + +function hestiaCONSOLE-Log-Run-Skipped { + param ( + [string]$___lang + ) + + + # execute + $___lang = "$(hestiaLOCALE-Get-Lang "${___lang}")" + $null = hestiaCONSOLE-Log warning ` + "$(hestiaI18N-Translate-Run-Skipped "${___lang}")`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_Run_Skipped.sh.ps1" + + + + +hestiaCONSOLE_Log_Run_Skipped() { + #___lang="$1" + + + # execute + ___lang="$(hestiaLOCALE_Get_Lang "$1")" + hestiaCONSOLE_Log warning \ + "$(hestiaI18N_Translate_Run_Skipped "$___lang")\n" \ + "$___lang" + + + # report status + return 0 +} +################################################################################ +# Unix Main Codes # +################################################################################ +return 0 +#> diff --git a/automataCI/services/hestiaCONSOLE/Log_Success.sh.ps1 b/automataCI/services/hestiaCONSOLE/Log_Success.sh.ps1 new file mode 100644 index 0000000..ed230cc --- /dev/null +++ b/automataCI/services/hestiaCONSOLE/Log_Success.sh.ps1 @@ -0,0 +1,90 @@ +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_Run_Failed.sh.ps1" + + + + +function hestiaCONSOLE-Log-Success { + param ( + [string]$___lang + ) + + + # execute + $null = hestiaCONSOLE-Log success "`n`n" "$(hestiaLOCALE-Get-Lang "${___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_Run_Failed.sh.ps1" + + + + +hestiaCONSOLE_Log_Success() { + #___lang="$1" + + + # execute + hestiaCONSOLE_Log success "\n\n" "$(hestiaLOCALE_Get_Lang "$1")" + + + # 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 100644 index 0000000..b37fc75 --- /dev/null +++ b/automataCI/services/hestiaCONSOLE/Vanilla.sh.ps1 @@ -0,0 +1,102 @@ +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}\hestiaCONSOLE\Log_Assemble.sh.ps1" +. "${env:LIBS_HESTIA}\hestiaCONSOLE\Log_Assemble_Failed.sh.ps1" +. "${env:LIBS_HESTIA}\hestiaCONSOLE\Log_Assemble_Simulate.sh.ps1" +. "${env:LIBS_HESTIA}\hestiaCONSOLE\Log_Check.sh.ps1" +. "${env:LIBS_HESTIA}\hestiaCONSOLE\Log_Check_Availability.sh.ps1" +. "${env:LIBS_HESTIA}\hestiaCONSOLE\Log_Check_Failed.sh.ps1" +. "${env:LIBS_HESTIA}\hestiaCONSOLE\Log_Check_Simulate.sh.ps1" +. "${env:LIBS_HESTIA}\hestiaCONSOLE\Log_Create.sh.ps1" +. "${env:LIBS_HESTIA}\hestiaCONSOLE\Log_Create_Failed.sh.ps1" +. "${env:LIBS_HESTIA}\hestiaCONSOLE\Log_Create_Simulate.sh.ps1" +. "${env:LIBS_HESTIA}\hestiaCONSOLE\Log_Package.sh.ps1" +. "${env:LIBS_HESTIA}\hestiaCONSOLE\Log_Package_Failed.sh.ps1" +. "${env:LIBS_HESTIA}\hestiaCONSOLE\Log_Package_Simulate.sh.ps1" +. "${env:LIBS_HESTIA}\hestiaCONSOLE\Log_Publish.sh.ps1" +. "${env:LIBS_HESTIA}\hestiaCONSOLE\Log_Publish_Failed.sh.ps1" +. "${env:LIBS_HESTIA}\hestiaCONSOLE\Log_Publish_Simulate.sh.ps1" +. "${env:LIBS_HESTIA}\hestiaCONSOLE\Log_Recreate.sh.ps1" +. "${env:LIBS_HESTIA}\hestiaCONSOLE\Log_Recreate_Failed.sh.ps1" +. "${env:LIBS_HESTIA}\hestiaCONSOLE\Log_Recreate_Simulate.sh.ps1" +. "${env:LIBS_HESTIA}\hestiaCONSOLE\Log_Run.sh.ps1" +. "${env:LIBS_HESTIA}\hestiaCONSOLE\Log_Run_Failed.sh.ps1" +. "${env:LIBS_HESTIA}\hestiaCONSOLE\Log_Run_Simulate.sh.ps1" +. "${env:LIBS_HESTIA}\hestiaCONSOLE\Log_Run_Skipped.sh.ps1" +. "${env:LIBS_HESTIA}\hestiaCONSOLE\Log_Success.sh.ps1" +################################################################################ +# Windows POWERSHELL Codes # +################################################################################ +return +<# +RUN_AS_POWERSHELL + + + + +################################################################################ +# Unix Main Codes # +################################################################################ +. "${LIBS_HESTIA}/hestiaCONSOLE/Log.sh.ps1" +. "${LIBS_HESTIA}/hestiaCONSOLE/Log_Assemble.sh.ps1" +. "${LIBS_HESTIA}/hestiaCONSOLE/Log_Assemble_Failed.sh.ps1" +. "${LIBS_HESTIA}/hestiaCONSOLE/Log_Assemble_Simulate.sh.ps1" +. "${LIBS_HESTIA}/hestiaCONSOLE/Log_Check.sh.ps1" +. "${LIBS_HESTIA}/hestiaCONSOLE/Log_Check_Availability.sh.ps1" +. "${LIBS_HESTIA}/hestiaCONSOLE/Log_Check_Failed.sh.ps1" +. "${LIBS_HESTIA}/hestiaCONSOLE/Log_Check_Simulate.sh.ps1" +. "${LIBS_HESTIA}/hestiaCONSOLE/Log_Create.sh.ps1" +. "${LIBS_HESTIA}/hestiaCONSOLE/Log_Create_Failed.sh.ps1" +. "${LIBS_HESTIA}/hestiaCONSOLE/Log_Create_Simulate.sh.ps1" +. "${LIBS_HESTIA}/hestiaCONSOLE/Log_Package.sh.ps1" +. "${LIBS_HESTIA}/hestiaCONSOLE/Log_Package_Failed.sh.ps1" +. "${LIBS_HESTIA}/hestiaCONSOLE/Log_Package_Simulate.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" +. "${LIBS_HESTIA}/hestiaCONSOLE/Log_Recreate.sh.ps1" +. "${LIBS_HESTIA}/hestiaCONSOLE/Log_Recreate_Failed.sh.ps1" +. "${LIBS_HESTIA}/hestiaCONSOLE/Log_Recreate_Simulate.sh.ps1" +. "${LIBS_HESTIA}/hestiaCONSOLE/Log_Run.sh.ps1" +. "${LIBS_HESTIA}/hestiaCONSOLE/Log_Run_Failed.sh.ps1" +. "${LIBS_HESTIA}/hestiaCONSOLE/Log_Run_Simulate.sh.ps1" +. "${LIBS_HESTIA}/hestiaCONSOLE/Log_Run_Skipped.sh.ps1" +. "${LIBS_HESTIA}/hestiaCONSOLE/Log_Success.sh.ps1" +################################################################################ +# Unix Main Codes # +################################################################################ +return 0 +#> diff --git a/automataCI/services/hestiaFS/Append_File.sh.ps1 b/automataCI/services/hestiaFS/Append_File.sh.ps1 new file mode 100644 index 0000000..1a3f484 --- /dev/null +++ b/automataCI/services/hestiaFS/Append_File.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\Error_Codes.sh.ps1" +. "${env:LIBS_HESTIA}\hestiaFS\Is_Directory.sh.ps1" +. "${env:LIBS_HESTIA}\hestiaSTRING\Is_Empty.sh.ps1" + + + + +function hestiaFS-Append-File { + param ( + [string]$___target, + [string]$___content + ) + + + # validate input + if ($(hestiaSTRING-Is-Empty "${___target}") -eq ${env:hestiaKERNEL_ERROR_OK}) { + return ${env:hestiaKERNEL_ERROR_ENTITY_MISSING} + } + + if ($(hestiaFS-Is-Directory "${___target}") -eq ${env:hestiaKERNEL_ERROR_OK}) { + return ${env:hestiaKERNEL_ERROR_ENTITY_IS_NOT_FILE} + } + + if ($(hestiaSTRING-Is-Empty "${___content}") -eq ${env:hestiaKERNEL_ERROR_OK}) { + return ${env:hestiaKERNEL_ERROR_DATA_EMPTY} + } + + + # execute + $null = Add-Content -NoNewline -Path $___target -Value $___content + if ($?) { + return ${env:hestiaKERNEL_ERROR_OK} + } + + + # report status + return ${env:hestiaKERNEL_ERROR_BAD_EXEC} +} +################################################################################ +# Windows POWERSHELL Codes # +################################################################################ +return +<# +RUN_AS_POWERSHELL + + + + +################################################################################ +# Unix Main Codes # +################################################################################ +. "${LIBS_HESTIA}/hestiaKERNEL/Error_Codes.sh.ps1" +. "${LIBS_HESTIA}/hestiaFS/Is_Directory.sh.ps1" +. "${LIBS_HESTIA}/hestiaSTRING/Is_Empty.sh.ps1" + + + + +hestiaFS_Append_File() { + #___target="$1" + #___content="$2" + + + # validate input + if [ $(hestiaSTRING_Is_Empty "$1") -eq $hestiaKERNEL_ERROR_OK ]; then + return $hestiaKERNEL_ERROR_ENTITY_MISSING + fi + + if [ $(hestiaFS_Is_Directory "$1") -eq $hestiaKERNEL_ERROR_OK ]; then + return $hestiaKERNEL_ERROR_ENTITY_IS_NOT_FILE + fi + + if [ $(hestiaSTRING_Is_Empty "$2") -eq $hestiaKERNEL_ERROR_OK ]; then + return $hestiaKERNEL_ERROR_DATA_EMPTY + fi + + + # execute + printf -- "%b" "$2" >> "$1" + if [ $? -eq $hestiaKERNEL_ERROR_OK ]; then + return $hestiaKERNEL_ERROR_OK + fi + + + # execute + return $hestiaKERNEL_ERROR_BAD_EXEC +} +################################################################################ +# Unix Main Codes # +################################################################################ +return 0 +#> diff --git a/automataCI/services/hestiaFS/Copy_Directory.sh.ps1 b/automataCI/services/hestiaFS/Copy_Directory.sh.ps1 new file mode 100644 index 0000000..934fa6f --- /dev/null +++ b/automataCI/services/hestiaFS/Copy_Directory.sh.ps1 @@ -0,0 +1,138 @@ +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\Create_Directory.sh.ps1" +. "${env:LIBS_HESTIA}\hestiaFS\Is_Directory.sh.ps1" +. "${env:LIBS_HESTIA}\hestiaFS\Is_File.sh.ps1" +. "${env:LIBS_HESTIA}\hestiaKERNEL\Vanilla.sh.ps1" +. "${env:LIBS_HESTIA}\hestiaSTRING\Is_Empty.sh.ps1" + + + + +function hestiaFS-Copy-Directory { + param ( + [string]$___destination, + [string]$___source + ) + + + # validate input + if ($(hestiaSTRING-Is-Empty "${___destination}") -eq ${env:hestiaKERNEL_ERROR_OK}) { + return ${env:hestiaKERNEL_ERROR_ENTITY_EMPTY} + } + + if ($(hestiaSTRING-Is-Empty "${___source}") -eq ${env:hestiaKERNEL_ERROR_OK}) { + return ${env:hestiaKERNEL_ERROR_DATA_EMPTY} + } + + if ($(hestiaFS-Is-Directory "${___source}") -ne ${env:hestiaKERNEL_ERROR_OK}) { + return ${env:hestiaKERNEL_ERROR_DATA_IS_NOT_DIRECTORY} + } + + if ($(hestiaFS-Is-File "${___destination}") -eq ${env:hestiaKERNEL_ERROR_OK}) { + return ${env:hestiaKERNEL_ERROR_ENTITY_IS_NOT_DIRECTORY} + } + + + # execute + $null = hestiaFS-Create-Directory "${___destination}" + $null = Copy-Item -Path "${___source}\*" -Destination "${___destination}\." -Recurse + if ($?) { + return ${env:hestiaKERNEL_ERROR_OK} + } + + + # report status + return ${env:hestiaKERNEL_ERROR_BAD_EXEC} +} +################################################################################ +# Windows POWERSHELL Codes # +################################################################################ +return +<# +RUN_AS_POWERSHELL + + + + +################################################################################ +# Unix Main Codes # +################################################################################ +. "${LIBS_HESTIA}/hestiaFS/Is_File.sh.ps1" +. "${LIBS_HESTIA}/hestiaFS/Is_Directory.sh.ps1" +. "${LIBS_HESTIA}/hestiaKERNEL/Vanilla.sh.ps1" +. "${LIBS_HESTIA}/hestiaSTRING/Is_Empty.sh.ps1" + + + + +hestiaFS_Copy_Directory() { + #___destination="$1" + #___source="$2" + + + # validate input + if [ $(hestiaSTRING_Is_Empty "$1") -eq $hestiaKERNEL_ERROR_OK ]; then + return $hestiaKERNEL_ERROR_ENTITY_EMPTY + fi + + if [ $(hestiaSTRING_Is_Empty "$2") -eq $hestiaKERNEL_ERROR_OK ]; then + return $hestiaKERNEL_ERROR_DATA_EMPTY + fi + + if [ $(hestiaFS_Is_Directory "$2") -ne $hestiaKERNEL_ERROR_OK ]; then + return $hestiaKERNEL_ERROR_DATA_IS_NOT_DIRECTORY + fi + + if [ $(hestiaFS_Is_File "$1") -eq $hestiaKERNEL_ERROR_OK ]; then + return $hestiaKERNEL_ERROR_ENTITY_IS_NOT_DIRECTORY + fi + + + # execute + cp -r "${2}/"* "${1}/." + if [ $? -eq $hestiaKERNEL_ERROR_OK ]; then + return $hestiaKERNEL_ERROR_OK + fi + + + # report status + return $hestiaKERNEL_ERROR_BAD_EXEC +} +################################################################################ +# Unix Main Codes # +################################################################################ +return 0 +#> diff --git a/automataCI/services/hestiaFS/Copy_File.sh.ps1 b/automataCI/services/hestiaFS/Copy_File.sh.ps1 new file mode 100644 index 0000000..fb99083 --- /dev/null +++ b/automataCI/services/hestiaFS/Copy_File.sh.ps1 @@ -0,0 +1,148 @@ +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_Directory.sh.ps1" +. "${env:LIBS_HESTIA}\hestiaFS\Is_Directory.sh.ps1" +. "${env:LIBS_HESTIA}\hestiaFS\Is_Exist.sh.ps1" +. "${env:LIBS_HESTIA}\hestiaFS\Is_File.sh.ps1" +. "${env:LIBS_HESTIA}\hestiaKERNEL\Vanilla.sh.ps1" +. "${env:LIBS_HESTIA}\hestiaSTRING\Is_Empty.sh.ps1" + + + + +function hestiaFS-Copy-File { + param ( + [string]$___destination, + [string]$___source + ) + + + # validate input + if ($(hestiaSTRING-Is-Empty "${___destination}") -eq ${env:hestiaKERNEL_ERROR_OK}) { + return ${env:hestiaKERNEL_ERROR_ENTITY_EMPTY} + } + + if ($(hestiaSTRING-Is-Empty "${___source}") -eq ${env:hestiaKERNEL_ERROR_OK}) { + return ${env:hestiaKERNEL_ERROR_DATA_EMPTY} + } + + if ($(hestiaFS-Is-File "${___source}") -ne ${env:hestiaKERNEL_ERROR_OK}) { + return ${env:hestiaKERNEL_ERROR_DATA_IS_NOT_FILE} + } + + if ($(hestiaFS-Is-Exist "${___destination}") -eq ${env:hestiaKERNEL_ERROR_OK}) { + return ${env:hestiaKERNEL_ERROR_ENTITY_EXISTS} + } + + if ($(hestiaFS-Is-Directory "$(hestiaFS-Get-Directory "${___destination}")") -ne ${env:hestiaKERNEL_ERROR_OK}) { + return ${env:hestiaKERNEL_ERROR_ENTITY_INVALID} + } + + + # execute + $null = Copy-Item -Path $___source -Destination $___destination + if ($?) { + return ${env:hestiaKERNEL_ERROR_OK} + } + + + # report status + return ${env:hestiaKERNEL_ERROR_BAD_EXEC} +} +################################################################################ +# Windows POWERSHELL Codes # +################################################################################ +return +<# +RUN_AS_POWERSHELL + + + + +################################################################################ +# Unix Main Codes # +################################################################################ +. "${LIBS_HESTIA}/hestiaFS/Get_Directory.sh.ps1" +. "${LIBS_HESTIA}/hestiaFS/Is_Directory.sh.ps1" +. "${LIBS_HESTIA}/hestiaFS/Is_Exist.sh.ps1" +. "${LIBS_HESTIA}/hestiaFS/Is_File.sh.ps1" +. "${LIBS_HESTIA}/hestiaKERNEL/Vanilla.sh.ps1" +. "${LIBS_HESTIA}/hestiaSTRING/Is_Empty.sh.ps1" + + + + +hestiaFS_Copy_File() { + #___destination="$1" + #___source="$2" + + + # validate input + if [ $(hestiaSTRING_Is_Empty "$1") -eq $hestiaKERNEL_ERROR_OK ]; then + return $hestiaKERNEL_ERROR_ENTITY_EMPTY + fi + + if [ $(hestiaSTRING_Is_Empty "$2") -eq $hestiaKERNEL_ERROR_OK ]; then + return $hestiaKERNEL_ERROR_DATA_EMPTY + fi + + if [ $(hestiaFS_Is_File "$2") -ne $hestiaKERNEL_ERROR_OK ]; then + return $hestiaKERNEL_ERROR_DATA_IS_NOT_FILE + fi + + if [ $(hestiaFS_Is_Exist "$1") -eq $hestiaKERNEL_ERROR_OK ]; then + return $hestiaKERNEL_ERROR_ENTITY_EXISTS + fi + + if [ $(hestiaFS_Is_Directory "$(hestiaFS_Get_Directory "$2")") -ne $hestiaKERNEL_ERROR_OK ]; then + return $hestiaKERNEL_ERROR_ENTITY_INVALID + fi + + + # execute + cp "$2" "$1" + if [ $? -eq $hestiaKERNEL_ERROR_OK ]; then + return $hestiaKERNEL_ERROR_OK + fi + + + # report status + return $hestiaKERNEL_ERROR_BAD_EXEC +} +################################################################################ +# Unix Main Codes # +################################################################################ +return 0 +#> diff --git a/automataCI/services/hestiaFS/Create_Directory.sh.ps1 b/automataCI/services/hestiaFS/Create_Directory.sh.ps1 new file mode 100644 index 0000000..96715ef --- /dev/null +++ b/automataCI/services/hestiaFS/Create_Directory.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\Is_Directory.sh.ps1" +. "${env:LIBS_HESTIA}\hestiaFS\Is_File.sh.ps1" +. "${env:LIBS_HESTIA}\hestiaSTRING\Is_Empty.sh.ps1" + + + + +function hestiaFS-Create-Directory { + param ( + [string]$___filepath + ) + + + # validate input + if ($(hestiaSTRING-Is-Empty "${___filepath}") -eq ${env:hestiaKERNEL_ERROR_OK}) { + return ${env:hestiaKERNEL_ERROR_OK} + } + + if ($(hestiaFS-Is-File "${___filepath}") -eq ${env:hestiaKERNEL_ERROR_OK}) { + return $hestiaKERNEL_ERROR_ENTITY_IS_NOT_DIRECTORY + } + + if ($(hestiaFS-Is-Directory "${___filepath}") -eq ${env:hestiaKERNEL_ERROR_OK}) { + return ${env:hestiaKERNEL_ERROR_OK} + } + + + # execute + $___process = New-Item -ItemType Directory -Force -Path "${___filepath}" + if ($___process) { + return ${env:hestiaKERNEL_ERROR_OK} + } + + + # execute + return ${env:hestiaKERNEL_ERROR_BAD_EXEC} +} +################################################################################ +# Windows POWERSHELL Codes # +################################################################################ +return +<# +RUN_AS_POWERSHELL + + + + +################################################################################ +# Unix Main Codes # +################################################################################ +. "${LIBS_HESTIA}/hestiaKERNEL/Vanilla.sh.ps1" +. "${LIBS_HESTIA}/hestiaFS/Is_Directory.sh.ps1" +. "${LIBS_HESTIA}/hestiaFS/Is_File.sh.ps1" +. "${LIBS_HESTIA}/hestiaSTRING/Is_Empty.sh.ps1" + + + + +hestiaFS_Create_Directory() { + #___filepath="$1" + + + # validate input + if [ $(hestiaSTRING_Is_Empty "$1") -eq $hestiaKERNEL_ERROR_OK ]; then + return $hestiaKERNEL_ERROR_OK + fi + + if [ $(hestiaFS_Is_File "$1") -eq $hestiaKERNEL_ERROR_OK ]; then + return $hestiaKERNEL_ERROR_ENTITY_IS_NOT_DIRECTORY + fi + + if [ $(hestiaFS_Is_Directory "$1") -eq $hestiaKERNEL_ERROR_OK ]; then + return $hestiaKERNEL_ERROR_OK + fi + + + # execute + mkdir -p "$1" + if [ $? -ne 0 ]; then + return $hestiaKERNEL_ERROR_BAD_EXEC + fi + + + # report status + return $hestiaKERNEL_ERROR_OK +} +################################################################################ +# Unix Main Codes # +################################################################################ +return 0 +#> diff --git a/automataCI/services/hestiaFS/Get_Directory.sh.ps1 b/automataCI/services/hestiaFS/Get_Directory.sh.ps1 new file mode 100644 index 0000000..01611ab --- /dev/null +++ b/automataCI/services/hestiaFS/Get_Directory.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\Is_Empty.sh.ps1" + + + + +function hestiaFS-Get-Directory { + param ( + [string]$___filepath + ) + + + # validate input + if ($(hestiaSTRING-Is-Empty "${___filepath}") -eq ${env:hestiaKERNEL_ERROR_OK}) { + return "" + } + + + # execute + return "$(Split-Path -Parent -Path "${___filepath}")" +} +################################################################################ +# Windows POWERSHELL Codes # +################################################################################ +return +<# +RUN_AS_POWERSHELL + + + + +################################################################################ +# Unix Main Codes # +################################################################################ +. "${LIBS_HESTIA}/hestiaKERNEL/Vanilla.sh.ps1" +. "${LIBS_HESTIA}/hestiaSTRING/Is_Empty.sh.ps1" + + + + +hestiaFS_Get_Directory() { + #___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/Get_File.sh.ps1 b/automataCI/services/hestiaFS/Get_File.sh.ps1 new file mode 100644 index 0000000..a82a86b --- /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\Is_Empty.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 "${___filepath}")" +} +################################################################################ +# Windows POWERSHELL Codes # +################################################################################ +return +<# +RUN_AS_POWERSHELL + + + + +################################################################################ +# Unix Main Codes # +################################################################################ +. "${LIBS_HESTIA}/hestiaKERNEL/Vanilla.sh.ps1" +. "${LIBS_HESTIA}/hestiaSTRING/Is_Empty.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/Is_Directory.sh.ps1 b/automataCI/services/hestiaFS/Is_Directory.sh.ps1 new file mode 100644 index 0000000..d396f73 --- /dev/null +++ b/automataCI/services/hestiaFS/Is_Directory.sh.ps1 @@ -0,0 +1,107 @@ +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.sh.ps1" +. "${env:LIBS_HESTIA}\hestiaSTRING\Is_Empty.sh.ps1" + + + + +function hestiaFS-Is-Directory { + param ( + [string]$___target + ) + + + # validate input + if ($(hestiaSTRING-Is-Empty "${___target}") -eq ${env:hestiaKERNEL_ERROR_OK}) { + return ${env:hestiaKERNEL_ERROR_DATA_EMPTY} + } + + + # execute + if (Test-Path -PathType Container -Path $___target -ErrorAction SilentlyContinue) { + return ${env:hestiaKERNEL_ERROR_OK} + } + + + # execute + return ${env:hestiaKERNEL_ERROR_DATA_BAD} +} +################################################################################ +# Windows POWERSHELL Codes # +################################################################################ +return +<# +RUN_AS_POWERSHELL + + + + +################################################################################ +# Unix Main Codes # +################################################################################ +. "${LIBS_HESTIA}/hestiaKERNEL/Error_Codes.sh.ps1" +. "${LIBS_HESTIA}/hestiaSTRING/Is_Empty.sh.ps1" + + + + +hestiaFS_Is_Directory() { + #___target="$1" + + + # validate input + if [ $(hestiaSTRING_Is_Empty "$1") -eq $hestiaKERNEL_ERROR_OK ]; then + printf -- "%d" "$hestiaKERNEL_ERROR_DATA_EMPTY" + return $hestiaKERNEL_ERROR_DATA_EMPTY + fi + + + # execute + if [ -d "$1" ]; then + printf -- "%d" "$hestiaKERNEL_ERROR_OK" + return $hestiaKERNEL_ERROR_OK + fi + + + # execute + printf -- "%d" "$hestiaKERNEL_ERROR_DATA_BAD" + return $hestiaKERNEL_ERROR_DATA_BAD +} +################################################################################ +# Unix Main Codes # +################################################################################ +return 0 +#> diff --git a/automataCI/services/hestiaFS/Is_Directory_Empty.sh.ps1 b/automataCI/services/hestiaFS/Is_Directory_Empty.sh.ps1 new file mode 100644 index 0000000..50e24e8 --- /dev/null +++ b/automataCI/services/hestiaFS/Is_Directory_Empty.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\Error_Codes.sh.ps1" +. "${env:LIBS_HESTIA}\hestiaFS\Is_Directory.sh.ps1" +. "${env:LIBS_HESTIA}\hestiaSTRING\Is_Empty.sh.ps1" + + + + +function hestiaFS-Is-Directory-Empty { + param ( + [string]$___target + ) + + + # validate input + if ($(hestiaSTRING-Is-Empty "${___target}") -eq ${env:hestiaKERNEL_ERROR_OK}) { + return ${env:hestiaKERNEL_ERROR_DATA_EMPTY} + } + + if ($(hestiaSTRING-Is-Directory "${___target}") -ne ${env:hestiaKERNEL_ERROR_OK}) { + return ${env:hestiaKERNEL_ERROR_DATA_IS_NOT_DIRECTORY} + } + + + # execute + if ((Get-ChildItem "${___target}" -force ` + | Select-Object -First 1 ` + | Measure-Object).Count -ne 0) { + return ${env:hestiaKERNEL_ERROR_BAD_EXEC} + } + + + # execute + return ${env:hestiaKERNEL_ERROR_OK} +} +################################################################################ +# Windows POWERSHELL Codes # +################################################################################ +return +<# +RUN_AS_POWERSHELL + + + + +################################################################################ +# Unix Main Codes # +################################################################################ +. "${LIBS_HESTIA}/hestiaKERNEL/Error_Codes.sh.ps1" +. "${LIBS_HESTIA}/hestiaFS/Is_Directory.sh.ps1" +. "${LIBS_HESTIA}/hestiaSTRING/Is_Empty.sh.ps1" + + + + +hestiaFS_Is_Directory_Empty() { + #___target="$1" + + + # validate input + if [ $(hestiaSTRING_Is_Empty "$1") -eq $hestiaKERNEL_ERROR_OK ]; then + printf -- "$hestiaKERNEL_ERROR_DATA_EMPTY" + return $hestiaKERNEL_ERROR_DATA_EMPTY + fi + + if [ $(hestiaFS_Is_Directory "$1") -ne $hestiaKERNEL_ERROR_OK ]; then + printf -- "$hestiaKERNEL_ERROR_DATA_IS_NOT_DIRECTORY" + return $hestiaKERNEL_ERROR_DATA_IS_NOT_DIRECTORY + fi + + + # execute + for ___item in "$1"/*; do + if [ -e "$___item" ]; then + printf -- "$hestiaKERNEL_ERROR_BAD_EXEC" + return $hestiaKERNEL_ERROR_BAD_EXEC + fi + done + + + # execute + printf -- "$hestiaKERNEL_ERROR_OK" + return $hestiaKERNEL_ERROR_OK +} +################################################################################ +# Unix Main Codes # +################################################################################ +return 0 +#> diff --git a/automataCI/services/hestiaFS/Is_Exist.sh.ps1 b/automataCI/services/hestiaFS/Is_Exist.sh.ps1 new file mode 100644 index 0000000..cab2177 --- /dev/null +++ b/automataCI/services/hestiaFS/Is_Exist.sh.ps1 @@ -0,0 +1,120 @@ +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.sh.ps1" +. "${env:LIBS_HESTIA}\hestiaFS\Is_Directory.sh.ps1" +. "${env:LIBS_HESTIA}\hestiaFS\Is_File.sh.ps1" +. "${env:LIBS_HESTIA}\hestiaSTRING\Is_Empty.sh.ps1" + + + + +function hestiaFS-Is-Exist { + param ( + [string]$___target + ) + + + # validate input + if ($(hestiaSTRING-Is-Empty "${___target}") -eq ${env:hestiaKERNEL_ERROR_OK}) { + return ${env:hestiaKERNEL_ERROR_DATA_EMPTY} + } + + + # execute + if ($(hestiaFS-Is-Directory "${___target}") -eq ${env:hestiaKERNEL_ERROR_OK}) { + return ${env:hestiaKERNEL_ERROR_OK} + } + + if ($(hestiaFS-Is-File "${___target}") -eq ${env:hestiaKERNEL_ERROR_OK}) { + return ${env:hestiaKERNEL_ERROR_OK} + } + + + # execute + return ${env:hestiaKERNEL_ERROR_DATA_BAD} +} +################################################################################ +# Windows POWERSHELL Codes # +################################################################################ +return +<# +RUN_AS_POWERSHELL + + + + +################################################################################ +# Unix Main Codes # +################################################################################ +. "${LIBS_HESTIA}/hestiaKERNEL/Error_Codes.sh.ps1" +. "${LIBS_HESTIA}/hestiaFS/Is_Directory.sh.ps1" +. "${LIBS_HESTIA}/hestiaFS/Is_File.sh.ps1" +. "${LIBS_HESTIA}/hestiaSTRING/Is_Empty.sh.ps1" + + + + +hestiaFS_Is_Exist() { + #___target="$1" + + + # validate input + if [ $(hestiaSTRING_Is_Empty "$1") -eq $hestiaKERNEL_ERROR_OK ]; then + printf -- "$hestiaKERNEL_ERROR_DATA_EMPTY" + return $hestiaKERNEL_ERROR_DATA_EMPTY + fi + + + # execute + if [ $(hestiaFS_Is_Directory "$1") -eq $hestiaKERNEL_ERROR_OK ]; then + printf -- "$hestiaKERNEL_ERROR_OK" + return $hestiaKERNEL_ERROR_OK + fi + + if [ $(hestiaFS_Is_File "$1") -eq $hestiaKERNEL_ERROR_OK ]; then + printf -- "$hestiaKERNEL_ERROR_OK" + return $hestiaKERNEL_ERROR_OK + fi + + + # execute + printf -- "$hestiaKERNEL_ERROR_DATA_BAD" + return $hestiaKERNEL_ERROR_DATA_BAD +} +################################################################################ +# Unix Main Codes # +################################################################################ +return 0 +#> diff --git a/automataCI/services/hestiaFS/Is_File.sh.ps1 b/automataCI/services/hestiaFS/Is_File.sh.ps1 new file mode 100644 index 0000000..2ba4f98 --- /dev/null +++ b/automataCI/services/hestiaFS/Is_File.sh.ps1 @@ -0,0 +1,107 @@ +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.sh.ps1" +. "${env:LIBS_HESTIA}\hestiaSTRING\Is_Empty.sh.ps1" + + + + +function hestiaFS-Is-File { + param ( + [string]$___target + ) + + + # validate input + if ($(hestiaSTRING-Is-Empty "${___target}") -eq ${env:hestiaKERNEL_ERROR_OK}) { + return ${env:hestiaKERNEL_ERROR_DATA_EMPTY} + } + + + # execute + if (Test-Path -PathType leaf -Path "${___target}" -ErrorAction SilentlyContinue) { + return ${env:hestiaKERNEL_ERROR_OK} + } + + + # report status + return ${env:hestiaKERNEL_ERROR_DATA_BAD} +} +################################################################################ +# Windows POWERSHELL Codes # +################################################################################ +return +<# +RUN_AS_POWERSHELL + + + + +################################################################################ +# Unix Main Codes # +################################################################################ +. "${LIBS_HESTIA}/hestiaKERNEL/Error_Codes.sh.ps1" +. "${LIBS_HESTIA}/hestiaSTRING/Is_Empty.sh.ps1" + + + + +hestiaFS_Is_File() { + #___target="$1" + + + # validate input + if [ $(hestiaSTRING_Is_Empty "$1") -eq $hestiaKERNEL_ERROR_OK ]; then + printf -- "%d" "$hestiaKERNEL_ERROR_DATA_EMPTY" + return $hestiaKERNEL_ERROR_DATA_EMPTY + fi + + + # execute + if [ -f "$1" ]; then + printf -- "%d" "$hestiaKERNEL_ERROR_OK" + return $hestiaKERNEL_ERROR_OK + fi + + + # report status + printf -- "%d" "$hestiaKERNEL_ERROR_DATA_BAD" + return $hestiaKERNEL_ERROR_DATA_BAD +} +################################################################################ +# Unix Main Codes # +################################################################################ +return 0 +#> diff --git a/automataCI/services/hestiaFS/Is_Filename_Has.sh.ps1 b/automataCI/services/hestiaFS/Is_Filename_Has.sh.ps1 new file mode 100644 index 0000000..c00bc05 --- /dev/null +++ b/automataCI/services/hestiaFS/Is_Filename_Has.sh.ps1 @@ -0,0 +1,118 @@ +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.sh.ps1" +. "${env:LIBS_HESTIA}\hestiaSTRING\Is_Empty.sh.ps1" + + + + +function hestiaFS-Is-Filename-Has { + param ( + [string]$___filepath, + [string]$___target + ) + + + # validate input + if ($(hestiaSTRING-Is-Empty "${___filepath}") -eq ${env:hestiaKERNEL_ERROR_OK}) { + return ${env:hestiaKERNEL_ERROR_ENTITY_EMPTY} + } + + if ($(hestiaSTRING-Is-Empty "${___target}") -eq ${env:hestiaKERNEL_ERROR_OK}) { + return ${env:hestiaKERNEL_ERROR_DATA_EMPTY} + } + + + # execute + if ($("${___filepath}" -replace ".*${___target}", '') -ne "${___filepath}") { + return ${env:hestiaKERNEL_ERROR_OK} + } + + + # execute + return ${env:hestiaKERNEL_ERROR_DATA_BAD} +} +################################################################################ +# Windows POWERSHELL Codes # +################################################################################ +return +<# +RUN_AS_POWERSHELL + + + + +################################################################################ +# Unix Main Codes # +################################################################################ +. "${LIBS_HESTIA}/hestiaKERNEL/Error_Codes.sh.ps1" +. "${LIBS_HESTIA}/hestiaSTRING/Is_Empty.sh.ps1" + + + + +hestiaFS_Is_Filename_Has() { + #___filepath="$1" + #___target="$2" + + + # validate input + if [ $(hestiaSTRING_Is_Empty "$1") -eq $hestiaKERNEL_ERROR_OK ]; then + printf -- "%d" $hestiaKERNEL_ERROR_ENTITY_EMPTY + return $hestiaKERNEL_ERROR_ENTITY_EMPTY + fi + + if [ $(hestiaSTRING_Is_Empty "$2") -eq $hestiaKERNEL_ERROR_OK ]; then + printf -- "%d" $hestiaKERNEL_ERROR_DATA_EMPTY + return $hestiaKERNEL_ERROR_DATA_EMPTY + fi + + + # execute + if [ ! "${1#*${2}}" = "$1" ]; then + printf -- "%d" $hestiaKERNEL_ERROR_OK + return $hestiaKERNEL_ERROR_OK + fi + + + # execute + printf -- "%d" $hestiaKERNEL_ERROR_DATA_BAD + return $hestiaKERNEL_ERROR_DATA_BAD +} +################################################################################ +# Unix Main Codes # +################################################################################ +return 0 +#> diff --git a/automataCI/services/hestiaFS/Move.sh.ps1 b/automataCI/services/hestiaFS/Move.sh.ps1 new file mode 100644 index 0000000..b78c06d --- /dev/null +++ b/automataCI/services/hestiaFS/Move.sh.ps1 @@ -0,0 +1,142 @@ +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\Is_Empty.sh.ps1" + + + + +function hestiaFS-Move { + param ( + [string]$___destination, + [string]$___source + ) + + + # validate input + if ($(hestiaSTRING-Is-Empty "${___destination}") -eq ${env:hestiaKERNEL_ERROR_OK}) { + return ${env:hestiaKERNEL_ERROR_ENTITY_EMPTY} + } + + if ($(hestiaSTRING-Is-Empty "${___source}") -eq ${env:hestiaKERNEL_ERROR_OK}) { + return ${env:hestiaKERNEL_ERROR_DATA_EMPTY} + } + + if ($(hestiaFS-Is-Exist "${___source}") -ne ${env:hestiaKERNEL_ERROR_OK}) { + return ${env:hestiaKERNEL_ERROR_DATA_MISSING} + } + + if ($(hestiaFS-Is-Exist "${___destination}") -eq ${env:hestiaKERNEL_ERROR_OK}) { + return ${env:hestiaKERNEL_ERROR_ENTITY_EXISTS} + } + + + # execute + try { + Move-Item -Force -Path $___source -Destination $___destination + if ($?) { + $___process = ${env:hestiaKERNEL_ERROR_OK} + } else { + $___process = ${env:hestiaKERNEL_ERROR_BAD_EXEC} + } + } catch { + $___process = ${env:hestiaKERNEL_ERROR_BAD_EXEC} + } + + if ($___process -ne ${env:hestiaKERNEL_ERROR_OK}) { + return ${env:hestiaKERNEL_ERROR_BAD_EXEC} + } + + + # execute + return ${env:hestiaKERNEL_ERROR_OK} +} +################################################################################ +# Windows POWERSHELL Codes # +################################################################################ +return +<# +RUN_AS_POWERSHELL + + + + +################################################################################ +# Unix Main Codes # +################################################################################ +. "${LIBS_HESTIA}/hestiaKERNEL/Vanilla.sh.ps1" +. "${LIBS_HESTIA}/hestiaSTRING/Is_Empty.sh.ps1" + + + + +hestiaFS_Move() { + #___destination="$1" + #___source="$2" + + + # validate input + if [ $(hestiaSTRING_Is_Empty "$1") -eq $hestiaKERNEL_ERROR_OK ]; then + return $hestiaKERNEL_ERROR_ENTITY_EMPTY + fi + + if [ $(hestiaSTRING_Is_Empty "$2") -eq $hestiaKERNEL_ERROR_OK ]; then + return $hestiaKERNEL_ERROR_DATA_EMPTY + fi + + if [ $(hestiaFS_Is_Exist "$2") -ne $hestiaKERNEL_ERROR_OK ]; then + return $hestiaKERNEL_ERROR_DATA_MISSING + fi + + if [ $(hestiaFS_Is_Exist "$1") -eq $hestiaKERNEL_ERROR_OK ]; then + return $hestiaKERNEL_ERROR_ENTITY_EXISTS + fi + + + # execute + mv "$2" "$1" + 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/hestiaFS/Recreate_Directory.sh.ps1 b/automataCI/services/hestiaFS/Recreate_Directory.sh.ps1 new file mode 100644 index 0000000..96b8a76 --- /dev/null +++ b/automataCI/services/hestiaFS/Recreate_Directory.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\Create_Directory.sh.ps1" +. "${env:LIBS_HESTIA}\hestiaFS\Is_File.sh.ps1" +. "${env:LIBS_HESTIA}\hestiaFS\Remove.sh.ps1" +. "${env:LIBS_HESTIA}\hestiaSTRING\Is_Empty.sh.ps1" + + + + +function hestiaFS-Recreate-Directory { + param ( + [string]$___filepath + ) + + + # validate input + if ($(hestiaSTRING-Is-Empty "${___filepath}") -eq ${env:hestiaKERNEL_ERROR_OK}) { + return ${env:hestiaKERNEL_ERROR_DATA_EMPTY} + } + + if ($(hestiaFS-Is-File "${___filepath}") -eq ${env:hestiaKERNEL_ERROR_OK}) { + return $hestiaKERNEL_ERROR_DATA_IS_NOT_DIRECTORY + } + + + # execute + $null = hestiaFS-Remove "${___filepath}" + $___process = hestiaFS-Create-Directory "${___filepath}" + if ($___process -ne ${env:hestiaKERNEL_ERROR_OK}) { + return ${env:hestiaKERNEL_ERROR_BAD_EXEC} + } + + + # execute + return ${env:hestiaKERNEL_ERROR_OK} +} +################################################################################ +# Windows POWERSHELL Codes # +################################################################################ +return +<# +RUN_AS_POWERSHELL + + + + +################################################################################ +# Unix Main Codes # +################################################################################ +. "${LIBS_HESTIA}/hestiaKERNEL/Vanilla.sh.ps1" +. "${LIBS_HESTIA}/hestiaFS/Create_Directory.sh.ps1" +. "${LIBS_HESTIA}/hestiaFS/Is_File.sh.ps1" +. "${LIBS_HESTIA}/hestiaFS/Remove.sh.ps1" +. "${LIBS_HESTIA}/hestiaSTRING/Is_Empty.sh.ps1" + + + + +hestiaFS_Recreate_Directory() { + #___filepath="$1" + + + # validate input + if [ $(hestiaSTRING_Is_Empty "$1") -eq $hestiaKERNEL_ERROR_OK ]; then + return $hestiaKERNEL_ERROR_DATA_EMPTY + fi + + if [ $(hestiaFS_Is_File "$1") -eq $hestiaKERNEL_ERROR_OK ]; then + return $hestiaKERNEL_ERROR_DATA_IS_NOT_DIRECTORY + fi + + + # execute + hestiaFS_Remove "$1" + hestiaFS_Create_Directory "$1" + 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/hestiaFS/Remove.sh.ps1 b/automataCI/services/hestiaFS/Remove.sh.ps1 new file mode 100644 index 0000000..2409a8c --- /dev/null +++ b/automataCI/services/hestiaFS/Remove.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}\hestiaSTRING\Is_Empty.sh.ps1" +. "${env:LIBS_HESTIA}\hestiaFS\Is_Exist.sh.ps1" + + + + +function hestiaFS-Remove { + param ( + [string]$___filepath + ) + + + # validate input + if ($(hestiaSTRING-Is-Empty "${___filepath}") -eq ${env:hestiaKERNEL_ERROR_OK}) { + return ${env:hestiaKERNEL_ERROR_DATA_EMPTY} + } + + if ($(hestiaFS-Is-Exist "${___filepath}") -ne ${env:hestiaKERNEL_ERROR_OK}) { + return ${env:hestiaKERNEL_ERROR_DATA_DEAD} + } + + + # execute + try { + $___process = Remove-Item -Recurse -Force -Path $___filepath + if ($___process -eq $null) { + $___process = ${env:hestiaKERNEL_ERROR_OK} + } else { + $___process = ${env:hestiaKERNEL_ERROR_BAD_EXEC} + } + } catch { + $___process = ${env:hestiaKERNEL_ERROR_BAD_EXEC} + } + + if ($___process -ne ${env:hestiaKERNEL_ERROR_OK}) { + return ${env:hestiaKERNEL_ERROR_BAD_EXEC} + } + + + # execute + return ${env:hestiaKERNEL_ERROR_OK} +} +################################################################################ +# Windows POWERSHELL Codes # +################################################################################ +return +<# +RUN_AS_POWERSHELL + + + + +################################################################################ +# Unix Main Codes # +################################################################################ +. "${LIBS_HESTIA}/hestiaKERNEL/Vanilla.sh.ps1" +. "${LIBS_HESTIA}/hestiaSTRING/Is_Empty.sh.ps1" +. "${LIBS_HESTIA}/hestiaFS/Is_Exist.sh.ps1" + + + + +hestiaFS_Remove() { + #___filepath="$1" + + + # validate input + if [ $(hestiaSTRING_Is_Empty "$1") -eq $hestiaKERNEL_ERROR_OK ]; then + return $hestiaKERNEL_ERROR_DATA_EMPTY + fi + + if [ $(hestiaFS_Is_Exist "$1") -ne $hestiaKERNEL_ERROR_OK ]; then + return $hestiaKERNEL_ERROR_DATA_DEAD + fi + + + # execute + rm -rf "$1" &> /dev/null + if [ $? -ne $hestiaKERNEL_ERROR_OK ]; then + return $hestiaKERNEL_ERROR_BAD_EXEC + fi + + + # execute + return $hestiaKERNEL_ERROR_OK +} +################################################################################ +# Unix Main Codes # +################################################################################ +return 0 +#> diff --git a/automataCI/services/hestiaFS/Replace_Extension.sh.ps1 b/automataCI/services/hestiaFS/Replace_Extension.sh.ps1 new file mode 100644 index 0000000..4674e3c --- /dev/null +++ b/automataCI/services/hestiaFS/Replace_Extension.sh.ps1 @@ -0,0 +1,172 @@ +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.sh.ps1" +. "${env:LIBS_HESTIA}\hestiaSTRING\Is_Empty.sh.ps1" + + + + +function hestiaFS-Replace-Extension { + param ( + [string]$___target + ) + + + # validate input + if ($(hestiaSTRING-Is-Empty "${___target}") -eq ${env:hestiaKERNEL_ERROR_OK}) { + return ${env:hestiaKERNEL_ERROR_DATA_EMPTY} + } + + + # execute + $___target = Split-Path -Leaf "${___path}" + if ($___extension -eq "*") { + ## trim all extensions to the first period + $___target = $___target -replace '(\.\w+)+$' + + ## restore directory pathing when available + if (-not [string]::IsNullOrEmpty($(Split-Path -Parent "${___path}"))) { + $___target = $(Split-Path -Parent "${___path}") + "\" + "${___target}" + } + } elseif (-not [string]::IsNullOrEmpty($___extension)) { + ## trim off existing extension + if ($___extension.Substring(0,1) -eq ".") { + $___extension = $___extension.Substring(1) + } + $___target = $___target -replace "\.${___extension}$" + + ## append new extension when available + if ($___target -ne $___path) { + if (-not [string]::IsNullOrEmpty($___candidate)) { + if ($___candidate.Substring(0,1) -eq ".") { + $___target += "." + $___candidate.Substring(1) + } else { + $___target += "." + $___candidate + } + } + } + + ## restore directory pathing when available + if (-not [string]::IsNullOrEmpty($(Split-Path -Parent "${___path}"))) { + $___target = $(Split-Path -Parent "${___path}") + "\" + "${___target}" + } + } else { + ## do nothing + $___target = $___path + } + + + # report status + return $___target +} +################################################################################ +# Windows POWERSHELL Codes # +################################################################################ +return +<# +RUN_AS_POWERSHELL + + + + +################################################################################ +# Unix Main Codes # +################################################################################ +. "${LIBS_HESTIA}/hestiaKERNEL/Error_Codes.sh.ps1" +. "${LIBS_HESTIA}/hestiaSTRING/Is_Empty.sh.ps1" + + + + +hestiaFS_Replace_Extension() { + #___target="$1" + + + # validate input + if [ $(hestiaSTRING_Is_Empty "$1") -eq $hestiaKERNEL_ERROR_OK ]; then + printf -- "%d" "$hestiaKERNEL_ERROR_DATA_EMPTY" + return $hestiaKERNEL_ERROR_DATA_EMPTY + fi + + + # execute + ___target="${1##*/}" + if [ "$2" = "*" ]; then + ## trim all extensions to the first period + ___target="${___target%%.*}" + + ## restore directory pathing when available + if [ ! -z "${1%/*}" ] && [ ! "${1%/*}" = "$1" ]; then + ___target="${1%/*}/${___target}" + fi + elif [ ! -z "$2" ]; then + ## trim off existing extension + if [ "$(printf -- "%.1s" "$2")" = "." ]; then + ___extension="${2#*.}" + else + ___extension="$2" + fi + ___target="${___target%.${___extension}*}" + + ## append new extension when available + if [ ! "${___target}" = "${1##*/}" ]; then + if [ ! -z "$3" ]; then + if [ "$(printf -- "%.1s" "$3")" = "." ]; then + ___target="${___target}.${3#*.}" + else + ___target="${___target}.${3}" + fi + fi + fi + + ## restore directory pathing when available + if [ ! -z "${1%/*}" ] && [ ! "${1%/*}" = "$1" ]; then + ___target="${1%/*}/${___target}" + fi + else + ## do nothing + ___target="$1" + fi + + + # report status + printf -- "%s" "$___target" + return 0 +} +################################################################################ +# Unix Main Codes # +################################################################################ +return 0 +#> diff --git a/automataCI/services/hestiaFS/Vanilla.sh.ps1 b/automataCI/services/hestiaFS/Vanilla.sh.ps1 new file mode 100644 index 0000000..a45bb68 --- /dev/null +++ b/automataCI/services/hestiaFS/Vanilla.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}\hestiaFS\Append_File.sh.ps1" +. "${env:LIBS_HESTIA}\hestiaFS\Copy_Directory.sh.ps1" +. "${env:LIBS_HESTIA}\hestiaFS\Copy_File.sh.ps1" +. "${env:LIBS_HESTIA}\hestiaFS\Create_Directory.sh.ps1" +. "${env:LIBS_HESTIA}\hestiaFS\Get_Directory.sh.ps1" +. "${env:LIBS_HESTIA}\hestiaFS\Get_File.sh.ps1" +. "${env:LIBS_HESTIA}\hestiaFS\Is_Directory_Empty.sh.ps1" +. "${env:LIBS_HESTIA}\hestiaFS\Is_Directory.sh.ps1" +. "${env:LIBS_HESTIA}\hestiaFS\Is_Exist.sh.ps1" +. "${env:LIBS_HESTIA}\hestiaFS\Is_Filename_Has.sh.ps1" +. "${env:LIBS_HESTIA}\hestiaFS\Is_File.sh.ps1" +. "${env:LIBS_HESTIA}\hestiaFS\Move.sh.ps1" +. "${env:LIBS_HESTIA}\hestiaFS\Recreate_Directory.sh.ps1" +. "${env:LIBS_HESTIA}\hestiaFS\Replace_Extension.sh.ps1" +. "${env:LIBS_HESTIA}\hestiaFS\Remove.sh.ps1" +. "${env:LIBS_HESTIA}\hestiaFS\Write_File.sh.ps1" +################################################################################ +# Windows POWERSHELL Codes # +################################################################################ +return +<# +RUN_AS_POWERSHELL + + + + +################################################################################ +# Unix Main Codes # +################################################################################ +. "${LIBS_HESTIA}/hestiaFS/Append_File.sh.ps1" +. "${LIBS_HESTIA}/hestiaFS/Copy_Directory.sh.ps1" +. "${LIBS_HESTIA}/hestiaFS/Copy_File.sh.ps1" +. "${LIBS_HESTIA}/hestiaFS/Create_Directory.sh.ps1" +. "${LIBS_HESTIA}/hestiaFS/Get_Directory.sh.ps1" +. "${LIBS_HESTIA}/hestiaFS/Get_File.sh.ps1" +. "${LIBS_HESTIA}/hestiaFS/Is_Directory_Empty.sh.ps1" +. "${LIBS_HESTIA}/hestiaFS/Is_Directory.sh.ps1" +. "${LIBS_HESTIA}/hestiaFS/Is_Exist.sh.ps1" +. "${LIBS_HESTIA}/hestiaFS/Is_Filename_Has.sh.ps1" +. "${LIBS_HESTIA}/hestiaFS/Is_File.sh.ps1" +. "${LIBS_HESTIA}/hestiaFS/Move.sh.ps1" +. "${LIBS_HESTIA}/hestiaFS/Recreate_Directory.sh.ps1" +. "${LIBS_HESTIA}/hestiaFS/Replace_Extension.sh.ps1" +. "${LIBS_HESTIA}/hestiaFS/Remove.sh.ps1" +. "${LIBS_HESTIA}/hestiaFS/Write_File.sh.ps1" +################################################################################ +# Unix Main Codes # +################################################################################ +return 0 +#> diff --git a/automataCI/services/hestiaFS/Write_File.sh.ps1 b/automataCI/services/hestiaFS/Write_File.sh.ps1 new file mode 100644 index 0000000..c12cbaa --- /dev/null +++ b/automataCI/services/hestiaFS/Write_File.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\Error_Codes.sh.ps1" +. "${env:LIBS_HESTIA}\hestiaFS\Is_Directory.sh.ps1" +. "${env:LIBS_HESTIA}\hestiaSTRING\Is_Empty.sh.ps1" + + + + +function hestiaFS-Write-File { + param ( + [string]$___target, + [string]$___content + ) + + + # validate input + if ($(hestiaSTRING-Is-Empty "${___target}") -eq ${env:hestiaKERNEL_ERROR_OK}) { + return ${env:hestiaKERNEL_ERROR_ENTITY_MISSING} + } + + if ($(hestiaFS-Is-Directory "${___target}") -eq ${env:hestiaKERNEL_ERROR_OK}) { + return ${env:hestiaKERNEL_ERROR_ENTITY_IS_NOT_FILE} + } + + if ($(hestiaSTRING-Is-Empty "${___content}") -eq ${env:hestiaKERNEL_ERROR_OK}) { + return ${env:hestiaKERNEL_ERROR_DATA_EMPTY} + } + + + # execute + $null = Set-Content -NoNewline -Path $___target -Value $___content + if ($?) { + return ${env:hestiaKERNEL_ERROR_OK} + } + + + # report status + return ${env:hestiaKERNEL_ERROR_BAD_EXEC} +} +################################################################################ +# Windows POWERSHELL Codes # +################################################################################ +return +<# +RUN_AS_POWERSHELL + + + + +################################################################################ +# Unix Main Codes # +################################################################################ +. "${LIBS_HESTIA}/hestiaKERNEL/Error_Codes.sh.ps1" +. "${LIBS_HESTIA}/hestiaFS/Is_Directory.sh.ps1" +. "${LIBS_HESTIA}/hestiaSTRING/Is_Empty.sh.ps1" + + + + +hestiaFS_Write_File() { + #___target="$1" + #___content="$2" + + + # validate input + if [ $(hestiaSTRING_Is_Empty "$1") -eq $hestiaKERNEL_ERROR_OK ]; then + return $hestiaKERNEL_ERROR_ENTITY_MISSING + fi + + if [ $(hestiaFS_Is_Directory "$1") -eq $hestiaKERNEL_ERROR_OK ]; then + return $hestiaKERNEL_ERROR_ENTITY_IS_NOT_FILE + fi + + if [ $(hestiaSTRING_Is_Empty "$2") -eq $hestiaKERNEL_ERROR_OK ]; then + return $hestiaKERNEL_ERROR_DATA_EMPTY + fi + + + # execute + printf -- "%b" "$2" > "$1" + if [ $? -eq $hestiaKERNEL_ERROR_OK ]; then + return $hestiaKERNEL_ERROR_OK + fi + + + # execute + return $hestiaKERNEL_ERROR_BAD_EXEC +} +################################################################################ +# Unix Main Codes # +################################################################################ +return 0 +#> diff --git a/automataCI/services/hestiaGIT/Change_Branch.sh.ps1 b/automataCI/services/hestiaGIT/Change_Branch.sh.ps1 new file mode 100644 index 0000000..ba0247a --- /dev/null +++ b/automataCI/services/hestiaGIT/Change_Branch.sh.ps1 @@ -0,0 +1,154 @@ +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\Is_Directory.sh.ps1" +. "${env:LIBS_HESTIA}\hestiaGIT\Is_Available.sh.ps1" +. "${env:LIBS_HESTIA}\hestiaKERNEL\Vanilla.sh.ps1" +. "${env:LIBS_HESTIA}\hestiaSTRING\Is_Empty.sh.ps1" + + + + +function hestiaGIT-Change-Branch { + param ( + [string]$___directory, + [string]$___branch + ) + + + # validate input + if ($(hestiaGIT-Is-Available) -ne ${env:hestiaKERNEL_ERROR_OK}) { + return ${env:hestiaKERNEL_ERROR_NOT_POSSIBLE} + } + + if ($(hestiaSTRING-Is-Empty "${___directory}") -eq ${env:hestiaKERNEL_ERROR_OK}) { + return ${env:hestiaKERNEL_ERROR_ENTITY_EMPTY} + } + + if ($(hestiaSTRING-Is-Empty "${___branch}") -eq ${env:hestiaKERNEL_ERROR_OK}) { + return ${env:hestiaKERNEL_ERROR_DATA_EMPTY} + } + + if ($(hestiaFS-Is-Directory "${___directory}") -ne ${env:hestiaKERNEL_ERROR_OK}) { + return ${env:hestiaKERNEL_ERROR_ENTITY_IS_NOT_DIRECTORY} + } + + if ($(hestiaFS-Is-Directory "${___directory}\.git") -ne ${env:hestiaKERNEL_ERROR_OK}) { + return ${env:hestiaKERNEL_ERROR_ENTITY_INVALID} + } + + + # execute + $___current_path = Get-Location + $null = Set-Location "${___directory}" + $___process = hestiaOS-Exec "git" "checkout `"${___branch}`"" + $null = Set-Location $___current_path + $null = Remove-Variable ___current_path + 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}/hestiaFS/Is_Directory.sh.ps1" +. "${LIBS_HESTIA}/hestiaGIT/Is_Available.sh.ps1" +. "${LIBS_HESTIA}/hestiaKERNEL/Vanilla.sh.ps1" +. "${LIBS_HESTIA}/hestiaSTRING/Is_Empty.sh.ps1" + + + + +hestiaGIT_Change_Branch() { + #___directory="$1" + #___branch="$2" + + + # validate input + if [ $(hestiaGIT_Is_Available) -ne $hestiaKERNEL_ERROR_OK ]; then + return $hestiaKERNEL_ERROR_NOT_POSSIBLE + fi + + if [ $(hestiaSTRING_Is_Empty "$1") -eq $hestiaKERNEL_ERROR_OK ]; then + return $hestiaKERNEL_ERROR_ENTITY_EMPTY + fi + + if [ $(hestiaSTRING_Is_Empty "$2") -eq $hestiaKERNEL_ERROR_OK ]; then + return $hestiaKERNEL_ERROR_DATA_EMPTY + fi + + if [ $(hestiaFS_Is_Directory "$1") -ne $hestiaKERNEL_ERROR_OK ]; then + return $hestiaKERNEL_ERROR_ENTITY_IS_NOT_DIRECTORY + fi + + if [ $(hestiaFS_Is_Directory "${1}/.git") -ne $hestiaKERNEL_ERROR_OK ]; then + return $hestiaKERNEL_ERROR_ENTITY_INVALID + fi + + + # execute + ___current_path="$PWD" + cd "$1" + git checkout "$2" + ___process=$? + cd "$___current_path" + unset ___current_path + + 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/hestiaGIT/Clone.sh.ps1 b/automataCI/services/hestiaGIT/Clone.sh.ps1 new file mode 100644 index 0000000..3165187 --- /dev/null +++ b/automataCI/services/hestiaGIT/Clone.sh.ps1 @@ -0,0 +1,156 @@ +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\Vanilla.sh.ps1" +. "${env:LIBS_HESTIA}\hestiaGIT\Is_Available.sh.ps1" +. "${env:LIBS_HESTIA}\hestiaKERNEL\Vanilla.sh.ps1" +. "${env:LIBS_HESTIA}\hestiaSTRING\Is_Empty.sh.ps1" + + + + +function hestiaGIT-Clone { + param ( + [string]$___url, + [string]$___directory + ) + + + # validate input + if ($(hestiaGIT-Is-Available) -ne ${env:hestiaKERNEL_ERROR_OK}) { + return ${env:hestiaKERNEL_ERROR_NOT_POSSIBLE} + } + + if ($(hestiaSTRING-Is-Empty "${___url}") -eq ${env:hestiaKERNEL_ERROR_OK}) { + return ${env:hestiaKERNEL_ERROR_DATA_EMPTY} + } + + if ($(hestiaSTRING-Is-Empty "${___directory}") -eq ${env:hestiaKERNEL_ERROR_OK}) { + return ${env:hestiaKERNEL_ERROR_ENTITY_EMPTY} + } + + if ($(hestiaFS-Is-Exist "${___directory}") -eq ${env:hestiaKERNEL_ERROR_OK}) { + return ${env:hestiaKERNEL_ERROR_ENTITY_EXISTS} + } + + + # execute + $___process = hestiaFS-Create-Directory "$(hestiaFS-Get-Directory "${___directory}")" + if ($___process -ne $hestiaKERNEL_ERROR_OK) { + return ${env:hestiaKERNEL_ERROR_BAD_EXEC} + } + + $___current_path = Get-Location + $null = Set-Location "$(hestiaFS-Get-Directory "${___directory}")" + $___process = hestiaOS-Exec "git" "clone `"${___url}`" `"${___directory}`"" + $null = Set-Location $___current_path + $null = Remove-Variable ___current_path + 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}/hestiaFS/Vanilla.sh.ps1" +. "${LIBS_HESTIA}/hestiaGIT/Is_Available.sh.ps1" +. "${LIBS_HESTIA}/hestiaKERNEL/Vanilla.sh.ps1" +. "${LIBS_HESTIA}/hestiaSTRING/Is_Empty.sh.ps1" + + + + +hestiaGIT_Clone() { + #___url="$1" + #___directory="$2" + + + # validate input + if [ $(hestiaGIT_Is_Available) -ne $hestiaKERNEL_ERROR_OK ]; then + return $hestiaKERNEL_ERROR_NOT_POSSIBLE + fi + + if [ $(hestiaSTRING_Is_Empty "$1") -eq $hestiaKERNEL_ERROR_OK ]; then + return $hestiaKERNEL_ERROR_DATA_EMPTY + fi + + if [ $(hestiaSTRING_Is_Empty "$2") -eq $hestiaKERNEL_ERROR_OK ]; then + return $hestiaKERNEL_ERROR_ENTITY_EMPTY + fi + + if [ $(hestiaFS_Is_Exist "$2") -eq $hestiaKERNEL_ERROR_OK ]; then + return $hestiaKERNEL_ERROR_ENTITY_EXISTS + fi + + + # execute + hestiaFS_Create_Directory "$(hestiaFS_Get_Directory "$2")" + if [ $? -ne $hestiaKERNEL_ERROR_OK ]; then + return $hestiaKERNEL_ERROR_BAD_EXEC + fi + + ___current_path="$PWD" + cd "$(hestiaFS_Get_Directory "$2")" + git clone "$1" "$2" + ___process=$? + cd "$___current_path" + unset ___current_path + + 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/hestiaGIT/Is_Available.sh.ps1 b/automataCI/services/hestiaGIT/Is_Available.sh.ps1 new file mode 100644 index 0000000..a3962d4 --- /dev/null +++ b/automataCI/services/hestiaGIT/Is_Available.sh.ps1 @@ -0,0 +1,86 @@ +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}\hestiaOS\Is_Command_Available.sh.ps1" + + + + +function hestiaGIT-Is-Available { + # execute + if ($(hestiaOS-Is-Command-Available "git") -eq ${env:hestiaKERNEL_ERROR_OK}) { + return ${env:hestiaKERNEL_ERROR_OK} + } + + + # report status + return ${env:hestiaKERNEL_ERROR_NOT_POSSIBLE} +} +################################################################################ +# Windows POWERSHELL Codes # +################################################################################ +return +<# +RUN_AS_POWERSHELL + + + + +################################################################################ +# Unix Main Codes # +################################################################################ +. "${LIBS_HESTIA}/hestiaKERNEL/Vanilla.sh.ps1" +. "${LIBS_HESTIA}/hestiaOS/Is_Command_Available.sh.ps1" + + + + +hestiaGIT_Is_Available() { + # execute + if [ $(hestiaOS_Is_Command_Available "git") -eq $hestiaKERNEL_ERROR_OK ]; then + printf -- "%d" $hestiaKERNEL_ERROR_OK + return $hestiaKERNEL_ERROR_OK + fi + + + # report status + printf -- "%d" $hestiaKERNEL_ERROR_NOT_POSSIBLE + return $hestiaKERNEL_ERROR_NOT_POSSIBLE +} +################################################################################ +# Unix Main Codes # +################################################################################ +return 0 +#> diff --git a/automataCI/services/hestiaGIT/Vanilla.sh.ps1 b/automataCI/services/hestiaGIT/Vanilla.sh.ps1 new file mode 100644 index 0000000..4ff9e35 --- /dev/null +++ b/automataCI/services/hestiaGIT/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}\hestiaGIT\Clone.sh.ps1" +. "${env:LIBS_HESTIA}\hestiaGIT\Change_Branch.sh.ps1" +. "${env:LIBS_HESTIA}\hestiaGIT\Is_Available.sh.ps1" +################################################################################ +# Windows POWERSHELL Codes # +################################################################################ +return +<# +RUN_AS_POWERSHELL + + + + +################################################################################ +# Unix Main Codes # +################################################################################ +. "${LIBS_HESTIA}/hestiaGIT/Clone.sh.ps1" +. "${LIBS_HESTIA}/hestiaGIT/Change_Branch.sh.ps1" +. "${LIBS_HESTIA}/hestiaGIT/Is_Available.sh.ps1" +################################################################################ +# Unix Main Codes # +################################################################################ +return 0 +#> diff --git a/automataCI/services/hestiaGZ/Compress.sh.ps1 b/automataCI/services/hestiaGZ/Compress.sh.ps1 new file mode 100644 index 0000000..b564601 --- /dev/null +++ b/automataCI/services/hestiaGZ/Compress.sh.ps1 @@ -0,0 +1,142 @@ +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\Is_File.sh.ps1" +. "${env:LIBS_HESTIA}\hestiaSTRING\Is_Empty.sh.ps1" +. "${env:LIBS_HESTIA}\hestiaOS\Vanilla.sh.ps1" + + + + +function hestiaGZ-Compress { + param ( + [string]$___source + ) + + + # validate input + if ($(hestiaSTRING-Is-Empty "${___source}") -eq ${env:hestiaKERNEL_ERROR_OK}) { + return ${env:hestiaKERNEL_ERROR_DATA_MISSING} + } + + if ($(hestiaFS-Is-File "${___source}") -ne ${env:hestiaKERNEL_ERROR_OK}) { + return ${env:hestiaKERNEL_ERROR_DATA_IS_NOT_FILE} + } + + + # execute + $___source = $___source -replace "\.gz$" + if ($(hestiaOS-Is-Command-Available "gzip") -eq ${env:hestiaKERNEL_ERROR_OK}) { + $___process = hestiaOS-Exec "gzip" "-9 `"${___source}`"" + if ($___process -ne ${env:hestiaKERNEL_ERROR_OK}) { + return ${env:hestiaKERNEL_ERROR_BAD_EXEC} + } + + return ${env:hestiaKERNEL_ERROR_OK} + } elseif ($(hestiaOS-Is-Command-Available "gunzip") -eq ${env:hestiaKERNEL_ERROR_OK}) { + $___process = hestiaOS-Exec "gunzip" "-9 `"${___source}`"" + if ($___process -ne ${env:hestiaKERNEL_ERROR_OK}) { + return ${env:hestiaKERNEL_ERROR_BAD_EXEC} + } + + return ${env:hestiaKERNEL_ERROR_OK} + } + + + # report status + return ${env:hestiaKERNEL_ERROR_BAD_EXEC} +} +################################################################################ +# Windows POWERSHELL Codes # +################################################################################ +return +<# +RUN_AS_POWERSHELL + + + + +################################################################################ +# Unix Main Codes # +################################################################################ +. "${LIBS_HESTIA}/hestiaFS/Is_File.sh.ps1" +. "${LIBS_HESTIA}/hestiaKERNEL/Vanilla.sh.ps1" +. "${LIBS_HESTIA}/hestiaOS/Is_Command_Available.sh.ps1" +. "${LIBS_HESTIA}/hestiaSTRING/Is_Empty.sh.ps1" + + + + +hestiaGZ_Compress() { + #___source="$1" + + + # validate input + if [ $(hestiaSTRING_Is_Empty "$1") -eq $hestiaKERNEL_ERROR_OK ]; then + return $hestiaKERNEL_ERROR_DATA_MISSING + fi + + if [ $(hestiaFS_Is_File "$1") -ne $hestiaKERNEL_ERROR_OK ]; then + return $hestiaKERNEL_ERROR_DATA_IS_NOT_FILE + fi + + + # execute + ___source="${1%.gz*}" + if [ $(hestiaOS_Is_Command_Available "gzip") -eq $hestiaKERNEL_ERROR_OK ]; then + gzip -9 "$___source" + if [ $? -ne $hestiaKERNEL_ERROR_OK ]; then + return $hestiaKERNEL_ERROR_BAD_EXEC + fi + + return $hestiaKERNEL_ERROR_OK + elif [ $(hestiaOS_Is_Command_Available "gunzip") -eq $hestiaKERNEL_ERROR_OK ]; then + gunzip -9 "$___source" + if [ $? -ne $hestiaKERNEL_ERROR_OK ]; then + return $hestiaKERNEL_ERROR_BAD_EXEC + fi + + return $hestiaKERNEL_ERROR_OK + fi + + + # report status + return $hestiaKERNEL_ERROR_BAD_EXEC +} +################################################################################ +# Unix Main Codes # +################################################################################ +return 0 +#> diff --git a/automataCI/services/hestiaGZ/Deflate.sh.ps1 b/automataCI/services/hestiaGZ/Deflate.sh.ps1 new file mode 100644 index 0000000..d72152b --- /dev/null +++ b/automataCI/services/hestiaGZ/Deflate.sh.ps1 @@ -0,0 +1,140 @@ +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}\hestiaGZ\Is_Target_Valid.sh.ps1" +. "${env:LIBS_HESTIA}\hestiaKERNEL\Vanilla.sh.ps1" +. "${env:LIBS_HESTIA}\hestiaSTRING\Is_Empty.sh.ps1" +. "${env:LIBS_HESTIA}\hestiaOS\Vanilla.sh.ps1" + + + + +function hestiaGZ-Deflate { + param ( + [string]$___source + ) + + + # validate input + if ($(hestiaSTRING-Is-Empty "${___source}") -eq ${env:hestiaKERNEL_ERROR_OK}) { + return ${env:hestiaKERNEL_ERROR_DATA_MISSING} + } + + if ($(hestiaGZ-Is-Target-Valid "${___source}") -eq ${env:hestiaKERNEL_ERROR_OK}) { + return ${env:hestiaKERNEL_ERROR_DATA_INVALID} + } + + + # execute + if ($(hestiaOS-Is-Command-Available "gzip") -eq ${env:hestiaKERNEL_ERROR_OK}) { + $___process = hestiaOS-Exec "gzip" "-d `"${___source}`"" + if ($___process -ne ${env:hestiaKERNEL_ERROR_OK}) { + return ${env:hestiaKERNEL_ERROR_BAD_EXEC} + } + + return ${env:hestiaKERNEL_ERROR_OK} + } elseif ($(hestiaOS-Is-Command-Available "gunzip") -eq ${env:hestiaKERNEL_ERROR_OK}) { + $___process = hestiaOS-Exec "gunzip" "-d `"${___source}`"" + if ($___process -ne ${env:hestiaKERNEL_ERROR_OK}) { + return ${env:hestiaKERNEL_ERROR_BAD_EXEC} + } + + return ${env:hestiaKERNEL_ERROR_OK} + } + + + # report status + return ${env:hestiaKERNEL_ERROR_BAD_EXEC} +} +################################################################################ +# Windows POWERSHELL Codes # +################################################################################ +return +<# +RUN_AS_POWERSHELL + + + + +################################################################################ +# Unix Main Codes # +################################################################################ +. "${LIBS_HESTIA}/hestiaKERNEL/Vanilla.sh.ps1" +. "${LIBS_HESTIA}/hestiaGZ/Is_Target_Valid.sh.ps1" +. "${LIBS_HESTIA}/hestiaSTRING/Is_Empty.sh.ps1" +. "${LIBS_HESTIA}/hestiaOS/Is_Command_Available.sh.ps1" + + + + +hestiaGZ_Deflate() { + #___source="$1" + + + # validate input + if [ $(hestiaSTRING_Is_Empty "$1") -eq $hestiaKERNEL_ERROR_OK ]; then + return $hestiaKERNEL_ERROR_DATA_MISSING + fi + + if [ $(hestiaGZ_Is_Target_Valid "$1") -ne $hestiaKERNEL_ERROR_OK ]; then + return $hestiaKERNEL_ERROR_DATA_INVALID + fi + + + # execute + if [ $(hestiaOS_Is_Command_Available "gzip") -eq $hestiaKERNEL_ERROR_OK ]; then + gzip -d "$___source" + if [ $? -ne $hestiaKERNEL_ERROR_OK ]; then + return $hestiaKERNEL_ERROR_BAD_EXEC + fi + + return $hestiaKERNEL_ERROR_OK + elif [ $(hestiaOS_Is_Command_Available "gunzip") -eq $hestiaKERNEL_ERROR_OK ]; then + gzip -d "$___source" + if [ $? -ne $hestiaKERNEL_ERROR_OK ]; then + return $hestiaKERNEL_ERROR_BAD_EXEC + fi + + return $hestiaKERNEL_ERROR_OK + fi + + + # report status + return $hestiaKERNEL_ERROR_BAD_EXEC +} +################################################################################ +# Unix Main Codes # +################################################################################ +return 0 +#> diff --git a/automataCI/services/hestiaGZ/Is_Available.sh.ps1 b/automataCI/services/hestiaGZ/Is_Available.sh.ps1 new file mode 100644 index 0000000..4afea0f --- /dev/null +++ b/automataCI/services/hestiaGZ/Is_Available.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 # +################################################################################ +. "${env:LIBS_HESTIA}\hestiaKERNEL\Vanilla.sh.ps1" +. "${env:LIBS_HESTIA}\hestiaOS\Is_Available.sh.ps1" + + + + +function hestiaGZ-Is-Available { + # execute + if ($(hestiaOS-Is-Command-Available "gzip") -eq ${env:hestiaKERNEL_ERROR_OK}) { + return ${env:hestiaKERNEL_ERROR_OK} + } + + if ($(hestiaOS-Is-Command-Available "gunzip") -eq ${env:hestiaKERNEL_ERROR_OK}) { + return ${env:hestiaKERNEL_ERROR_OK} + } + + + # report status + return ${env:hestiaKERNEL_ERROR_NOT_POSSIBLE} +} +################################################################################ +# Windows POWERSHELL Codes # +################################################################################ +return +<# +RUN_AS_POWERSHELL + + + + +################################################################################ +# Unix Main Codes # +################################################################################ +. "${LIBS_HESTIA}/hestiaKERNEL/Vanilla.sh.ps1" +. "${LIBS_HESTIA}/hestiaOS/Is_Command_Available.sh.ps1" + + + + +hestiaGZ_Is_Available() { + # execute + if [ $(hestiaOS_Is_Command_Available "gzip") -eq $hestiaKERNEL_ERROR_OK ]; then + printf -- "%d" $hestiaKERNEL_ERROR_OK + return $hestiaKERNEL_ERROR_OK + elif [ $(hestiaOS_Is_Command_Available "gunzip") -eq $hestiaKERNEL_ERROR_OK ]; then + printf -- "%d" $hestiaKERNEL_ERROR_OK + return $hestiaKERNEL_ERROR_OK + fi + + + # report status + printf -- "%d" $hestiaKERNEL_ERROR_NOT_POSSIBLE + return $hestiaKERNEL_ERROR_NOT_POSSIBLE +} +################################################################################ +# Unix Main Codes # +################################################################################ +return 0 +#> diff --git a/automataCI/services/hestiaGZ/Is_Target_Valid.sh.ps1 b/automataCI/services/hestiaGZ/Is_Target_Valid.sh.ps1 new file mode 100644 index 0000000..ce6f343 --- /dev/null +++ b/automataCI/services/hestiaGZ/Is_Target_Valid.sh.ps1 @@ -0,0 +1,120 @@ +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\Get_File.sh.ps1" +. "${env:LIBS_HESTIA}\hestiaSTRING\Is_Empty.sh.ps1" + + + + +function hestiaGZ-Is-Target-Valid { + param ( + [string]$___target + ) + + + # validate input + if ($(hestiaSTRING-Is-Empty "${___target}") -eq $hestiaKERNEL_ERROR_OK) { + return ${env:hestiaKERNEL_ERROR_DATA_EMPTY} + } + + + # execute + $___target = hestiaFS-Get-File "${___target}" + if ($("${___target}" -replace '.*\.tgz$', '') -ne "${___target}") { + return ${env:hestiaKERNEL_ERROR_OK} + } + + if ($("${___target}" -replace '.*\.gz$', '') -ne "${___target}") { + 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/Get_File.sh.ps1" +. "${LIBS_HESTIA}/hestiaSTRING/Is_Empty.sh.ps1" + + + + +hestiaGZ_Is_Target_Valid() { + #___target="$1" + + + # validate input + if [ $(hestiaSTRING_Is_Empty "$1") -eq $hestiaKERNEL_ERROR_OK ]; then + printf -- "%d" $hestiaKERNEL_ERROR_DATA_EMPTY + return $hestiaKERNEL_ERROR_DATA_EMPTY + fi + + + # execute + ___target="$(hestiaFS_Get_File "$1")" + if [ ! "${___target%%.tgz*}" = "$___target" ]; then + printf -- "%d" $hestiaKERNEL_ERROR_OK + return $hestiaKERNEL_ERROR_OK + fi + + if [ ! "${___target%%.gz*}" = "$___target" ]; 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/hestiaGZ/Vanilla.sh.ps1 b/automataCI/services/hestiaGZ/Vanilla.sh.ps1 new file mode 100644 index 0000000..00665ae --- /dev/null +++ b/automataCI/services/hestiaGZ/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}\hestiaGZ\Compress.sh.ps1" +. "${env:LIBS_HESTIA}\hestiaGZ\Deflate.sh.ps1" +. "${env:LIBS_HESTIA}\hestiaGZ\Is_Available.sh.ps1" +. "${env:LIBS_HESTIA}\hestiaGZ\Is_Target_Valid.sh.ps1" +################################################################################ +# Windows POWERSHELL Codes # +################################################################################ +return +<# +RUN_AS_POWERSHELL + + + + +################################################################################ +# Unix Main Codes # +################################################################################ +. "${LIBS_HESTIA}/hestiaGZ/Compress.sh.ps1" +. "${LIBS_HESTIA}/hestiaGZ/Deflate.sh.ps1" +. "${LIBS_HESTIA}/hestiaGZ/Is_Available.sh.ps1" +. "${LIBS_HESTIA}/hestiaGZ/Is_Target_Valid.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 100644 index 0000000..2e7a9c7 --- /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 100644 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/Get_Languages_List.sh.ps1 b/automataCI/services/hestiaI18N/Get_Languages_List.sh.ps1 old mode 100755 new mode 100644 index 6f4a16b..452c086 --- a/automataCI/services/hestiaI18N/Get_Languages_List.sh.ps1 +++ b/automataCI/services/hestiaI18N/Get_Languages_List.sh.ps1 @@ -33,7 +33,7 @@ echo \" <<'RUN_AS_POWERSHELL' >/dev/null # " | Out-Null # Windows POWERSHELL Codes # ################################################################################ function hestiaI18N-Get-Languages-List { - return @" + return @" en zh-hans diff --git a/automataCI/services/hestiaI18N/Translate_All_Components_Description.sh.ps1 b/automataCI/services/hestiaI18N/Translate_All_Components_Description.sh.ps1 new file mode 100644 index 0000000..59c95b7 --- /dev/null +++ b/automataCI/services/hestiaI18N/Translate_All_Components_Description.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-All-Components-Description { + param ( + [string]$___locale + ) + + + # execute + switch ($___locale) { + "zh-hans" { + # 简体中文 + return "包装里的所有元件。" + } default { + # fallback to default english + return "All components in this package." + }} + + + # report status + return 0 +} +################################################################################ +# Windows POWERSHELL Codes # +################################################################################ +return +<# +RUN_AS_POWERSHELL + + + + +################################################################################ +# Unix Main Codes # +################################################################################ +hestiaI18N_Translate_All_Components_Description() { + #___locale="$1" + + + # execute + case "$1" in + zh-hans) + # 简体中文 + printf -- "%s" "包装里的所有元件。" + ;; + *) + # fallback to default english + printf -- "%s" "All components in this package." + ;; + esac + + + # report status + return 0 +} +################################################################################ +# Unix Main Codes # +################################################################################ +return 0 +#> diff --git a/automataCI/services/hestiaI18N/Translate_All_Components_Title.sh.ps1 b/automataCI/services/hestiaI18N/Translate_All_Components_Title.sh.ps1 new file mode 100644 index 0000000..d5ca799 --- /dev/null +++ b/automataCI/services/hestiaI18N/Translate_All_Components_Title.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-All-Components-Title { + param ( + [string]$___locale + ) + + + # execute + switch ($___locale) { + "zh-hans" { + # 简体中文 + return "所有元件" + } default { + # fallback to default english + return "All Components" + }} + + + # report status + return 0 +} +################################################################################ +# Windows POWERSHELL Codes # +################################################################################ +return +<# +RUN_AS_POWERSHELL + + + + +################################################################################ +# Unix Main Codes # +################################################################################ +hestiaI18N_Translate_All_Components_Title() { + #___locale="$1" + + + # execute + case "$1" in + zh-hans) + # 简体中文 + printf -- "%s" "所有元件" + ;; + *) + # fallback to default english + printf -- "%s" "All Components" + ;; + esac + + + # report status + return 0 +} +################################################################################ +# Unix Main Codes # +################################################################################ +return 0 +#> diff --git a/automataCI/services/hestiaI18N/Translate-Already-Latest-Version.sh.ps1 b/automataCI/services/hestiaI18N/Translate_Already_Latest_Version.sh.ps1 old mode 100755 new mode 100644 similarity index 78% rename from automataCI/services/hestiaI18N/Translate-Already-Latest-Version.sh.ps1 rename to automataCI/services/hestiaI18N/Translate_Already_Latest_Version.sh.ps1 index a69b790..155582b --- a/automataCI/services/hestiaI18N/Translate-Already-Latest-Version.sh.ps1 +++ b/automataCI/services/hestiaI18N/Translate_Already_Latest_Version.sh.ps1 @@ -32,25 +32,25 @@ echo \" <<'RUN_AS_POWERSHELL' >/dev/null # " | Out-Null ################################################################################ # Windows POWERSHELL Codes # ################################################################################ -function hestiaI18N-Translate-Already-Latest-Version() { - param( - [string]$___locale - ) +function hestiaI18N-Translate-Already-Latest-Version { + param ( + [string]$___locale + ) - # execute - switch ("${___locale}") { - "zh-hans" { - # 简体中文 - return "您已经有同样或是最新的版本了。那就不需要任何另外加工吧。" - } default { - # fallback to default english - return "You have the same/latest version. No further action is required." - }} + # execute + switch ($___locale) { + "zh-hans" { + # 简体中文 + return "您已经有同样或是最新的版本了。那就不需要任何另外加工吧。" + } default { + # fallback to default english + return "You have the same/latest version. No further action is required." + }} - # report status - return 0 + # report status + return 0 } ################################################################################ # Windows POWERSHELL Codes # @@ -73,11 +73,11 @@ hestiaI18N_Translate_Already_Latest_Version() { case "$1" in zh-hans) # 简体中文 - printf -- "%b" "您已经有同样或是最新的版本了。那就不需要任何另外加工吧。" + printf -- "%s" "您已经有同样或是最新的版本了。那就不需要任何另外加工吧。" ;; *) # fallback to default english - printf -- "%b" "You have the same/latest version. No further action is required." + printf -- "%s" "You have the same/latest version. No further action is required." esac diff --git a/automataCI/services/hestiaI18N/Translate_Assemble.sh.ps1 b/automataCI/services/hestiaI18N/Translate_Assemble.sh.ps1 new file mode 100644 index 0000000..f259681 --- /dev/null +++ b/automataCI/services/hestiaI18N/Translate_Assemble.sh.ps1 @@ -0,0 +1,100 @@ +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-Assemble { + param ( + [string]$___locale, + [string]$___destination, + [string]$___source + ) + + + # execute + if ($___destination -eq "") { + $___destination = "???" + } + + if ($___source -eq "") { + $___source = "???" + } + + switch ($___locale) { + "zh-hans" { + # 简体中文 + return "聚集着‘${___source}’成‘${___destination}’。。。" + } default { + # fallback to default english + return "assembling '${___source}' as '${___destination}'..." + }} +} +################################################################################ +# Windows POWERSHELL Codes # +################################################################################ +return +<# +RUN_AS_POWERSHELL + + + + +################################################################################ +# Unix Main Codes # +################################################################################ +hestiaI18N_Translate_Assemble() { + #___locale="$1" + #___destination="$2" + #___source="$3" + + + # execute + case "$1" in + zh-hans) + # 简体中文 + printf -- "%s" "聚集着‘${3:-???}’成‘${2:-???}’。。。" + ;; + *) + # fallback to default english + printf -- "%s" "assembling '${3:-???}' as '${2:-???}'..." + ;; + esac + + + # report status + return 0 +} +################################################################################ +# Unix Main Codes # +################################################################################ +return 0 +#> diff --git a/automataCI/services/hestiaI18N/Translate_Assemble_Failed.sh.ps1 b/automataCI/services/hestiaI18N/Translate_Assemble_Failed.sh.ps1 new file mode 100644 index 0000000..c57eec6 --- /dev/null +++ b/automataCI/services/hestiaI18N/Translate_Assemble_Failed.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-Assemble-Failed { + param ( + [string]$___locale + ) + + + # execute + switch ($___locale) { + "zh-hans" { + # 简体中文 + return "聚集失败!" + } default { + # fallback to default english + return "assemble failed!" + }} +} +################################################################################ +# Windows POWERSHELL Codes # +################################################################################ +return +<# +RUN_AS_POWERSHELL + + + + +################################################################################ +# Unix Main Codes # +################################################################################ +hestiaI18N_Translate_Assemble_Failed() { + #___locale="$1" + + + # execute + case "$1" in + zh-hans) + # 简体中文 + printf -- "%s" "聚集失败!" + ;; + *) + # fallback to default english + printf -- "%s" "assemble failed!" + ;; + esac + + + # report status + return 0 +} +################################################################################ +# Unix Main Codes # +################################################################################ +return 0 +#> diff --git a/automataCI/services/hestiaI18N/Translate_Assemble_Simulate.sh.ps1 b/automataCI/services/hestiaI18N/Translate_Assemble_Simulate.sh.ps1 new file mode 100644 index 0000000..7456276 --- /dev/null +++ b/automataCI/services/hestiaI18N/Translate_Assemble_Simulate.sh.ps1 @@ -0,0 +1,91 @@ +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-Assemble-Simulate { + param( + [string]$___locale + ) + + + # execute + switch ($___locale) { + "zh-hans" { + # 简体中文 + return "正在仿真着聚集行动。。。" + } default { + # fallback to default english + return "simulating assembling activities..." + }} + + + # report status + return 0 +} +################################################################################ +# Windows POWERSHELL Codes # +################################################################################ +return +<# +RUN_AS_POWERSHELL + + + + +################################################################################ +# Unix Main Codes # +################################################################################ +hestiaI18N_Translate_Assemble_Simulate() { + #___locale="$1" + + + # execute + case "$1" in + zh-hans) + # 简体中文 + printf -- "%s" "正在仿真着聚集行动。。。" + ;; + *) + # fallback to default english + printf -- "%s" "simulating assembling activities..." + esac + + + # report status + return 0 +} +################################################################################ +# Unix Main Codes # +################################################################################ +return 0 +#> diff --git a/automataCI/services/hestiaI18N/Translate_Bin_Components_Description.sh.ps1 b/automataCI/services/hestiaI18N/Translate_Bin_Components_Description.sh.ps1 new file mode 100644 index 0000000..b50090c --- /dev/null +++ b/automataCI/services/hestiaI18N/Translate_Bin_Components_Description.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-Bin-Components-Description { + param ( + [string]$___locale + ) + + + # execute + switch ($___locale) { + "zh-hans" { + # 简体中文 + return "所有可启动的软件产品。" + } default { + # fallback to default english + return "All executable software products." + }} + + + # report status + return 0 +} +################################################################################ +# Windows POWERSHELL Codes # +################################################################################ +return +<# +RUN_AS_POWERSHELL + + + + +################################################################################ +# Unix Main Codes # +################################################################################ +hestiaI18N_Translate_Bin_Components_Description() { + #___locale="$1" + + + # execute + case "$1" in + zh-hans) + # 简体中文 + printf -- "%s" "所有可启动的软件产品。" + ;; + *) + # fallback to default english + printf -- "%s" "All executable software products." + ;; + esac + + + # report status + return 0 +} +################################################################################ +# Unix Main Codes # +################################################################################ +return 0 +#> diff --git a/automataCI/services/hestiaI18N/Translate_Bin_Components_Title.sh.ps1 b/automataCI/services/hestiaI18N/Translate_Bin_Components_Title.sh.ps1 new file mode 100644 index 0000000..7f93133 --- /dev/null +++ b/automataCI/services/hestiaI18N/Translate_Bin_Components_Title.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-Bin-Components-Title { + param ( + [string]$___locale + ) + + + # execute + switch ($___locale) { + "zh-hans" { + # 简体中文 + return "软件元件" + } default { + # fallback to default english + return "Executables Components" + }} + + + # report status + return 0 +} +################################################################################ +# Windows POWERSHELL Codes # +################################################################################ +return +<# +RUN_AS_POWERSHELL + + + + +################################################################################ +# Unix Main Codes # +################################################################################ +hestiaI18N_Translate_Bin_Components_Title() { + #___locale="$1" + + + # execute + case "$1" in + zh-hans) + # 简体中文 + printf -- "%s" "软件元件" + ;; + *) + # fallback to default english + printf -- "%s" "Executables Components" + ;; + esac + + + # report status + return 0 +} +################################################################################ +# Unix Main Codes # +################################################################################ +return 0 +#> diff --git a/automataCI/services/hestiaI18N/Translate_Check.sh.ps1 b/automataCI/services/hestiaI18N/Translate_Check.sh.ps1 new file mode 100644 index 0000000..dbe84a4 --- /dev/null +++ b/automataCI/services/hestiaI18N/Translate_Check.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-Check { + param ( + [string]$___locale, + [string]$___name + ) + + + # execute + if ($___name -eq "") { + $___name = "???" + } + + switch ($___locale) { + "zh-hans" { + # 简体中文 + return "检查着‘${___name}’。。。" + } default { + # fallback to default english + return "checking '${___name}'..." + }} +} +################################################################################ +# Windows POWERSHELL Codes # +################################################################################ +return +<# +RUN_AS_POWERSHELL + + + + +################################################################################ +# Unix Main Codes # +################################################################################ +hestiaI18N_Translate_Check() { + #___locale="$1" + #___name="$2" + + + # execute + case "$1" in + zh-hans) + # 简体中文 + printf -- "%s" "检查着‘${2:-???}’。。。" + ;; + *) + # fallback to default english + printf -- "%s" "checking '${2:-???}'..." + ;; + esac + + + # report status + return 0 +} +################################################################################ +# Unix Main Codes # +################################################################################ +return 0 +#> diff --git a/automataCI/services/hestiaI18N/Translate_Check_Availability.sh.ps1 b/automataCI/services/hestiaI18N/Translate_Check_Availability.sh.ps1 new file mode 100644 index 0000000..3a4a6e9 --- /dev/null +++ b/automataCI/services/hestiaI18N/Translate_Check_Availability.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-Check-Availability { + param( + [string]$___locale, + [string]$___name + ) + + + # execute + if ($___name -eq "") { + $___name = "???" + } + + switch ($___locale) { + "zh-hans" { + # 简体中文 + return "检查着‘${___name}’的存在。。。" + } default { + # fallback to default english + return "checking '${___name}' availability..." + }} +} +################################################################################ +# Windows POWERSHELL Codes # +################################################################################ +return +<# +RUN_AS_POWERSHELL + + + + +################################################################################ +# Unix Main Codes # +################################################################################ +hestiaI18N_Translate_Check_Availability() { + #___locale="$1" + #___name="$2" + + + # execute + case "$1" in + zh-hans) + # 简体中文 + printf -- "%s" "检查着‘${2:-???}’的存在。。。" + ;; + *) + # fallback to default english + printf -- "%s" "checking '${2:-???}' availability..." + ;; + esac + + + # report status + return 0 +} +################################################################################ +# Unix Main Codes # +################################################################################ +return 0 +#> diff --git a/automataCI/services/hestiaI18N/Translate-Config-Components-Description.sh.ps1 b/automataCI/services/hestiaI18N/Translate_Check_Failed.sh.ps1 old mode 100755 new mode 100644 similarity index 82% rename from automataCI/services/hestiaI18N/Translate-Config-Components-Description.sh.ps1 rename to automataCI/services/hestiaI18N/Translate_Check_Failed.sh.ps1 index 2820d6a..133b225 --- a/automataCI/services/hestiaI18N/Translate-Config-Components-Description.sh.ps1 +++ b/automataCI/services/hestiaI18N/Translate_Check_Failed.sh.ps1 @@ -32,25 +32,21 @@ echo \" <<'RUN_AS_POWERSHELL' >/dev/null # " | Out-Null ################################################################################ # Windows POWERSHELL Codes # ################################################################################ -function hestiaI18N-Translate-Config-Components-Description() { - param( - [string]$___locale - ) +function hestiaI18N-Translate-Check-Failed { + param ( + [string]$___locale + ) - # execute - switch ("${___locale}") { - "zh-hans" { - # 简体中文 - return "所有设定的文件。" - } default { - # fallback to default english - return "All configuration files." - }} - - - # report status - return 0 + # execute + switch ($___locale) { + "zh-hans" { + # 简体中文 + return "检查失败!" + } default { + # fallback to default english + return "check failed!" + }} } ################################################################################ # Windows POWERSHELL Codes # @@ -65,7 +61,7 @@ RUN_AS_POWERSHELL ################################################################################ # Unix Main Codes # ################################################################################ -hestiaI18N_Translate_Config_Components_Description() { +hestiaI18N_Translate_Check_Failed() { #___locale="$1" @@ -73,11 +69,11 @@ hestiaI18N_Translate_Config_Components_Description() { case "$1" in zh-hans) # 简体中文 - printf -- "%b" "所有设定的文件。" + printf -- "%s" "检查失败!" ;; *) # fallback to default english - printf -- "%b" "All configuration files." + printf -- "%s" "check failed!" ;; esac diff --git a/automataCI/services/hestiaI18N/Translate_Check_Simulate.sh.ps1 b/automataCI/services/hestiaI18N/Translate_Check_Simulate.sh.ps1 new file mode 100644 index 0000000..16e4fe2 --- /dev/null +++ b/automataCI/services/hestiaI18N/Translate_Check_Simulate.sh.ps1 @@ -0,0 +1,91 @@ +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-Check-Simulate { + param ( + [string]$___locale + ) + + + # execute + switch ($___locale) { + "zh-hans" { + # 简体中文 + return "正在仿真着检查行动。。。" + } default { + # fallback to default english + return "simulating checking activities..." + }} + + + # report status + return 0 +} +################################################################################ +# Windows POWERSHELL Codes # +################################################################################ +return +<# +RUN_AS_POWERSHELL + + + + +################################################################################ +# Unix Main Codes # +################################################################################ +hestiaI18N_Translate_Check_Simulate() { + #___locale="$1" + + + # execute + case "$1" in + zh-hans) + # 简体中文 + printf -- "%s" "正在仿真着检查行动。。。" + ;; + *) + # fallback to default english + printf -- "%s" "simulating checking activities..." + esac + + + # report status + return 0 +} +################################################################################ +# Unix Main Codes # +################################################################################ +return 0 +#> diff --git a/automataCI/services/hestiaI18N/Translate_Config_Components_Description.sh.ps1 b/automataCI/services/hestiaI18N/Translate_Config_Components_Description.sh.ps1 new file mode 100644 index 0000000..c352f9a --- /dev/null +++ b/automataCI/services/hestiaI18N/Translate_Config_Components_Description.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-Config-Components-Description { + param ( + [string]$___locale + ) + + + # execute + switch ($___locale) { + "zh-hans" { + # 简体中文 + return "所有设定的文件。" + } default { + # fallback to default english + return "All configuration files." + }} + + + # report status + return 0 +} +################################################################################ +# Windows POWERSHELL Codes # +################################################################################ +return +<# +RUN_AS_POWERSHELL + + + + +################################################################################ +# Unix Main Codes # +################################################################################ +hestiaI18N_Translate_Config_Components_Description() { + #___locale="$1" + + + # execute + case "$1" in + zh-hans) + # 简体中文 + printf -- "%s" "所有设定的文件。" + ;; + *) + # fallback to default english + printf -- "%s" "All configuration files." + ;; + esac + + + # report status + return 0 +} +################################################################################ +# Unix Main Codes # +################################################################################ +return 0 +#> diff --git a/automataCI/services/hestiaI18N/Translate_Config_Components_Title.sh.ps1 b/automataCI/services/hestiaI18N/Translate_Config_Components_Title.sh.ps1 new file mode 100644 index 0000000..eb03287 --- /dev/null +++ b/automataCI/services/hestiaI18N/Translate_Config_Components_Title.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-Config-Components-Title { + param ( + [string]$___locale + ) + + + # execute + switch ($___locale) { + "zh-hans" { + # 简体中文 + return "设定元件" + } default { + # fallback to default english + return "Configurations Components" + }} + + + # report status + return 0 +} +################################################################################ +# Windows POWERSHELL Codes # +################################################################################ +return +<# +RUN_AS_POWERSHELL + + + + +################################################################################ +# Unix Main Codes # +################################################################################ +hestiaI18N_Translate_Config_Components_Title() { + #___locale="$1" + + + # execute + case "$1" in + zh-hans) + # 简体中文 + printf -- "%s" "设定元件" + ;; + *) + # fallback to default english + printf -- "%s" "Configurations Components" + ;; + esac + + + # report status + return 0 +} +################################################################################ +# Unix Main Codes # +################################################################################ +return 0 +#> diff --git a/automataCI/services/hestiaI18N/Translate_Create.sh.ps1 b/automataCI/services/hestiaI18N/Translate_Create.sh.ps1 new file mode 100644 index 0000000..f27b658 --- /dev/null +++ b/automataCI/services/hestiaI18N/Translate_Create.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-Create { + param ( + [string]$___locale, + [string]$___name + ) + + + # execute + if ($___name -eq "") { + $___name = "???" + } + + switch ($___locale) { + "zh-hans" { + # 简体中文 + return "制作着‘${___name}’。。。" + } default { + # fallback to default english + return "creating '${___name}'..." + }} +} +################################################################################ +# Windows POWERSHELL Codes # +################################################################################ +return +<# +RUN_AS_POWERSHELL + + + + +################################################################################ +# Unix Main Codes # +################################################################################ +hestiaI18N_Translate_Create() { + #___locale="$1" + #___name="$2" + + + # execute + case "$1" in + zh-hans) + # 简体中文 + printf -- "%s" "制作着‘${2:-???}’。。。" + ;; + *) + # fallback to default english + printf -- "%s" "creating '${2:-???}'..." + ;; + esac + + + # report status + return 0 +} +################################################################################ +# Unix Main Codes # +################################################################################ +return 0 +#> diff --git a/automataCI/services/hestiaI18N/Translate-All-Components-Description.sh.ps1 b/automataCI/services/hestiaI18N/Translate_Create_Failed.sh.ps1 old mode 100755 new mode 100644 similarity index 82% rename from automataCI/services/hestiaI18N/Translate-All-Components-Description.sh.ps1 rename to automataCI/services/hestiaI18N/Translate_Create_Failed.sh.ps1 index 47f41d2..ca28218 --- a/automataCI/services/hestiaI18N/Translate-All-Components-Description.sh.ps1 +++ b/automataCI/services/hestiaI18N/Translate_Create_Failed.sh.ps1 @@ -32,25 +32,21 @@ echo \" <<'RUN_AS_POWERSHELL' >/dev/null # " | Out-Null ################################################################################ # Windows POWERSHELL Codes # ################################################################################ -function hestiaI18N-Translate-All-Components-Description() { - param( - [string]$___locale - ) +function hestiaI18N-Translate-Create-Failed { + param ( + [string]$___locale + ) - # execute - switch ("${___locale}") { - "zh-hans" { - # 简体中文 - return "包装里的所有元件。" - } default { - # fallback to default english - return "All components in this package." - }} - - - # report status - return 0 + # execute + switch (${___locale}) { + "zh-hans" { + # 简体中文 + return "制作失败!" + } default { + # fallback to default english + return "create failed!" + }} } ################################################################################ # Windows POWERSHELL Codes # @@ -65,7 +61,7 @@ RUN_AS_POWERSHELL ################################################################################ # Unix Main Codes # ################################################################################ -hestiaI18N_Translate_All_Components_Description() { +hestiaI18N_Translate_Create_Failed() { #___locale="$1" @@ -73,11 +69,11 @@ hestiaI18N_Translate_All_Components_Description() { case "$1" in zh-hans) # 简体中文 - printf -- "%b" "包装里的所有元件。" + printf -- "%s" "制作失败!" ;; *) # fallback to default english - printf -- "%b" "All components in this package." + printf -- "%s" "create failed!" ;; esac diff --git a/automataCI/services/hestiaI18N/Translate_Create_Simulate.sh.ps1 b/automataCI/services/hestiaI18N/Translate_Create_Simulate.sh.ps1 new file mode 100644 index 0000000..9da5a34 --- /dev/null +++ b/automataCI/services/hestiaI18N/Translate_Create_Simulate.sh.ps1 @@ -0,0 +1,91 @@ +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-Create-Simulate { + param ( + [string]$___locale + ) + + + # execute + switch (${___locale}) { + "zh-hans" { + # 简体中文 + return "正在仿真着制作行动。。。" + } default { + # fallback to default english + return "simulating creating activities..." + }} + + + # report status + return 0 +} +################################################################################ +# Windows POWERSHELL Codes # +################################################################################ +return +<# +RUN_AS_POWERSHELL + + + + +################################################################################ +# Unix Main Codes # +################################################################################ +hestiaI18N_Translate_Create_Simulate() { + #___locale="$1" + + + # execute + case "$1" in + zh-hans) + # 简体中文 + printf -- "%s" "正在仿真着制作行动。。。" + ;; + *) + # fallback to default english + printf -- "%s" "simulating creating activities..." + esac + + + # report status + return 0 +} +################################################################################ +# Unix Main Codes # +################################################################################ +return 0 +#> diff --git a/automataCI/services/hestiaI18N/Translate-Docs-Components-Description.sh.ps1 b/automataCI/services/hestiaI18N/Translate_Docs_Components_Description.sh.ps1 old mode 100755 new mode 100644 similarity index 80% rename from automataCI/services/hestiaI18N/Translate-Docs-Components-Description.sh.ps1 rename to automataCI/services/hestiaI18N/Translate_Docs_Components_Description.sh.ps1 index cfdd493..36ed150 --- a/automataCI/services/hestiaI18N/Translate-Docs-Components-Description.sh.ps1 +++ b/automataCI/services/hestiaI18N/Translate_Docs_Components_Description.sh.ps1 @@ -32,25 +32,25 @@ echo \" <<'RUN_AS_POWERSHELL' >/dev/null # " | Out-Null ################################################################################ # Windows POWERSHELL Codes # ################################################################################ -function hestiaI18N-Translate-Docs-Components-Description() { - param( - [string]$___locale - ) +function hestiaI18N-Translate-Docs-Components-Description { + param ( + [string]$___locale + ) - # execute - switch ("${___locale}") { - "zh-hans" { - # 简体中文 - return "所有笔记书写文稿。" - } default { - # fallback to default english - return "All articles and documentations." - }} + # execute + switch ($___locale) { + "zh-hans" { + # 简体中文 + return "所有笔记书写文稿。" + } default { + # fallback to default english + return "All articles and documentations." + }} - # report status - return 0 + # report status + return 0 } ################################################################################ # Windows POWERSHELL Codes # @@ -73,11 +73,11 @@ hestiaI18N_Translate_Docs_Components_Description() { case "$1" in zh-hans) # 简体中文 - printf -- "%b" "所有笔记书写文稿。" + printf -- "%s" "所有笔记书写文稿。" ;; *) # fallback to default english - printf -- "%b" "All articles and documentations." + printf -- "%s" "All articles and documentations." ;; esac diff --git a/automataCI/services/hestiaI18N/Translate-Docs-Components-Title.sh.ps1 b/automataCI/services/hestiaI18N/Translate_Docs_Components_Title.sh.ps1 old mode 100755 new mode 100644 similarity index 81% rename from automataCI/services/hestiaI18N/Translate-Docs-Components-Title.sh.ps1 rename to automataCI/services/hestiaI18N/Translate_Docs_Components_Title.sh.ps1 index f6133dd..0d4a2a3 --- a/automataCI/services/hestiaI18N/Translate-Docs-Components-Title.sh.ps1 +++ b/automataCI/services/hestiaI18N/Translate_Docs_Components_Title.sh.ps1 @@ -32,25 +32,25 @@ echo \" <<'RUN_AS_POWERSHELL' >/dev/null # " | Out-Null ################################################################################ # Windows POWERSHELL Codes # ################################################################################ -function hestiaI18N-Translate-Docs-Components-Title() { - param( - [string]$___locale - ) +function hestiaI18N-Translate-Docs-Components-Title { + param ( + [string]$___locale + ) - # execute - switch ("${___locale}") { - "zh-hans" { - # 简体中文 - return "书写笔记元件" - } default { - # fallback to default english - return "Documentations Components" - }} + # execute + switch ($___locale) { + "zh-hans" { + # 简体中文 + return "书写笔记元件" + } default { + # fallback to default english + return "Documentations Components" + }} - # report status - return 0 + # report status + return 0 } ################################################################################ # Windows POWERSHELL Codes # @@ -73,11 +73,11 @@ hestiaI18N_Translate_Docs_Components_Title() { case "$1" in zh-hans) # 简体中文 - printf -- "%b" "书写笔记元件" + printf -- "%s" "书写笔记元件" ;; *) # fallback to default english - printf -- "%b" "Documentations Components" + printf -- "%s" "Documentations Components" ;; esac diff --git a/automataCI/services/hestiaI18N/Translate-Bin-Components-Title.sh.ps1 b/automataCI/services/hestiaI18N/Translate_Done.sh.ps1 old mode 100755 new mode 100644 similarity index 83% rename from automataCI/services/hestiaI18N/Translate-Bin-Components-Title.sh.ps1 rename to automataCI/services/hestiaI18N/Translate_Done.sh.ps1 index cc9bac9..ee72e84 --- a/automataCI/services/hestiaI18N/Translate-Bin-Components-Title.sh.ps1 +++ b/automataCI/services/hestiaI18N/Translate_Done.sh.ps1 @@ -32,25 +32,21 @@ echo \" <<'RUN_AS_POWERSHELL' >/dev/null # " | Out-Null ################################################################################ # Windows POWERSHELL Codes # ################################################################################ -function hestiaI18N-Translate-Bin-Components-Title() { - param( - [string]$___locale - ) +function hestiaI18N-Translate-Done { + param ( + [string]$___locale + ) - # execute - switch ("${___locale}") { - "zh-hans" { - # 简体中文 - return "软件元件" - } default { - # fallback to default english - return "Executables Components" - }} - - - # report status - return 0 + # execute + switch (${___locale}) { + "zh-hans" { + # 简体中文 + return "搞定" + } default { + # fallback to default english + return "done" + }} } ################################################################################ # Windows POWERSHELL Codes # @@ -65,7 +61,7 @@ RUN_AS_POWERSHELL ################################################################################ # Unix Main Codes # ################################################################################ -hestiaI18N_Translate_Bin_Components_Title() { +hestiaI18N_Translate_Done() { #___locale="$1" @@ -73,11 +69,11 @@ hestiaI18N_Translate_Bin_Components_Title() { case "$1" in zh-hans) # 简体中文 - printf -- "%b" "软件元件" + printf -- "%s" "搞定" ;; *) # fallback to default english - printf -- "%b" "Executables Components" + printf -- "%s" "done" ;; esac diff --git a/automataCI/services/hestiaI18N/Translate-Config-Components-Title.sh.ps1 b/automataCI/services/hestiaI18N/Translate_Error.sh.ps1 old mode 100755 new mode 100644 similarity index 83% rename from automataCI/services/hestiaI18N/Translate-Config-Components-Title.sh.ps1 rename to automataCI/services/hestiaI18N/Translate_Error.sh.ps1 index ce0214c..952d9ad --- a/automataCI/services/hestiaI18N/Translate-Config-Components-Title.sh.ps1 +++ b/automataCI/services/hestiaI18N/Translate_Error.sh.ps1 @@ -32,25 +32,21 @@ echo \" <<'RUN_AS_POWERSHELL' >/dev/null # " | Out-Null ################################################################################ # Windows POWERSHELL Codes # ################################################################################ -function hestiaI18N-Translate-Config-Components-Title() { - param( - [string]$___locale - ) +function hestiaI18N-Translate-Error { + param ( + [string]$___locale + ) - # execute - switch ("${___locale}") { - "zh-hans" { - # 简体中文 - return "设定元件" - } default { - # fallback to default english - return "Configurations Components" - }} - - - # report status - return 0 + # execute + switch (${___locale}) { + "zh-hans" { + # 简体中文 + return "错误" + } default { + # fallback to default english + return "error" + }} } ################################################################################ # Windows POWERSHELL Codes # @@ -65,7 +61,7 @@ RUN_AS_POWERSHELL ################################################################################ # Unix Main Codes # ################################################################################ -hestiaI18N_Translate_Config_Components_Title() { +hestiaI18N_Translate_Error() { #___locale="$1" @@ -73,11 +69,11 @@ hestiaI18N_Translate_Config_Components_Title() { case "$1" in zh-hans) # 简体中文 - printf -- "%b" "设定元件" + printf -- "%s" "错误" ;; *) # fallback to default english - printf -- "%b" "Configurations Components" + printf -- "%s" "error" ;; esac diff --git a/automataCI/services/hestiaI18N/Translate-Main-Components-Title.sh.ps1 b/automataCI/services/hestiaI18N/Translate_Info.sh.ps1 old mode 100755 new mode 100644 similarity index 83% rename from automataCI/services/hestiaI18N/Translate-Main-Components-Title.sh.ps1 rename to automataCI/services/hestiaI18N/Translate_Info.sh.ps1 index 5eabc9d..fefa16f --- a/automataCI/services/hestiaI18N/Translate-Main-Components-Title.sh.ps1 +++ b/automataCI/services/hestiaI18N/Translate_Info.sh.ps1 @@ -32,25 +32,21 @@ echo \" <<'RUN_AS_POWERSHELL' >/dev/null # " | Out-Null ################################################################################ # Windows POWERSHELL Codes # ################################################################################ -function hestiaI18N-Translate-Main-Components-Title() { - param( - [string]$___locale - ) +function hestiaI18N-Translate-Info { + param ( + [string]$___locale + ) - # execute - switch ("${___locale}") { - "zh-hans" { - # 简体中文 - return "主要元件" - } default { - # fallback to default english - return "Main Components" - }} - - - # report status - return 0 + # execute + switch (${___locale}) { + "zh-hans" { + # 简体中文 + return "详情" + } default { + # fallback to default english + return "info" + }} } ################################################################################ # Windows POWERSHELL Codes # @@ -65,7 +61,7 @@ RUN_AS_POWERSHELL ################################################################################ # Unix Main Codes # ################################################################################ -hestiaI18N_Translate_Main_Components_Title() { +hestiaI18N_Translate_Info() { #___locale="$1" @@ -73,11 +69,11 @@ hestiaI18N_Translate_Main_Components_Title() { case "$1" in zh-hans) # 简体中文 - printf -- "%b" "主要元件" + printf -- "%s" "详情" ;; *) # fallback to default english - printf -- "%b" "Main Components" + printf -- "%s" "info" ;; esac diff --git a/automataCI/services/hestiaI18N/Translate-Lib-Components-Description.sh.ps1 b/automataCI/services/hestiaI18N/Translate_Lib_Components_Description.sh.ps1 old mode 100755 new mode 100644 similarity index 80% rename from automataCI/services/hestiaI18N/Translate-Lib-Components-Description.sh.ps1 rename to automataCI/services/hestiaI18N/Translate_Lib_Components_Description.sh.ps1 index 8f480f3..753ece0 --- a/automataCI/services/hestiaI18N/Translate-Lib-Components-Description.sh.ps1 +++ b/automataCI/services/hestiaI18N/Translate_Lib_Components_Description.sh.ps1 @@ -32,25 +32,25 @@ echo \" <<'RUN_AS_POWERSHELL' >/dev/null # " | Out-Null ################################################################################ # Windows POWERSHELL Codes # ################################################################################ -function hestiaI18N-Translate-Lib-Components-Description() { - param( - [string]$___locale - ) +function hestiaI18N-Translate-Lib-Components-Description { + param ( + [string]$___locale + ) - # execute - switch ("${___locale}") { - "zh-hans" { - # 简体中文 - return "所有可开发的码库类产品。" - } default { - # fallback to default english - return "All importable libraries products." - }} + # execute + switch ($___locale) { + "zh-hans" { + # 简体中文 + return "所有可开发的码库类产品。" + } default { + # fallback to default english + return "All importable libraries products." + }} - # report status - return 0 + # report status + return 0 } ################################################################################ # Windows POWERSHELL Codes # @@ -73,11 +73,11 @@ hestiaI18N_Translate_Lib_Components_Description() { case "$1" in zh-hans) # 简体中文 - printf -- "%b" "所有可开发的码库类产品。" + printf -- "%s" "所有可开发的码库类产品。" ;; *) # fallback to default english - printf -- "%b" "All importable libraries products." + printf -- "%s" "All importable libraries products." ;; esac diff --git a/automataCI/services/hestiaI18N/Translate_Lib_Components_Title.sh.ps1 b/automataCI/services/hestiaI18N/Translate_Lib_Components_Title.sh.ps1 new file mode 100644 index 0000000..1f2f9f3 --- /dev/null +++ b/automataCI/services/hestiaI18N/Translate_Lib_Components_Title.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-Lib-Components-Title { + param ( + [string]$___locale + ) + + + # execute + switch ($___locale) { + "zh-hans" { + # 简体中文 + return "代码库类型元件" + } default { + # fallback to default english + return "Libraries Components" + }} + + + # report status + return 0 +} +################################################################################ +# Windows POWERSHELL Codes # +################################################################################ +return +<# +RUN_AS_POWERSHELL + + + + +################################################################################ +# Unix Main Codes # +################################################################################ +hestiaI18N_Translate_Lib_Components_Title() { + #___locale="$1" + + + # execute + case "$1" in + zh-hans) + # 简体中文 + printf -- "%s" "代码库类型元件" + ;; + *) + # fallback to default english + printf -- "%s" "Libraries Components" + ;; + esac + + + # report status + return 0 +} +################################################################################ +# Unix Main Codes # +################################################################################ +return 0 +#> diff --git a/automataCI/services/hestiaI18N/Translate-Main-Components-Description.sh.ps1 b/automataCI/services/hestiaI18N/Translate_Main_Components_Description.sh.ps1 old mode 100755 new mode 100644 similarity index 80% rename from automataCI/services/hestiaI18N/Translate-Main-Components-Description.sh.ps1 rename to automataCI/services/hestiaI18N/Translate_Main_Components_Description.sh.ps1 index 644af0c..8e7c441 --- a/automataCI/services/hestiaI18N/Translate-Main-Components-Description.sh.ps1 +++ b/automataCI/services/hestiaI18N/Translate_Main_Components_Description.sh.ps1 @@ -32,25 +32,25 @@ echo \" <<'RUN_AS_POWERSHELL' >/dev/null # " | Out-Null ################################################################################ # Windows POWERSHELL Codes # ################################################################################ -function hestiaI18N-Translate-Main-Components-Description() { - param( - [string]$___locale - ) +function hestiaI18N-Translate-Main-Components-Description { + param ( + [string]$___locale + ) - # execute - switch ("${___locale}") { - "zh-hans" { - # 简体中文 - return "所有第一重要无法缺乏的产品。" - } default { - # fallback to default english - return "All critical and core products." - }} + # execute + switch ("${___locale}") { + "zh-hans" { + # 简体中文 + return "所有第一重要无法缺乏的产品。" + } default { + # fallback to default english + return "All critical and core products." + }} - # report status - return 0 + # report status + return 0 } ################################################################################ # Windows POWERSHELL Codes # @@ -73,11 +73,11 @@ hestiaI18N_Translate_Main_Components_Description() { case "$1" in zh-hans) # 简体中文 - printf -- "%b" "所有第一重要无法缺乏的产品。" + printf -- "%s" "所有第一重要无法缺乏的产品。" ;; *) # fallback to default english - printf -- "%b" "All critical and core products." + printf -- "%s" "All critical and core products." ;; esac diff --git a/automataCI/services/hestiaI18N/Translate_Main_Components_Title.sh.ps1 b/automataCI/services/hestiaI18N/Translate_Main_Components_Title.sh.ps1 new file mode 100644 index 0000000..7f0e352 --- /dev/null +++ b/automataCI/services/hestiaI18N/Translate_Main_Components_Title.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-Main-Components-Title { + param ( + [string]$___locale + ) + + + # execute + switch (${___locale}) { + "zh-hans" { + # 简体中文 + return "主要元件" + } default { + # fallback to default english + return "Main Components" + }} + + + # report status + return 0 +} +################################################################################ +# Windows POWERSHELL Codes # +################################################################################ +return +<# +RUN_AS_POWERSHELL + + + + +################################################################################ +# Unix Main Codes # +################################################################################ +hestiaI18N_Translate_Main_Components_Title() { + #___locale="$1" + + + # execute + case "$1" in + zh-hans) + # 简体中文 + printf -- "%s" "主要元件" + ;; + *) + # fallback to default english + printf -- "%s" "Main Components" + ;; + esac + + + # report status + return 0 +} +################################################################################ +# Unix Main Codes # +################################################################################ +return 0 +#> diff --git a/automataCI/services/hestiaI18N/Translate_Note.sh.ps1 b/automataCI/services/hestiaI18N/Translate_Note.sh.ps1 new file mode 100644 index 0000000..39a9286 --- /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 -- "%s" "信息" + ;; + *) + # fallback to default english + printf -- "%s" "note" + ;; + esac + + + # report status + return 0 +} +################################################################################ +# Unix Main Codes # +################################################################################ +return 0 +#> diff --git a/automataCI/services/hestiaI18N/Translate-All-Components-Title.sh.ps1 b/automataCI/services/hestiaI18N/Translate_OK.sh.ps1 old mode 100755 new mode 100644 similarity index 84% rename from automataCI/services/hestiaI18N/Translate-All-Components-Title.sh.ps1 rename to automataCI/services/hestiaI18N/Translate_OK.sh.ps1 index 6f5a520..0a47f9a --- a/automataCI/services/hestiaI18N/Translate-All-Components-Title.sh.ps1 +++ b/automataCI/services/hestiaI18N/Translate_OK.sh.ps1 @@ -32,25 +32,21 @@ echo \" <<'RUN_AS_POWERSHELL' >/dev/null # " | Out-Null ################################################################################ # Windows POWERSHELL Codes # ################################################################################ -function hestiaI18N-Translate-All-Components-Title() { - param( - [string]$___locale - ) +function hestiaI18N-Translate-OK { + param ( + [string]$___locale + ) - # execute - switch ("${___locale}") { - "zh-hans" { - # 简体中文 - return "所有元件" - } default { - # fallback to default english - return "All Components" - }} - - - # report status - return 0 + # execute + switch (${___locale}) { + "zh-hans" { + # 简体中文 + return "可行" + } default { + # fallback to default english + return "ok" + }} } ################################################################################ # Windows POWERSHELL Codes # @@ -65,7 +61,7 @@ RUN_AS_POWERSHELL ################################################################################ # Unix Main Codes # ################################################################################ -hestiaI18N_Translate_All_Components_Title() { +hestiaI18N_Translate_OK() { #___locale="$1" @@ -73,11 +69,11 @@ hestiaI18N_Translate_All_Components_Title() { case "$1" in zh-hans) # 简体中文 - printf -- "%b" "所有元件" + printf -- "%s" "可行" ;; *) # fallback to default english - printf -- "%b" "All Components" + printf -- "%s" "ok" ;; esac diff --git a/automataCI/services/hestiaI18N/Translate-Only-Install-On-Windows.sh.ps1 b/automataCI/services/hestiaI18N/Translate_Only_Install_On_Windows.sh.ps1 old mode 100755 new mode 100644 similarity index 73% rename from automataCI/services/hestiaI18N/Translate-Only-Install-On-Windows.sh.ps1 rename to automataCI/services/hestiaI18N/Translate_Only_Install_On_Windows.sh.ps1 index 198b5d0..0ecd47b --- a/automataCI/services/hestiaI18N/Translate-Only-Install-On-Windows.sh.ps1 +++ b/automataCI/services/hestiaI18N/Translate_Only_Install_On_Windows.sh.ps1 @@ -32,84 +32,84 @@ echo \" <<'RUN_AS_POWERSHELL' >/dev/null # " | Out-Null ################################################################################ # Windows POWERSHELL Codes # ################################################################################ -function hestiaI18N-Translate-Only-Install-On-Windows() { - param( - [string]$___locale, - [string]$___arch - ) - - - # execute - switch (${___locale}) { - "zh-hans" { - # 简体中文 - switch ("${___arch}") { - "32" { - return @" +function hestiaI18N-Translate-Only-Install-On-Windows { + param( + [string]$___locale, + [string]$___arch + ) + + + # execute + switch (${___locale}) { + "zh-hans" { + # 简体中文 + switch ("${___arch}") { + "32" { + return @" 真遗憾。您只能在32位微软Windows操作系统里安装。 "@ - } "64" { - return @" + } "64" { + return @" 真遗憾。您只能在64位微软Windows操作系统里安装。 "@ - } "amd64" { - return @" + } "amd64" { + return @" 真遗憾。您只能在amd64型芯片的微软Windows操作系统里安装。 "@ - } "arm64" { - return @" + } "arm64" { + return @" 真遗憾。您只能在arm64型芯片的微软Windows操作系统里安装。 "@ - } "i386" { - return @" + } "i386" { + return @" 真遗憾。您只能在i386型芯片的微软Windows操作系统里安装。 "@ - } "arm" { - return @" + } "arm" { + return @" 真遗憾。您只能在arm型芯片的微软Windows操作系统里安装。 "@ - } default { - return @" + } default { + return @" 真遗憾。您只能在微软Windows操作系统里安装。 "@ - }} - } default { - # fallback to default english - switch ("${___arch}") { - "32" { - return @" + }} + } default { + # fallback to default english + switch ("${___arch}") { + "32" { + return @" Unfortunately, you can only install this in a 32-bits Microsoft Windows operating system. "@ - } "64" { - return @" + } "64" { + return @" Unfortunately, you can only install this in a 64-bits Microsoft Windows operating system. "@ - } "amd64" { - return @" + } "amd64" { + return @" Unfortunately, you can only install this in an amd64 Microsoft Windows operating system. "@ - } "arm64" { - return @" + } "arm64" { + return @" Unfortunately, you can only install this in an arm64 Microsoft Windows operating system. "@ - } "i386" { - return @" + } "i386" { + return @" Unfortunately, you can only install this in an i386 Microsoft Windows operating system. "@ - } "arm" { - return @" + } "arm" { + return @" Unfortunately, you can only install this in an arm Microsoft Windows operating system. "@ - } default { - return @" + } default { + return @" Unfortunately, you can only install this in a Microsoft Windows operating system. "@ - }} - }} + }} + }} - # report status - return 0 + # report status + return 0 } ################################################################################ # Windows POWERSHELL Codes # @@ -135,31 +135,31 @@ hestiaI18N_Translate_Only_Install_On_Windows() { # 简体中文 case "$2" in 32) - printf -- "%b" "\ + printf -- "%s" "\ 真遗憾。您只能在32位微软Windows操作系统里安装。" ;; 64) - printf -- "%b" "\ + printf -- "%s" "\ 真遗憾。您只能在64位微软Windows操作系统里安装。" ;; amd64) - printf -- "%b" "\ + printf -- "%s" "\ 真遗憾。您只能在amd64型芯片的微软Windows操作系统里安装。" ;; arm64) - printf -- "%b" "\ + printf -- "%s" "\ 真遗憾。您只能在arm64型芯片的微软Windows操作系统里安装。" ;; i386) - printf -- "%b" "\ + printf -- "%s" "\ 真遗憾。您只能在i386型芯片的微软Windows操作系统里安装。" ;; arm) - printf -- "%b" "\ + printf -- "%s" "\ 真遗憾。您只能在arm型芯片的微软Windows操作系统里安装。" ;; *) - printf -- "%b" "\ + printf -- "%s" "\ 真遗憾。您只能在微软Windows操作系统里安装。" ;; esac @@ -168,31 +168,31 @@ hestiaI18N_Translate_Only_Install_On_Windows() { # fallback to default english case "$2" in 32) - printf -- "%b" "\ + printf -- "%s" "\ Unfortunately, you can only install this in a 32-bits Microsoft Windows operating system." ;; 64) - printf -- "%b" "\ + printf -- "%s" "\ Unfortunately, you can only install this in a 64-bits Microsoft Windows operating system." ;; amd64) - printf -- "%b" "\ + printf -- "%s" "\ Unfortunately, you can only install this in an amd64 Microsoft Windows operating system." ;; arm64) - printf -- "%b" "\ + printf -- "%s" "\ Unfortunately, you can only install this in an arm64 Microsoft Windows operating system." ;; i386) - printf -- "%b" "\ + printf -- "%s" "\ Unfortunately, you can only install this in an i386 Microsoft Windows operating system." ;; arm) - printf -- "%b" "\ + printf -- "%s" "\ Unfortunately, you can only install this in an arm Microsoft Windows operating system." ;; *) - printf -- "%b" "\ + printf -- "%s" "\ Unfortunately, you can only install this in a Microsoft Windows operating system." ;; esac diff --git a/automataCI/services/hestiaI18N/Translate_Package.sh.ps1 b/automataCI/services/hestiaI18N/Translate_Package.sh.ps1 new file mode 100644 index 0000000..ef0c6c4 --- /dev/null +++ b/automataCI/services/hestiaI18N/Translate_Package.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-Package { + param( + [string]$___locale, + [string]$___name + ) + + + # execute + if ($___name -eq "") { + $___name = "???" + } + + switch ("${___locale}") { + "zh-hans" { + # 简体中文 + return "包装着‘${___name}’。。。" + } default { + # fallback to default english + return "packaging '${___name}'..." + }} +} +################################################################################ +# Windows POWERSHELL Codes # +################################################################################ +return +<# +RUN_AS_POWERSHELL + + + + +################################################################################ +# Unix Main Codes # +################################################################################ +hestiaI18N_Translate_Package() { + #___locale="$1" + #___name="$2" + + + # execute + case "$1" in + zh-hans) + # 简体中文 + printf -- "%s" "包装着‘${2:-???}’。。。" + ;; + *) + # fallback to default english + printf -- "%s" "packaging '${2:-???}'..." + ;; + esac + + + # report status + return 0 +} +################################################################################ +# Unix Main Codes # +################################################################################ +return 0 +#> diff --git a/automataCI/services/hestiaI18N/Translate_Package_Failed.sh.ps1 b/automataCI/services/hestiaI18N/Translate_Package_Failed.sh.ps1 new file mode 100644 index 0000000..8312623 --- /dev/null +++ b/automataCI/services/hestiaI18N/Translate_Package_Failed.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-Package-Failed { + param ( + [string]$___locale + ) + + + # execute + switch (${___locale}) { + "zh-hans" { + # 简体中文 + return "包装失败!" + } default { + # fallback to default english + return "package failed!" + }} +} +################################################################################ +# Windows POWERSHELL Codes # +################################################################################ +return +<# +RUN_AS_POWERSHELL + + + + +################################################################################ +# Unix Main Codes # +################################################################################ +hestiaI18N_Translate_Package_Failed() { + #___locale="$1" + + + # execute + case "$1" in + zh-hans) + # 简体中文 + printf -- "%s" "包装失败!" + ;; + *) + # fallback to default english + printf -- "%s" "package failed!" + ;; + esac + + + # report status + return 0 +} +################################################################################ +# Unix Main Codes # +################################################################################ +return 0 +#> diff --git a/automataCI/services/hestiaI18N/Translate_Package_Simulate.sh.ps1 b/automataCI/services/hestiaI18N/Translate_Package_Simulate.sh.ps1 new file mode 100644 index 0000000..6bf939f --- /dev/null +++ b/automataCI/services/hestiaI18N/Translate_Package_Simulate.sh.ps1 @@ -0,0 +1,91 @@ +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-Package-Simulate { + param( + [string]$___locale + ) + + + # execute + switch (${___locale}) { + "zh-hans" { + # 简体中文 + return "正在仿真着包装行动。。。" + } default { + # fallback to default english + return "simulating packaging activities..." + }} + + + # report status + return 0 +} +################################################################################ +# Windows POWERSHELL Codes # +################################################################################ +return +<# +RUN_AS_POWERSHELL + + + + +################################################################################ +# Unix Main Codes # +################################################################################ +hestiaI18N_Translate_Package_Simulate() { + #___locale="$1" + + + # execute + case "$1" in + zh-hans) + # 简体中文 + printf -- "%s" "正在仿真着包装行动。。。" + ;; + *) + # fallback to default english + printf -- "%s" "simulating packaging activities..." + esac + + + # report status + return 0 +} +################################################################################ +# Unix Main Codes # +################################################################################ +return 0 +#> diff --git a/automataCI/services/hestiaI18N/Translate_Publish.sh.ps1 b/automataCI/services/hestiaI18N/Translate_Publish.sh.ps1 new file mode 100644 index 0000000..c49e520 --- /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 -- "%s" "正在发布‘${___subject}’。。。" + ;; + *) + # fallback to default english + printf -- "%s" "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 100644 index 0000000..72f75f4 --- /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 -- "%s" "发布失败!" + ;; + *) + # fallback to default english + printf -- "%s" "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 100644 index 0000000..d8c2799 --- /dev/null +++ b/automataCI/services/hestiaI18N/Translate_Publish_Simulate.sh.ps1 @@ -0,0 +1,91 @@ +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 + ) + + + # execute + switch (${___locale}) { + "zh-hans" { + # 简体中文 + return "正在仿真着发布。。。" + } default { + # fallback to default english + return "Simulate Publishing..." + }} + + + # report status + return 0 +} +################################################################################ +# Windows POWERSHELL Codes # +################################################################################ +return +<# +RUN_AS_POWERSHELL + + + + +################################################################################ +# Unix Main Codes # +################################################################################ +hestiaI18N_Translate_Publish_Simulate() { + #___locale="$1" + + + # execute + case "$1" in + zh-hans) + # 简体中文 + printf -- "%s" "正在仿真着发布。。。" + ;; + *) + # fallback to default english + printf -- "%s" "Simulate Publishing..." + esac + + + # report status + return 0 +} +################################################################################ +# Unix Main Codes # +################################################################################ +return 0 +#> diff --git a/automataCI/services/hestiaI18N/Translate_Recreate.sh.ps1 b/automataCI/services/hestiaI18N/Translate_Recreate.sh.ps1 new file mode 100644 index 0000000..dfcc450 --- /dev/null +++ b/automataCI/services/hestiaI18N/Translate_Recreate.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-Recreate { + param( + [string]$___locale, + [string]$___name + ) + + + # execute + if ($___name -eq "") { + $___name = "???" + } + + switch ($___locale) { + "zh-hans" { + # 简体中文 + return "从新制作着‘${___name}’。。。" + } default { + # fallback to default english + return "recreating '${___name}'..." + }} +} +################################################################################ +# Windows POWERSHELL Codes # +################################################################################ +return +<# +RUN_AS_POWERSHELL + + + + +################################################################################ +# Unix Main Codes # +################################################################################ +hestiaI18N_Translate_Recreate() { + #___locale="$1" + #___name="$2" + + + # execute + case "$1" in + zh-hans) + # 简体中文 + printf -- "%s" "从新制作着‘${2:-???}’。。。" + ;; + *) + # fallback to default english + printf -- "%s" "recreating '${2:-???}'..." + ;; + esac + + + # report status + return 0 +} +################################################################################ +# Unix Main Codes # +################################################################################ +return 0 +#> diff --git a/automataCI/services/hestiaI18N/Translate-Bin-Components-Description.sh.ps1 b/automataCI/services/hestiaI18N/Translate_Recreate_Failed.sh.ps1 old mode 100755 new mode 100644 similarity index 81% rename from automataCI/services/hestiaI18N/Translate-Bin-Components-Description.sh.ps1 rename to automataCI/services/hestiaI18N/Translate_Recreate_Failed.sh.ps1 index d170f5f..afeef2a --- a/automataCI/services/hestiaI18N/Translate-Bin-Components-Description.sh.ps1 +++ b/automataCI/services/hestiaI18N/Translate_Recreate_Failed.sh.ps1 @@ -32,25 +32,21 @@ echo \" <<'RUN_AS_POWERSHELL' >/dev/null # " | Out-Null ################################################################################ # Windows POWERSHELL Codes # ################################################################################ -function hestiaI18N-Translate-Bin-Components-Description() { - param( - [string]$___locale - ) +function hestiaI18N-Translate-Recreate-Failed { + param( + [string]$___locale + ) - # execute - switch ("${___locale}") { - "zh-hans" { - # 简体中文 - return "所有可启动的软件产品。" - } default { - # fallback to default english - return "All executable software products." - }} - - - # report status - return 0 + # execute + switch (${___locale}) { + "zh-hans" { + # 简体中文 + return "从新制作失败!" + } default { + # fallback to default english + return "recreate failed!" + }} } ################################################################################ # Windows POWERSHELL Codes # @@ -65,7 +61,7 @@ RUN_AS_POWERSHELL ################################################################################ # Unix Main Codes # ################################################################################ -hestiaI18N_Translate_Bin_Components_Description() { +hestiaI18N_Translate_Recreate_Failed() { #___locale="$1" @@ -73,11 +69,11 @@ hestiaI18N_Translate_Bin_Components_Description() { case "$1" in zh-hans) # 简体中文 - printf -- "%b" "所有可启动的软件产品。" + printf -- "%s" "从新制作失败!" ;; *) # fallback to default english - printf -- "%b" "All executable software products." + printf -- "%s" "recreate failed!" ;; esac diff --git a/automataCI/services/hestiaI18N/Translate_Recreate_Simulate.sh.ps1 b/automataCI/services/hestiaI18N/Translate_Recreate_Simulate.sh.ps1 new file mode 100644 index 0000000..8eef2e9 --- /dev/null +++ b/automataCI/services/hestiaI18N/Translate_Recreate_Simulate.sh.ps1 @@ -0,0 +1,91 @@ +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-Recreate-Simulate { + param ( + [string]$___locale + ) + + + # execute + switch (${___locale}) { + "zh-hans" { + # 简体中文 + return "正在仿真着从新制作行动。。。" + } default { + # fallback to default english + return "simulating recreating activities..." + }} + + + # report status + return 0 +} +################################################################################ +# Windows POWERSHELL Codes # +################################################################################ +return +<# +RUN_AS_POWERSHELL + + + + +################################################################################ +# Unix Main Codes # +################################################################################ +hestiaI18N_Translate_Recreate_Simulate() { + #___locale="$1" + + + # execute + case "$1" in + zh-hans) + # 简体中文 + printf -- "%s" "正在仿真着从新制作行动。。。" + ;; + *) + # fallback to default english + printf -- "%s" "simulating recreating activities..." + esac + + + # report status + return 0 +} +################################################################################ +# Unix Main Codes # +################################################################################ +return 0 +#> diff --git a/automataCI/services/hestiaI18N/Translate_Run.sh.ps1 b/automataCI/services/hestiaI18N/Translate_Run.sh.ps1 new file mode 100644 index 0000000..d616fbe --- /dev/null +++ b/automataCI/services/hestiaI18N/Translate_Run.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-Run { + param ( + [string]$___locale, + [string]$___subject + ) + + + # execute + switch (${___locale}) { + "zh-hans" { + # 简体中文 + return "正在执行‘${___subject}’。。。" + } default { + # fallback to default english + return "running '${___subject}'..." + }} + + + # report status + return 0 +} +################################################################################ +# Windows POWERSHELL Codes # +################################################################################ +return +<# +RUN_AS_POWERSHELL + + + + +################################################################################ +# Unix Main Codes # +################################################################################ +hestiaI18N_Translate_Run() { + #___locale="$1" + #___subject="$2" + + + # execute + case "$1" in + zh-hans) + # 简体中文 + printf -- "%s" "正在执行‘${2}’。。。" + ;; + *) + # fallback to default english + printf -- "%s" "running '${2}'..." + ;; + esac + + + # report status + return 0 +} +################################################################################ +# Unix Main Codes # +################################################################################ +return 0 +#> diff --git a/automataCI/services/hestiaI18N/Translate_Run_Failed.sh.ps1 b/automataCI/services/hestiaI18N/Translate_Run_Failed.sh.ps1 new file mode 100644 index 0000000..29a428a --- /dev/null +++ b/automataCI/services/hestiaI18N/Translate_Run_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-Run-Failed { + param ( + [string]$___locale + ) + + + # execute + switch (${___locale}) { + "zh-hans" { + # 简体中文 + return "执行失败!" + } default { + # fallback to default english + return "run failed!" + }} + + + # report status + return 0 +} +################################################################################ +# Windows POWERSHELL Codes # +################################################################################ +return +<# +RUN_AS_POWERSHELL + + + + +################################################################################ +# Unix Main Codes # +################################################################################ +hestiaI18N_Translate_Run_Failed() { + #___locale="$1" + + + # execute + case "$1" in + zh-hans) + # 简体中文 + printf -- "%s" "执行失败!" + ;; + *) + # fallback to default english + printf -- "%s" "run failed!" + ;; + esac + + + # report status + return 0 +} +################################################################################ +# Unix Main Codes # +################################################################################ +return 0 +#> diff --git a/automataCI/services/hestiaI18N/Translate_Run_Simulate.sh.ps1 b/automataCI/services/hestiaI18N/Translate_Run_Simulate.sh.ps1 new file mode 100644 index 0000000..53dd03d --- /dev/null +++ b/automataCI/services/hestiaI18N/Translate_Run_Simulate.sh.ps1 @@ -0,0 +1,91 @@ +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-Run-Simulate { + param ( + [string]$___locale + ) + + + # execute + switch (${___locale}) { + "zh-hans" { + # 简体中文 + return "正在仿真着执行。。。" + } default { + # fallback to default english + return "Simulate Running..." + }} + + + # report status + return 0 +} +################################################################################ +# Windows POWERSHELL Codes # +################################################################################ +return +<# +RUN_AS_POWERSHELL + + + + +################################################################################ +# Unix Main Codes # +################################################################################ +hestiaI18N_Translate_Run_Simulate() { + #___locale="$1" + + + # execute + case "$1" in + zh-hans) + # 简体中文 + printf -- "%s" "正在仿真着执行。。。" + ;; + *) + # fallback to default english + printf -- "%s" "Simulate Running..." + esac + + + # report status + return 0 +} +################################################################################ +# Unix Main Codes # +################################################################################ +return 0 +#> diff --git a/automataCI/services/hestiaI18N/Translate_Run_Skipped.sh.ps1 b/automataCI/services/hestiaI18N/Translate_Run_Skipped.sh.ps1 new file mode 100644 index 0000000..b8f85d9 --- /dev/null +++ b/automataCI/services/hestiaI18N/Translate_Run_Skipped.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-Run-Skipped { + param ( + [string]$___locale + ) + + + # execute + switch (${___locale}) { + "zh-hans" { + # 简体中文 + return "执行免了。" + } default { + # fallback to default english + return "run skipped." + }} + + + # report status + return 0 +} +################################################################################ +# Windows POWERSHELL Codes # +################################################################################ +return +<# +RUN_AS_POWERSHELL + + + + +################################################################################ +# Unix Main Codes # +################################################################################ +hestiaI18N_Translate_Run_Skipped() { + #___locale="$1" + + + # execute + case "$1" in + zh-hans) + # 简体中文 + printf -- "%s" "执行免了。" + ;; + *) + # fallback to default english + printf -- "%s" "run skipped." + ;; + esac + + + # report status + return 0 +} +################################################################################ +# Unix Main Codes # +################################################################################ +return 0 +#> diff --git a/automataCI/services/hestiaI18N/Translate-Lib-Components-Title.sh.ps1 b/automataCI/services/hestiaI18N/Translate_Success.sh.ps1 old mode 100755 new mode 100644 similarity index 83% rename from automataCI/services/hestiaI18N/Translate-Lib-Components-Title.sh.ps1 rename to automataCI/services/hestiaI18N/Translate_Success.sh.ps1 index b438df2..9b27f39 --- a/automataCI/services/hestiaI18N/Translate-Lib-Components-Title.sh.ps1 +++ b/automataCI/services/hestiaI18N/Translate_Success.sh.ps1 @@ -32,25 +32,21 @@ echo \" <<'RUN_AS_POWERSHELL' >/dev/null # " | Out-Null ################################################################################ # Windows POWERSHELL Codes # ################################################################################ -function hestiaI18N-Translate-Lib-Components-Title() { - param( - [string]$___locale - ) +function hestiaI18N-Translate-Success { + param( + [string]$___locale + ) - # execute - switch ("${___locale}") { - "zh-hans" { - # 简体中文 - return "代码库类型元件" - } default { - # fallback to default english - return "Libraries Components" - }} - - - # report status - return 0 + # execute + switch (${___locale}) { + "zh-hans" { + # 简体中文 + return "成功" + } default { + # fallback to default english + return "success" + }} } ################################################################################ # Windows POWERSHELL Codes # @@ -65,7 +61,7 @@ RUN_AS_POWERSHELL ################################################################################ # Unix Main Codes # ################################################################################ -hestiaI18N_Translate_Lib_Components_Title() { +hestiaI18N_Translate_Success() { #___locale="$1" @@ -73,11 +69,11 @@ hestiaI18N_Translate_Lib_Components_Title() { case "$1" in zh-hans) # 简体中文 - printf -- "%b" "代码库类型元件" + printf -- "%s" "成功" ;; *) # fallback to default english - printf -- "%b" "Libraries Components" + printf -- "%s" "success" ;; esac diff --git a/automataCI/services/hestiaI18N/Translate_Warning.sh.ps1 b/automataCI/services/hestiaI18N/Translate_Warning.sh.ps1 new file mode 100644 index 0000000..4276a20 --- /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 -- "%s" "注意" + ;; + *) + # fallback to default english + printf -- "%s" "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 old mode 100755 new mode 100644 index 2dc2478..92a7781 --- a/automataCI/services/hestiaI18N/Vanilla.sh.ps1 +++ b/automataCI/services/hestiaI18N/Vanilla.sh.ps1 @@ -33,20 +33,50 @@ 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_All_Components_Description.sh.ps1" +. "${env:LIBS_HESTIA}\hestiaI18N\Translate_All_Components_Title.sh.ps1" +. "${env:LIBS_HESTIA}\hestiaI18N\Translate_Already_Latest_Version.sh.ps1" +. "${env:LIBS_HESTIA}\hestiaI18N\Translate_Assemble.sh.ps1" +. "${env:LIBS_HESTIA}\hestiaI18N\Translate_Assemble_Failed.sh.ps1" +. "${env:LIBS_HESTIA}\hestiaI18N\Translate_Assemble_Simulate.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_Check.sh.ps1" +. "${env:LIBS_HESTIA}\hestiaI18N\Translate_Check_Availability.sh.ps1" +. "${env:LIBS_HESTIA}\hestiaI18N\Translate_Check_Failed.sh.ps1" +. "${env:LIBS_HESTIA}\hestiaI18N\Translate_Check_Simulate.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_Create.sh.ps1" +. "${env:LIBS_HESTIA}\hestiaI18N\Translate_Create_Failed.sh.ps1" +. "${env:LIBS_HESTIA}\hestiaI18N\Translate_Create_Simulate.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_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_OK.sh.ps1" +. "${env:LIBS_HESTIA}\hestiaI18N\Translate_Only_Install_On_Windows.sh.ps1" +. "${env:LIBS_HESTIA}\hestiaI18N\Translate_Package.sh.ps1" +. "${env:LIBS_HESTIA}\hestiaI18N\Translate_Package_Failed.sh.ps1" +. "${env:LIBS_HESTIA}\hestiaI18N\Translate_Package_Simulate.sh.ps1" +. "${env:LIBS_HESTIA}\hestiaI18N\Translate_Publish.sh.ps1" +. "${env:LIBS_HESTIA}\hestiaI18N\Translate_Publish_Failed.sh.ps1" +. "${env:LIBS_HESTIA}\hestiaI18N\Translate_Publish_Simulate.sh.ps1" +. "${env:LIBS_HESTIA}\hestiaI18N\Translate_Recreate.sh.ps1" +. "${env:LIBS_HESTIA}\hestiaI18N\Translate_Recreate_Failed.sh.ps1" +. "${env:LIBS_HESTIA}\hestiaI18N\Translate_Recreate_Simulate.sh.ps1" +. "${env:LIBS_HESTIA}\hestiaI18N\Translate_Run.sh.ps1" +. "${env:LIBS_HESTIA}\hestiaI18N\Translate_Run_Failed.sh.ps1" +. "${env:LIBS_HESTIA}\hestiaI18N\Translate_Run_Simulate.sh.ps1" +. "${env:LIBS_HESTIA}\hestiaI18N\Translate_Run_Skipped.sh.ps1" +. "${env:LIBS_HESTIA}\hestiaI18N\Translate_Success.sh.ps1" +. "${env:LIBS_HESTIA}\hestiaI18N\Translate_Warning.sh.ps1" ################################################################################ # Windows POWERSHELL Codes # ################################################################################ @@ -61,20 +91,50 @@ 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_All_Components_Description.sh.ps1" +. "${LIBS_HESTIA}/hestiaI18N/Translate_All_Components_Title.sh.ps1" +. "${LIBS_HESTIA}/hestiaI18N/Translate_Already_Latest_Version.sh.ps1" +. "${LIBS_HESTIA}/hestiaI18N/Translate_Assemble.sh.ps1" +. "${LIBS_HESTIA}/hestiaI18N/Translate_Assemble_Failed.sh.ps1" +. "${LIBS_HESTIA}/hestiaI18N/Translate_Assemble_Simulate.sh.ps1" +. "${LIBS_HESTIA}/hestiaI18N/Translate_Bin_Components_Description.sh.ps1" +. "${LIBS_HESTIA}/hestiaI18N/Translate_Bin_Components_Title.sh.ps1" +. "${LIBS_HESTIA}/hestiaI18N/Translate_Check.sh.ps1" +. "${LIBS_HESTIA}/hestiaI18N/Translate_Check_Availability.sh.ps1" +. "${LIBS_HESTIA}/hestiaI18N/Translate_Check_Failed.sh.ps1" +. "${LIBS_HESTIA}/hestiaI18N/Translate_Check_Simulate.sh.ps1" +. "${LIBS_HESTIA}/hestiaI18N/Translate_Config_Components_Description.sh.ps1" +. "${LIBS_HESTIA}/hestiaI18N/Translate_Config_Components_Title.sh.ps1" +. "${LIBS_HESTIA}/hestiaI18N/Translate_Create.sh.ps1" +. "${LIBS_HESTIA}/hestiaI18N/Translate_Create_Failed.sh.ps1" +. "${LIBS_HESTIA}/hestiaI18N/Translate_Create_Simulate.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_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_Package.sh.ps1" +. "${LIBS_HESTIA}/hestiaI18N/Translate_Package_Failed.sh.ps1" +. "${LIBS_HESTIA}/hestiaI18N/Translate_Package_Simulate.sh.ps1" +. "${LIBS_HESTIA}/hestiaI18N/Translate_Publish.sh.ps1" +. "${LIBS_HESTIA}/hestiaI18N/Translate_Publish_Failed.sh.ps1" +. "${LIBS_HESTIA}/hestiaI18N/Translate_Publish_Simulate.sh.ps1" +. "${LIBS_HESTIA}/hestiaI18N/Translate_Recreate.sh.ps1" +. "${LIBS_HESTIA}/hestiaI18N/Translate_Recreate_Failed.sh.ps1" +. "${LIBS_HESTIA}/hestiaI18N/Translate_Recreate_Simulate.sh.ps1" +. "${LIBS_HESTIA}/hestiaI18N/Translate_Run.sh.ps1" +. "${LIBS_HESTIA}/hestiaI18N/Translate_Run_Failed.sh.ps1" +. "${LIBS_HESTIA}/hestiaI18N/Translate_Run_Simulate.sh.ps1" +. "${LIBS_HESTIA}/hestiaI18N/Translate_Run_Skipped.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 100644 index 0000000..9870650 --- /dev/null +++ b/automataCI/services/hestiaKERNEL/Error_Codes.sh.ps1 @@ -0,0 +1,621 @@ +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_BUSY} = 2 +${env:hestiaKERNEL_ERROR_BAD_DESCRIPTOR} = 3 +${env:hestiaKERNEL_ERROR_BAD_EXCHANGE} = 4 +${env:hestiaKERNEL_ERROR_BAD_MOUNT} = 5 +${env:hestiaKERNEL_ERROR_BAD_PIPE} = 6 +${env:hestiaKERNEL_ERROR_BAD_REQUEST} = 7 +${env:hestiaKERNEL_ERROR_BAD_STREAM_PIPE} = 8 +${env:hestiaKERNEL_ERROR_PROCESS_IS_DEAD} = 9 +${env:hestiaKERNEL_ERROR_CANCELLED} = 10 +${env:hestiaKERNEL_ERROR_CLEANING_REQUIRED} = 11 +${env:hestiaKERNEL_ERROR_DEADLOCK} = 12 +${env:hestiaKERNEL_ERROR_EXPIRED} = 13 +${env:hestiaKERNEL_ERROR_ILLEGAL_BYTE_SEQUENCE} = 14 +${env:hestiaKERNEL_ERROR_ILLEGAL_SEEK} = 15 +${env:hestiaKERNEL_ERROR_INVALID_ARGUMENT} = 16 +${env:hestiaKERNEL_ERROR_IS_EMPTY} = 17 +${env:hestiaKERNEL_ERROR_MAXED_EXCHANGE} = 18 +${env:hestiaKERNEL_ERROR_MAXED_QUOTA} = 19 +${env:hestiaKERNEL_ERROR_MISSING_LOCK} = 20 +${env:hestiaKERNEL_ERROR_IS_NOT_EMPTY} = 21 +${env:hestiaKERNEL_ERROR_NOT_PERMITTED} = 22 +${env:hestiaKERNEL_ERROR_NOT_POSSIBLE} = 23 +${env:hestiaKERNEL_ERROR_NOT_POSSIBLE_BY_RFKILL} = 24 +${env:hestiaKERNEL_ERROR_NOT_RECOVERABLE} = 25 +${env:hestiaKERNEL_ERROR_OUT_OF_RANGE} = 26 +${env:hestiaKERNEL_ERROR_PERMISSION_DENIED} = 27 +${env:hestiaKERNEL_ERROR_TIMEOUT} = 28 +${env:hestiaKERNEL_ERROR_TOO_MANY_READ} = 29 +${env:hestiaKERNEL_ERROR_TOO_MANY_LOOP} = 30 +${env:hestiaKERNEL_ERROR_TOO_MANY_REFERENCES} = 31 +${env:hestiaKERNEL_ERROR_TOO_MANY_LINK} = 32 +${env:hestiaKERNEL_ERROR_TOO_MANY_OPENED} = 33 +${env:hestiaKERNEL_ERROR_TRY_AGAIN} = 34 +${env:hestiaKERNEL_ERROR_UNSUPPORTED} = 35 +${env:hestiaKERNEL_ERROR_WOULD_BLOCK} = 36 + + + + +# lifecycle states +${env:hestiaKERNEL_ERROR_RESTART} = 37 +${env:hestiaKERNEL_ERROR_RESUME} = 38 +${env:hestiaKERNEL_ERROR_SHUTDOWN} = 39 +${env:hestiaKERNEL_ERROR_SLEEP} = 40 +${env:hestiaKERNEL_ERROR_STALLED} = 41 +${env:hestiaKERNEL_ERROR_STANDBY} = 42 +${env:hestiaKERNEL_ERROR_UNRESPONSIVE} = 43 +${env:hestiaKERNEL_ERROR_TERMINATE} = 44 +${env:hestiaKERNEL_ERROR_PROGRESS_SCHEDULED} = 45 +${env:hestiaKERNEL_ERROR_PROGRESS_ALREADY_EXECUTING} = 46 +${env:hestiaKERNEL_ERROR_PROGRESS_EXECUTING} = 47 +${env:hestiaKERNEL_ERROR_PROGRESS_COMPLETED} = 48 +${env:hestiaKERNEL_ERROR_PROGRESS_UNRESPONSIVE} = 49 +${env:hestiaKERNEL_ERROR_PROGRESS_TERMINATE} = 50 + + + + +# tri-tier inter-package communications +${env:hestiaKERNEL_ERROR_LV1_NOT_SYNC} = 51 +${env:hestiaKERNEL_ERROR_LV1_PAUSED} = 52 +${env:hestiaKERNEL_ERROR_LV1_RESET} = 53 +${env:hestiaKERNEL_ERROR_LV2_NOT_SYNC} = 54 +${env:hestiaKERNEL_ERROR_LV2_PAUSED} = 55 +${env:hestiaKERNEL_ERROR_LV2_RESET} = 56 +${env:hestiaKERNEL_ERROR_LV3_NOT_SYNC} = 57 +${env:hestiaKERNEL_ERROR_LV3_PAUSED} = 58 +${env:hestiaKERNEL_ERROR_LV3_RESET} = 59 + + + + +# data (input/output parameters type etc) +${env:hestiaKERNEL_ERROR_DATA_BAD} = 60 +${env:hestiaKERNEL_ERROR_DATA_EMPTY} = 61 +${env:hestiaKERNEL_ERROR_DATA_INVALID} = 62 +${env:hestiaKERNEL_ERROR_DATA_IS_UNIQUE} = 63 +${env:hestiaKERNEL_ERROR_DATA_IS_NOT_UNIQUE} = 64 +${env:hestiaKERNEL_ERROR_DATA_BUSY} = 65 +${env:hestiaKERNEL_ERROR_DATA_DEAD} = 66 +${env:hestiaKERNEL_ERROR_DATA_EXISTS} = 67 +${env:hestiaKERNEL_ERROR_DATA_FAULTY} = 68 +${env:hestiaKERNEL_ERROR_DATA_MISSING} = 69 +${env:hestiaKERNEL_ERROR_DATA_OVERFLOW} = 70 +${env:hestiaKERNEL_ERROR_DATA_POISONED} = 71 +${env:hestiaKERNEL_ERROR_DATA_REMOVED} = 72 +${env:hestiaKERNEL_ERROR_DATA_TOO_BIG} = 73 +${env:hestiaKERNEL_ERROR_DATA_TOO_MANY_OPENED} = 74 +${env:hestiaKERNEL_ERROR_DATA_TOO_LONG} = 75 +${env:hestiaKERNEL_ERROR_DATA_MISMATCHED} = 76 +${env:hestiaKERNEL_ERROR_DATA_IS_NOT_DIRECTORY} = 77 +${env:hestiaKERNEL_ERROR_DATA_IS_NOT_FILE} = 78 +${env:hestiaKERNEL_ERROR_DATA_IS_NOT_LINK} = 79 +${env:hestiaKERNEL_ERROR_DATA_IS_NOT_SOCKET} = 80 +${env:hestiaKERNEL_ERROR_DATA_REMOTE_CHANGED} = 81 +${env:hestiaKERNEL_ERROR_DATA_REMOTE_ERROR} = 82 +${env:hestiaKERNEL_ERROR_DATA_REMOTE_IO} = 83 +${env:hestiaKERNEL_ERROR_DATA_MISSING_STREAMABLE_RESOURCES} = 84 +${env:hestiaKERNEL_ERROR_DATA_NOT_STREAMABLE} = 85 + + + + +# entity (device file directory object etc) +${env:hestiaKERNEL_ERROR_ENTITY_BAD} = 86 +${env:hestiaKERNEL_ERROR_ENTITY_EMPTY} = 87 +${env:hestiaKERNEL_ERROR_ENTITY_INVALID} = 88 +${env:hestiaKERNEL_ERROR_ENTITY_IS_UNIQUE} = 89 +${env:hestiaKERNEL_ERROR_ENTITY_IS_NOT_UNIQUE} = 90 +${env:hestiaKERNEL_ERROR_ENTITY_BUSY} = 91 +${env:hestiaKERNEL_ERROR_ENTITY_DEAD} = 92 +${env:hestiaKERNEL_ERROR_ENTITY_EXISTS} = 93 +${env:hestiaKERNEL_ERROR_ENTITY_FAULTY} = 94 +${env:hestiaKERNEL_ERROR_ENTITY_MISSING} = 95 +${env:hestiaKERNEL_ERROR_ENTITY_MISSING_CHILD} = 96 +${env:hestiaKERNEL_ERROR_ENTITY_OUT_OF_BUFFER} = 97 +${env:hestiaKERNEL_ERROR_ENTITY_POISONED} = 98 +${env:hestiaKERNEL_ERROR_ENTITY_REMOVED} = 99 +${env:hestiaKERNEL_ERROR_ENTITY_TOO_BIG} = 100 +${env:hestiaKERNEL_ERROR_ENTITY_TOO_MANY_OPENED} = 101 +${env:hestiaKERNEL_ERROR_ENTITY_UNATTACHED} = 102 +${env:hestiaKERNEL_ERROR_ENTITY_MISMATCHED} = 103 +${env:hestiaKERNEL_ERROR_ENTITY_IS_NOT_DIRECTORY} = 104 +${env:hestiaKERNEL_ERROR_ENTITY_IS_NOT_FILE} = 105 +${env:hestiaKERNEL_ERROR_ENTITY_IS_NOT_LINK} = 106 +${env:hestiaKERNEL_ERROR_ENTITY_IS_NOT_SOCKET} = 107 +${env:hestiaKERNEL_ERROR_ENTITY_REMOTE_CHANGED} = 108 +${env:hestiaKERNEL_ERROR_ENTITY_REMOTE_ERROR} = 109 +${env:hestiaKERNEL_ERROR_ENTITY_REMOTE_IO} = 110 +${env:hestiaKERNEL_ERROR_ENTITY_MISSING_STREAMABLE_RESOURCES} = 111 +${env:hestiaKERNEL_ERROR_ENTITY_NOT_STREAMABLE} = 112 +${env:hestiaKERNEL_ERROR_ENTITY_STREAMABLE} = 113 +${env:hestiaKERNEL_ERROR_ENTITY_A_TYPEWRITER} = 114 +${env:hestiaKERNEL_ERROR_ENTITY_NOT_A_TYPEWRITER} = 115 +${env:hestiaKERNEL_ERROR_ENTITY_BAD_DESCRIPTOR} = 116 +${env:hestiaKERNEL_ERROR_ENTITY_FILETABLE_OVERFLOW} = 117 + + + + +# key (cryptography) +${env:hestiaKERNEL_ERROR_KEY_BAD} = 118 +${env:hestiaKERNEL_ERROR_KEY_DESTROYED} = 119 +${env:hestiaKERNEL_ERROR_KEY_EXPIRED} = 120 +${env:hestiaKERNEL_ERROR_KEY_MISSING} = 121 +${env:hestiaKERNEL_ERROR_KEY_REJECTED} = 122 +${env:hestiaKERNEL_ERROR_KEY_REVOKED} = 123 + + + + +# library +${env:hestiaKERNEL_ERROR_LIBRARY_BAD} = 124 +${env:hestiaKERNEL_ERROR_LIBRARY_CORRUPTED} = 125 +${env:hestiaKERNEL_ERROR_LIBRARY_EXEC_FAILED} = 126 +${env:hestiaKERNEL_ERROR_LIBRARY_MAXED} = 127 +${env:hestiaKERNEL_ERROR_LIBRARY_MISSING} = 128 + + + + +# network +${env:hestiaKERNEL_ERROR_NETWORK_BAD} = 129 +${env:hestiaKERNEL_ERROR_NETWORK_BAD_AD} = 130 +${env:hestiaKERNEL_ERROR_NETWORK_DOWN} = 131 +${env:hestiaKERNEL_ERROR_NETWORK_NOT_CONNECTED} = 132 +${env:hestiaKERNEL_ERROR_NETWORK_RESET} = 133 +${env:hestiaKERNEL_ERROR_NETWORK_RFS} = 134 +${env:hestiaKERNEL_ERROR_NETWORK_UNREACHABLE} = 135 + +${env:hestiaKERNEL_ERROR_NETWORK_HOST_DOWN} = 136 +${env:hestiaKERNEL_ERROR_NETWORK_HOST_UNREACHABLE} = 137 +${env:hestiaKERNEL_ERROR_NETWORK_SOCKET_UNSUPPORTED} = 138 + +${env:hestiaKERNEL_ERROR_NETWORK_ADDRESS_IN_USE} = 139 +${env:hestiaKERNEL_ERROR_NETWORK_ADDRESS_UNAVAILABLE} = 140 + +${env:hestiaKERNEL_ERROR_NETWORK_CONN_ABORTED} = 141 +${env:hestiaKERNEL_ERROR_NETWORK_CONN_IS_CONNECTED} = 142 +${env:hestiaKERNEL_ERROR_NETWORK_CONN_MISSING_DEST_ADDRESS} = 143 +${env:hestiaKERNEL_ERROR_NETWORK_CONN_MULTIHOP} = 144 +${env:hestiaKERNEL_ERROR_NETWORK_CONN_NOT_CONNECTED} = 145 +${env:hestiaKERNEL_ERROR_NETWORK_CONN_REFUSED} = 146 +${env:hestiaKERNEL_ERROR_NETWORK_CONN_RESET} = 147 + +${env:hestiaKERNEL_ERROR_NETWORK_PAYLOAD_BAD} = 148 +${env:hestiaKERNEL_ERROR_NETWORK_PAYLOAD_EMPTY} = 149 +${env:hestiaKERNEL_ERROR_NETWORK_PAYLOAD_MISSING} = 150 +${env:hestiaKERNEL_ERROR_NETWORK_PAYLOAD_TOO_LONG} = 151 + + + + +# protocol +${env:hestiaKERNEL_ERROR_PROTOCOL_ADDRESS_UNSUPPORTED} = 152 +${env:hestiaKERNEL_ERROR_PROTOCOL_BAD} = 153 +${env:hestiaKERNEL_ERROR_PROTOCOL_FAMILY_UNSUPPORTED} = 154 +${env:hestiaKERNEL_ERROR_PROTOCOL_MISSING} = 155 +${env:hestiaKERNEL_ERROR_PROTOCOL_INVALID} = 156 +${env:hestiaKERNEL_ERROR_PROTOCOL_FAULTY} = 157 +${env:hestiaKERNEL_ERROR_PROTOCOL_EMPTY} = 158 +${env:hestiaKERNEL_ERROR_PROTOCOL_UNSUPPORTED} = 159 + + + + +# system (e.g. os interactable system) +${env:hestiaKERNEL_ERROR_SYSTEM_BAD_IO} = 160 +${env:hestiaKERNEL_ERROR_SYSTEM_DEVICE_CROSS_LINK} = 161 +${env:hestiaKERNEL_ERROR_SYSTEM_INTERRUPT_CALL} = 162 +${env:hestiaKERNEL_ERROR_SYSTEM_INVALID} = 163 +${env:hestiaKERNEL_ERROR_SYSTEM_MISSING_BLOCK_DEVICE} = 164 +${env:hestiaKERNEL_ERROR_SYSTEM_MISSING_DEVICE} = 165 +${env:hestiaKERNEL_ERROR_SYSTEM_MISSING_IO} = 166 +${env:hestiaKERNEL_ERROR_SYSTEM_MISSING_PROCESS} = 167 +${env:hestiaKERNEL_ERROR_SYSTEM_OUT_OF_DOMAIN} = 168 +${env:hestiaKERNEL_ERROR_SYSTEM_OUT_OF_MEMORY} = 169 +${env:hestiaKERNEL_ERROR_SYSTEM_OUT_OF_SPACE} = 170 +${env:hestiaKERNEL_ERROR_SYSTEM_READ_ONLY_FILESYSTEM} = 171 + + + + +# user +${env:hestiaKERNEL_ERROR_USER_ACCESS_BANNED} = 172 +${env:hestiaKERNEL_ERROR_USER_ACCESS_LOCKED} = 173 +${env:hestiaKERNEL_ERROR_USER_ACCESS_NOT_VERIFIED} = 174 +${env:hestiaKERNEL_ERROR_USER_ACCESS_BAD} = 175 +${env:hestiaKERNEL_ERROR_USER_ACCESS_REJECTED} = 176 +${env:hestiaKERNEL_ERROR_USER_ACCESS_REVOKED} = 177 +${env:hestiaKERNEL_ERROR_USER_ACCESS_EXISTS} = 178 +${env:hestiaKERNEL_ERROR_USER_ACCESS_EMPTY} = 179 +${env:hestiaKERNEL_ERROR_USER_ACCESS_MISSING} = 180 +${env:hestiaKERNEL_ERROR_USER_ACCESS_INVALID} = 181 +${env:hestiaKERNEL_ERROR_USER_ACCESS_EXPIRED} = 182 +${env:hestiaKERNEL_ERROR_USER_ACCESS_MISMATCHED} = 183 + +${env:hestiaKERNEL_ERROR_USER_MFA_BANNED} = 184 +${env:hestiaKERNEL_ERROR_USER_MFA_LOCKED} = 185 +${env:hestiaKERNEL_ERROR_USER_MFA_NOT_VERIFIED} = 186 +${env:hestiaKERNEL_ERROR_USER_MFA_BAD} = 188 +${env:hestiaKERNEL_ERROR_USER_MFA_REJECTED} = 189 +${env:hestiaKERNEL_ERROR_USER_MFA_REVOKED} = 190 +${env:hestiaKERNEL_ERROR_USER_MFA_EXISTS} = 191 +${env:hestiaKERNEL_ERROR_USER_MFA_EMPTY} = 192 +${env:hestiaKERNEL_ERROR_USER_MFA_MISSING} = 193 +${env:hestiaKERNEL_ERROR_USER_MFA_INVALID} = 194 +${env:hestiaKERNEL_ERROR_USER_MFA_EXPIRED} = 195 +${env:hestiaKERNEL_ERROR_USER_MFA_MISMATCHED} = 196 + +${env:hestiaKERNEL_ERROR_USER_ID_EXISTS} = 197 +${env:hestiaKERNEL_ERROR_USER_ID_BANNED} = 198 +${env:hestiaKERNEL_ERROR_USER_ID_BAD} = 199 +${env:hestiaKERNEL_ERROR_USER_ID_LOCKED} = 200 +${env:hestiaKERNEL_ERROR_USER_ID_NOT_VERIFIED} = 201 +${env:hestiaKERNEL_ERROR_USER_ID_EMPTY} = 202 +${env:hestiaKERNEL_ERROR_USER_ID_MISSING} = 203 +${env:hestiaKERNEL_ERROR_USER_ID_INVALID} = 204 +${env:hestiaKERNEL_ERROR_USER_ID_EXPIRED} = 205 +${env:hestiaKERNEL_ERROR_USER_ID_MISMATCHED} = 206 +${env:hestiaKERNEL_ERROR_USER_ID_DELETED} = 207 +${env:hestiaKERNEL_ERROR_USER_PASSWORD_EXISTS} = 208 +${env:hestiaKERNEL_ERROR_USER_PASSWORD_BANNED} = 209 +${env:hestiaKERNEL_ERROR_USER_PASSWORD_BAD} = 210 +${env:hestiaKERNEL_ERROR_USER_PASSWORD_REJECTED} = 211 +${env:hestiaKERNEL_ERROR_USER_PASSWORD_REVOKED} = 212 +${env:hestiaKERNEL_ERROR_USER_PASSWORD_EMPTY} = 213 +${env:hestiaKERNEL_ERROR_USER_PASSWORD_MISSING} = 214 +${env:hestiaKERNEL_ERROR_USER_PASSWORD_INVALID} = 215 +${env:hestiaKERNEL_ERROR_USER_PASSWORD_EXPIRED} = 216 +${env:hestiaKERNEL_ERROR_USER_PASSWORD_MISMATCHED} = 217 +${env:hestiaKERNEL_ERROR_USER_KEY_EXISTS} = 218 +${env:hestiaKERNEL_ERROR_USER_KEY_BANNED} = 219 +${env:hestiaKERNEL_ERROR_USER_KEY_BAD} = 220 +${env:hestiaKERNEL_ERROR_USER_KEY_REJECTED} = 221 +${env:hestiaKERNEL_ERROR_USER_KEY_REVOKED} = 222 +${env:hestiaKERNEL_ERROR_USER_KEY_EMPTY} = 223 +${env:hestiaKERNEL_ERROR_USER_KEY_MISSING} = 224 +${env:hestiaKERNEL_ERROR_USER_KEY_INVALID} = 225 +${env:hestiaKERNEL_ERROR_USER_KEY_EXPIRED} = 226 +${env:hestiaKERNEL_ERROR_USER_KEY_MISMATCHED} = 227 +################################################################################ +# Windows POWERSHELL Codes # +################################################################################ +return +<# +RUN_AS_POWERSHELL + + + + +################################################################################ +# Unix Main Codes # +################################################################################ +# standard errors +hestiaKERNEL_ERROR_OK=0 +hestiaKERNEL_ERROR_BAD_EXEC=1 +hestiaKERNEL_ERROR_BAD_BUSY=2 +hestiaKERNEL_ERROR_BAD_DESCRIPTOR=3 +hestiaKERNEL_ERROR_BAD_EXCHANGE=4 +hestiaKERNEL_ERROR_BAD_MOUNT=5 +hestiaKERNEL_ERROR_BAD_PIPE=6 +hestiaKERNEL_ERROR_BAD_REQUEST=7 +hestiaKERNEL_ERROR_BAD_STREAM_PIPE=8 +hestiaKERNEL_ERROR_PROCESS_IS_DEAD=9 +hestiaKERNEL_ERROR_CANCELLED=10 +hestiaKERNEL_ERROR_CLEANING_REQUIRED=11 +hestiaKERNEL_ERROR_DEADLOCK=12 +hestiaKERNEL_ERROR_EXPIRED=13 +hestiaKERNEL_ERROR_ILLEGAL_BYTE_SEQUENCE=14 +hestiaKERNEL_ERROR_ILLEGAL_SEEK=15 +hestiaKERNEL_ERROR_INVALID_ARGUMENT=16 +hestiaKERNEL_ERROR_IS_EMPTY=17 +hestiaKERNEL_ERROR_MAXED_EXCHANGE=18 +hestiaKERNEL_ERROR_MAXED_QUOTA=19 +hestiaKERNEL_ERROR_MISSING_LOCK=20 +hestiaKERNEL_ERROR_IS_NOT_EMPTY=21 +hestiaKERNEL_ERROR_NOT_PERMITTED=22 +hestiaKERNEL_ERROR_NOT_POSSIBLE=23 +hestiaKERNEL_ERROR_NOT_POSSIBLE_BY_RFKILL=24 +hestiaKERNEL_ERROR_NOT_RECOVERABLE=25 +hestiaKERNEL_ERROR_OUT_OF_RANGE=26 +hestiaKERNEL_ERROR_PERMISSION_DENIED=27 +hestiaKERNEL_ERROR_TIMEOUT=28 +hestiaKERNEL_ERROR_TOO_MANY_READ=29 +hestiaKERNEL_ERROR_TOO_MANY_LOOP=30 +hestiaKERNEL_ERROR_TOO_MANY_REFERENCES=31 +hestiaKERNEL_ERROR_TOO_MANY_LINK=32 +hestiaKERNEL_ERROR_TOO_MANY_OPENED=33 +hestiaKERNEL_ERROR_TRY_AGAIN=34 +hestiaKERNEL_ERROR_UNSUPPORTED=35 +hestiaKERNEL_ERROR_WOULD_BLOCK=36 + + + + +# lifecycle states +hestiaKERNEL_ERROR_RESTART=37 +hestiaKERNEL_ERROR_RESUME=38 +hestiaKERNEL_ERROR_SHUTDOWN=39 +hestiaKERNEL_ERROR_SLEEP=40 +hestiaKERNEL_ERROR_STALLED=41 +hestiaKERNEL_ERROR_STANDBY=42 +hestiaKERNEL_ERROR_UNRESPONSIVE=43 +hestiaKERNEL_ERROR_TERMINATE=44 +hestiaKERNEL_ERROR_PROGRESS_SCHEDULED=45 +hestiaKERNEL_ERROR_PROGRESS_ALREADY_EXECUTING=46 +hestiaKERNEL_ERROR_PROGRESS_EXECUTING=47 +hestiaKERNEL_ERROR_PROGRESS_COMPLETED=48 +hestiaKERNEL_ERROR_PROGRESS_UNRESPONSIVE=49 +hestiaKERNEL_ERROR_PROGRESS_TERMINATE=50 + + + + +# tri-tier inter-package communications +hestiaKERNEL_ERROR_LV1_NOT_SYNC=51 +hestiaKERNEL_ERROR_LV1_PAUSED=52 +hestiaKERNEL_ERROR_LV1_RESET=53 +hestiaKERNEL_ERROR_LV2_NOT_SYNC=54 +hestiaKERNEL_ERROR_LV2_PAUSED=55 +hestiaKERNEL_ERROR_LV2_RESET=56 +hestiaKERNEL_ERROR_LV3_NOT_SYNC=57 +hestiaKERNEL_ERROR_LV3_PAUSED=58 +hestiaKERNEL_ERROR_LV3_RESET=59 + + + + +# data (input/output parameters type etc) +hestiaKERNEL_ERROR_DATA_BAD=60 +hestiaKERNEL_ERROR_DATA_EMPTY=61 +hestiaKERNEL_ERROR_DATA_INVALID=62 +hestiaKERNEL_ERROR_DATA_IS_UNIQUE=63 +hestiaKERNEL_ERROR_DATA_IS_NOT_UNIQUE=64 +hestiaKERNEL_ERROR_DATA_BUSY=65 +hestiaKERNEL_ERROR_DATA_DEAD=66 +hestiaKERNEL_ERROR_DATA_EXISTS=67 +hestiaKERNEL_ERROR_DATA_FAULTY=68 +hestiaKERNEL_ERROR_DATA_MISSING=69 +hestiaKERNEL_ERROR_DATA_OVERFLOW=70 +hestiaKERNEL_ERROR_DATA_POISONED=71 +hestiaKERNEL_ERROR_DATA_REMOVED=72 +hestiaKERNEL_ERROR_DATA_TOO_BIG=73 +hestiaKERNEL_ERROR_DATA_TOO_MANY_OPENED=74 +hestiaKERNEL_ERROR_DATA_TOO_LONG=75 +hestiaKERNEL_ERROR_DATA_MISMATCHED=76 +hestiaKERNEL_ERROR_DATA_IS_NOT_DIRECTORY=77 +hestiaKERNEL_ERROR_DATA_IS_NOT_FILE=78 +hestiaKERNEL_ERROR_DATA_IS_NOT_LINK=79 +hestiaKERNEL_ERROR_DATA_IS_NOT_SOCKET=80 +hestiaKERNEL_ERROR_DATA_REMOTE_CHANGED=81 +hestiaKERNEL_ERROR_DATA_REMOTE_ERROR=82 +hestiaKERNEL_ERROR_DATA_REMOTE_IO=83 +hestiaKERNEL_ERROR_DATA_MISSING_STREAMABLE_RESOURCES=84 +hestiaKERNEL_ERROR_DATA_NOT_STREAMABLE=85 + + + + +# entity (device file directory object etc) +hestiaKERNEL_ERROR_ENTITY_BAD=86 +hestiaKERNEL_ERROR_ENTITY_EMPTY=87 +hestiaKERNEL_ERROR_ENTITY_INVALID=88 +hestiaKERNEL_ERROR_ENTITY_IS_UNIQUE=89 +hestiaKERNEL_ERROR_ENTITY_IS_NOT_UNIQUE=90 +hestiaKERNEL_ERROR_ENTITY_BUSY=91 +hestiaKERNEL_ERROR_ENTITY_DEAD=92 +hestiaKERNEL_ERROR_ENTITY_EXISTS=93 +hestiaKERNEL_ERROR_ENTITY_FAULTY=94 +hestiaKERNEL_ERROR_ENTITY_MISSING=95 +hestiaKERNEL_ERROR_ENTITY_MISSING_CHILD=96 +hestiaKERNEL_ERROR_ENTITY_OUT_OF_BUFFER=97 +hestiaKERNEL_ERROR_ENTITY_POISONED=98 +hestiaKERNEL_ERROR_ENTITY_REMOVED=99 +hestiaKERNEL_ERROR_ENTITY_TOO_BIG=100 +hestiaKERNEL_ERROR_ENTITY_TOO_MANY_OPENED=101 +hestiaKERNEL_ERROR_ENTITY_UNATTACHED=102 +hestiaKERNEL_ERROR_ENTITY_MISMATCHED=103 +hestiaKERNEL_ERROR_ENTITY_IS_NOT_DIRECTORY=104 +hestiaKERNEL_ERROR_ENTITY_IS_NOT_FILE=105 +hestiaKERNEL_ERROR_ENTITY_IS_NOT_LINK=106 +hestiaKERNEL_ERROR_ENTITY_IS_NOT_SOCKET=107 +hestiaKERNEL_ERROR_ENTITY_REMOTE_CHANGED=108 +hestiaKERNEL_ERROR_ENTITY_REMOTE_ERROR=109 +hestiaKERNEL_ERROR_ENTITY_REMOTE_IO=110 +hestiaKERNEL_ERROR_ENTITY_MISSING_STREAMABLE_RESOURCES=111 +hestiaKERNEL_ERROR_ENTITY_NOT_STREAMABLE=112 +hestiaKERNEL_ERROR_ENTITY_STREAMABLE=113 +hestiaKERNEL_ERROR_ENTITY_A_TYPEWRITER=114 +hestiaKERNEL_ERROR_ENTITY_NOT_A_TYPEWRITER=115 +hestiaKERNEL_ERROR_ENTITY_BAD_DESCRIPTOR=116 +hestiaKERNEL_ERROR_ENTITY_FILETABLE_OVERFLOW=117 + + + + +# key (cryptography) +hestiaKERNEL_ERROR_KEY_BAD=118 +hestiaKERNEL_ERROR_KEY_DESTROYED=119 +hestiaKERNEL_ERROR_KEY_EXPIRED=120 +hestiaKERNEL_ERROR_KEY_MISSING=121 +hestiaKERNEL_ERROR_KEY_REJECTED=122 +hestiaKERNEL_ERROR_KEY_REVOKED=123 + + + + +# library +hestiaKERNEL_ERROR_LIBRARY_BAD=124 +hestiaKERNEL_ERROR_LIBRARY_CORRUPTED=125 +hestiaKERNEL_ERROR_LIBRARY_EXEC_FAILED=126 +hestiaKERNEL_ERROR_LIBRARY_MAXED=127 +hestiaKERNEL_ERROR_LIBRARY_MISSING=128 + + + + +# network +hestiaKERNEL_ERROR_NETWORK_BAD=129 +hestiaKERNEL_ERROR_NETWORK_BAD_AD=130 +hestiaKERNEL_ERROR_NETWORK_DOWN=131 +hestiaKERNEL_ERROR_NETWORK_NOT_CONNECTED=132 +hestiaKERNEL_ERROR_NETWORK_RESET=133 +hestiaKERNEL_ERROR_NETWORK_RFS=134 +hestiaKERNEL_ERROR_NETWORK_UNREACHABLE=135 + +hestiaKERNEL_ERROR_NETWORK_HOST_DOWN=136 +hestiaKERNEL_ERROR_NETWORK_HOST_UNREACHABLE=137 +hestiaKERNEL_ERROR_NETWORK_SOCKET_UNSUPPORTED=138 + +hestiaKERNEL_ERROR_NETWORK_ADDRESS_IN_USE=139 +hestiaKERNEL_ERROR_NETWORK_ADDRESS_UNAVAILABLE=140 + +hestiaKERNEL_ERROR_NETWORK_CONN_ABORTED=141 +hestiaKERNEL_ERROR_NETWORK_CONN_IS_CONNECTED=142 +hestiaKERNEL_ERROR_NETWORK_CONN_MISSING_DEST_ADDRESS=143 +hestiaKERNEL_ERROR_NETWORK_CONN_MULTIHOP=144 +hestiaKERNEL_ERROR_NETWORK_CONN_NOT_CONNECTED=145 +hestiaKERNEL_ERROR_NETWORK_CONN_REFUSED=146 +hestiaKERNEL_ERROR_NETWORK_CONN_RESET=147 + +hestiaKERNEL_ERROR_NETWORK_PAYLOAD_BAD=148 +hestiaKERNEL_ERROR_NETWORK_PAYLOAD_EMPTY=149 +hestiaKERNEL_ERROR_NETWORK_PAYLOAD_MISSING=150 +hestiaKERNEL_ERROR_NETWORK_PAYLOAD_TOO_LONG=151 + + + + +# protocol +hestiaKERNEL_ERROR_PROTOCOL_ADDRESS_UNSUPPORTED=152 +hestiaKERNEL_ERROR_PROTOCOL_BAD=153 +hestiaKERNEL_ERROR_PROTOCOL_FAMILY_UNSUPPORTED=154 +hestiaKERNEL_ERROR_PROTOCOL_MISSING=155 +hestiaKERNEL_ERROR_PROTOCOL_INVALID=156 +hestiaKERNEL_ERROR_PROTOCOL_FAULTY=157 +hestiaKERNEL_ERROR_PROTOCOL_EMPTY=158 +hestiaKERNEL_ERROR_PROTOCOL_UNSUPPORTED=159 + + + + +# system (e.g. os interactable system) +hestiaKERNEL_ERROR_SYSTEM_BAD_IO=160 +hestiaKERNEL_ERROR_SYSTEM_DEVICE_CROSS_LINK=161 +hestiaKERNEL_ERROR_SYSTEM_INTERRUPT_CALL=162 +hestiaKERNEL_ERROR_SYSTEM_INVALID=163 +hestiaKERNEL_ERROR_SYSTEM_MISSING_BLOCK_DEVICE=164 +hestiaKERNEL_ERROR_SYSTEM_MISSING_DEVICE=165 +hestiaKERNEL_ERROR_SYSTEM_MISSING_IO=166 +hestiaKERNEL_ERROR_SYSTEM_MISSING_PROCESS=167 +hestiaKERNEL_ERROR_SYSTEM_OUT_OF_DOMAIN=168 +hestiaKERNEL_ERROR_SYSTEM_OUT_OF_MEMORY=169 +hestiaKERNEL_ERROR_SYSTEM_OUT_OF_SPACE=170 +hestiaKERNEL_ERROR_SYSTEM_READ_ONLY_FILESYSTEM=171 + + + + +# user +hestiaKERNEL_ERROR_USER_ACCESS_BANNED=172 +hestiaKERNEL_ERROR_USER_ACCESS_LOCKED=173 +hestiaKERNEL_ERROR_USER_ACCESS_NOT_VERIFIED=174 +hestiaKERNEL_ERROR_USER_ACCESS_BAD=175 +hestiaKERNEL_ERROR_USER_ACCESS_REJECTED=176 +hestiaKERNEL_ERROR_USER_ACCESS_REVOKED=177 +hestiaKERNEL_ERROR_USER_ACCESS_EXISTS=178 +hestiaKERNEL_ERROR_USER_ACCESS_EMPTY=179 +hestiaKERNEL_ERROR_USER_ACCESS_MISSING=180 +hestiaKERNEL_ERROR_USER_ACCESS_INVALID=181 +hestiaKERNEL_ERROR_USER_ACCESS_EXPIRED=182 +hestiaKERNEL_ERROR_USER_ACCESS_MISMATCHED=183 + +hestiaKERNEL_ERROR_USER_MFA_BANNED=184 +hestiaKERNEL_ERROR_USER_MFA_LOCKED=185 +hestiaKERNEL_ERROR_USER_MFA_NOT_VERIFIED=186 +hestiaKERNEL_ERROR_USER_MFA_BAD=188 +hestiaKERNEL_ERROR_USER_MFA_REJECTED=189 +hestiaKERNEL_ERROR_USER_MFA_REVOKED=190 +hestiaKERNEL_ERROR_USER_MFA_EXISTS=191 +hestiaKERNEL_ERROR_USER_MFA_EMPTY=192 +hestiaKERNEL_ERROR_USER_MFA_MISSING=193 +hestiaKERNEL_ERROR_USER_MFA_INVALID=194 +hestiaKERNEL_ERROR_USER_MFA_EXPIRED=195 +hestiaKERNEL_ERROR_USER_MFA_MISMATCHED=196 + +hestiaKERNEL_ERROR_USER_ID_EXISTS=197 +hestiaKERNEL_ERROR_USER_ID_BANNED=198 +hestiaKERNEL_ERROR_USER_ID_BAD=199 +hestiaKERNEL_ERROR_USER_ID_LOCKED=200 +hestiaKERNEL_ERROR_USER_ID_NOT_VERIFIED=201 +hestiaKERNEL_ERROR_USER_ID_EMPTY=202 +hestiaKERNEL_ERROR_USER_ID_MISSING=203 +hestiaKERNEL_ERROR_USER_ID_INVALID=204 +hestiaKERNEL_ERROR_USER_ID_EXPIRED=205 +hestiaKERNEL_ERROR_USER_ID_MISMATCHED=206 +hestiaKERNEL_ERROR_USER_ID_DELETED=207 + +hestiaKERNEL_ERROR_USER_PASSWORD_EXISTS=208 +hestiaKERNEL_ERROR_USER_PASSWORD_BANNED=209 +hestiaKERNEL_ERROR_USER_PASSWORD_BAD=210 +hestiaKERNEL_ERROR_USER_PASSWORD_REJECTED=211 +hestiaKERNEL_ERROR_USER_PASSWORD_REVOKED=212 +hestiaKERNEL_ERROR_USER_PASSWORD_EMPTY=213 +hestiaKERNEL_ERROR_USER_PASSWORD_MISSING=214 +hestiaKERNEL_ERROR_USER_PASSWORD_INVALID=215 +hestiaKERNEL_ERROR_USER_PASSWORD_EXPIRED=216 +hestiaKERNEL_ERROR_USER_PASSWORD_MISMATCHED=217 + +hestiaKERNEL_ERROR_USER_KEY_EXISTS=218 +hestiaKERNEL_ERROR_USER_KEY_BANNED=219 +hestiaKERNEL_ERROR_USER_KEY_BAD=220 +hestiaKERNEL_ERROR_USER_KEY_REJECTED=221 +hestiaKERNEL_ERROR_USER_KEY_REVOKED=222 +hestiaKERNEL_ERROR_USER_KEY_EMPTY=223 +hestiaKERNEL_ERROR_USER_KEY_MISSING=224 +hestiaKERNEL_ERROR_USER_KEY_INVALID=225 +hestiaKERNEL_ERROR_USER_KEY_EXPIRED=226 +hestiaKERNEL_ERROR_USER_KEY_MISMATCHED=227 +################################################################################ +# Unix Main Codes # +################################################################################ +return 0 +#> diff --git a/automataCI/services/hestiaKERNEL/Run_Parallel_Sentinel.sh.ps1 b/automataCI/services/hestiaKERNEL/Run_Parallel_Sentinel.sh.ps1 new file mode 100644 index 0000000..14b290d --- /dev/null +++ b/automataCI/services/hestiaKERNEL/Run_Parallel_Sentinel.sh.ps1 @@ -0,0 +1,311 @@ +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 hestiaKERNEL-Run-Parallel-Sentinel { + param( + [string]$____parallel_command, + [string]$____parallel_control_directory, + [string]$____parallel_available + ) + + + # validate input + if ([string]::IsNullOrEmpty($____parallel_command)) { + return 61 # data is empty + } + + if ([string]::IsNullOrEmpty($____parallel_control_directory)) { + return 87 # entity is empty + } + + if (-not (Test-Path -PathType Container -Path "${____parallel_control_directory}")) { + return 104 # entity is not directory + } + + $____parallel_control = "${____parallel_control_directory}\control.txt" + if (-not (Test-Path -PathType Leaf -Path "${____parallel_control}")) { + return 88 # entity is invalid + } + + try { + if ( + ([string]::IsNullOrEmpty($____parallel_available)) -or + ($____parallel_available -le 0) + ) { + $____parallel_available = [System.Environment]::ProcessorCount + if ($____parallel_available -le 0) { + $____parallel_available = 1 + } + } + } catch { + $____parallel_available = [System.Environment]::ProcessorCount + if ($____parallel_available -le 0) { + $____parallel_available = 1 + } + } + + + # execute + $____parallel_flags = "${____parallel_directory}\flags" + $____parallel_total = 0 + + + # scan total tasks + foreach ($____line in (Get-Content "${____parallel_control}")) { + $____parallel_total += 1 + } + + + # end the execution if no task is available + if ($____parallel_total -le 0) { + return 0 # ok + } + + + # run in singular when only 1 task is required + if ( + ($____parallel_available -le 1) -or + ($____parallel_total -eq 1) + ) { + ${function:SYNC-Run} = ${___parallel_command} + foreach ($____line in (Get-Content "${____parallel_control}")) { + $____process = SYNC-Run "${____line}" + if ($____process -ne 0) { + return 1 + } + + + # report status + return 0 + } + } + + + # run in parallel + $____jobs = @() + foreach ($____line in (Get-Content "${____parallel_control}")) { + $____jobs += Start-ThreadJob -ScriptBlock { + ${function:SYNC-Run} = ${using:____parallel_command} + $____process = SYNC-Run "${using:____line}" + if ($____process -ne 0) { + return 1 # bad exec + } + + + # report status + return 0 # ok + } + } + + $null = Wait-Job -Job $____jobs + foreach ($____job in $____jobs) { + $____process = Receive-Job -Job $____job + if ($____process -ne 0) { + return 1 # bad exec + } + } + + + # report status + return 0 # ok +} +################################################################################ +# Windows POWERSHELL Codes # +################################################################################ +return +<# +RUN_AS_POWERSHELL + + + + +################################################################################ +# Unix Main Codes # +################################################################################ +hestiaKERNEL_Run_Parallel_Sentinel() { + ____parallel_command="$1" + ____parallel_control_directory="$2" + ____parallel_available="$3" + + + # validate input + if [ -z "$____parallel_command" ]; then + return 61 # data is empty + fi + + if [ -z "$____parallel_control_directory" ]; then + return 87 # entity is empty + fi + + if [ ! -d "$____parallel_control_directory" ]; then + return 104 # entity is not directory + fi + + ____parallel_control="${____parallel_control_directory}/control.txt" + if [ ! -f "$____parallel_control" ]; then + return 88 # entity is invalid + fi + + if [ -z "$____parallel_available" ]; then + ____parallel_available=$(getconf _NPROCESSORS_ONLN) + fi + + + # execute + ____parallel_flags="${____parallel_control_directory}/flags" + ____parallel_total=0 + + + # scan total tasks + ____old_IFS="$IFS" + while IFS= read -r ____line || [ -n "$____line" ]; do + ____parallel_total=$(($____parallel_total + 1)) + done < "$____parallel_control" + IFS="$____old_IFS" && unset ____old_IFS + + + # bail if not task is available + if [ $____parallel_total -le 0 ]; then + return 0 # ok + fi + + + # run in singular when only 1 task is required + if [ $____parallel_available -eq 1 ] || [ $____parallel_total -eq 1 ]; then + ____old_IFS="$IFS" + while IFS= read -r ____line || [ -n "$____line" ]; do + "$____parallel_command" "$____line" + if [ $? -ne 0 ]; then + return 1 # bad exec + fi + done < "$____parallel_control" + IFS="$____old_IFS" && unset ____old_IFS + + + # report status + return 0 # ok + fi + + + # run in parallel + ____parallel_error=0 + ____parallel_done=0 + rm -rf "$____parallel_flags" &> /dev/null + mkdir -p "$____parallel_flags" &> /dev/null + while [ $____parallel_done -ne $____parallel_total ]; do + ____parallel_done=0 + ____parallel_current=0 + ____parallel_working=0 + + + # scan state + ____parallel_count=0 + ____old_IFS="$IFS" + while IFS= read -r ____line || [ -n "$____line" ]; do + ____parallel_count=$(($____parallel_count + 1)) + ____parallel_flag="${____parallel_flags}/task_${____parallel_count}" + + + # skip if error flag is found + if [ -d "${____parallel_flag}_error" ]; then + ____parallel_error=$(($____parallel_error + 1)) + continue + fi + + + # skip if working flag is found + if [ -d "${____parallel_flag}_working" ]; then + ____parallel_working=$(($____parallel_working + 1)) + ____parallel_current=$(($____parallel_current + 1)) + continue + fi + + + # break entire scan when run is completed + if [ $____parallel_done -eq $____parallel_total ]; then + break + fi + + + # skip if done flag is found + if [ -d "${____parallel_flag}_done" ]; then + ____parallel_done=$(($____parallel_done + 1)) + ____parallel_current=$(($____parallel_current + 1)) + continue + fi + + + # it's a working state + if [ $____parallel_working -lt $____parallel_available ]; then + # secure parallel working lock + mkdir -p "${____parallel_flag}_working" + ____parallel_working=$(($____parallel_working + 1)) + + + # initiate parallel execution + { + "$____parallel_command" "$____line" + case $? in + 0) + mkdir -p "${____parallel_flag}_done" + ;; + *) + mkdir -p "${____parallel_flag}_error" + ;; + esac + rm -rf "${____parallel_flag}_working" &> /dev/null + } & + fi + + ____parallel_current=$(($____parallel_current + 1)) + done < "$____parallel_control" + IFS="$____old_IFS" && unset ____old_IFS + + + # stop the entire operation if error is detected and no more + # running tasks + if [ $____parallel_error -gt 0 ] && [ $____parallel_working -eq 0 ]; then + return 1 # bad exec + fi + done + + + # report status + return 0 # ok +} +################################################################################ +# Unix Main Codes # +################################################################################ +return 0 +#> diff --git a/automataCI/services/hestiaKERNEL/Vanilla.sh.ps1 b/automataCI/services/hestiaKERNEL/Vanilla.sh.ps1 new file mode 100644 index 0000000..1649184 --- /dev/null +++ b/automataCI/services/hestiaKERNEL/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}\hestiaKERNEL\Error_Codes.sh.ps1" +. "${env:LIBS_HESTIA}\hestiaKERNEL\Run_Parallel_Sentinel.sh.ps1" +################################################################################ +# Windows POWERSHELL Codes # +################################################################################ +return +<# +RUN_AS_POWERSHELL + + + + +################################################################################ +# Unix Main Codes # +################################################################################ +. "${LIBS_HESTIA}/hestiaKERNEL/Error_Codes.sh.ps1" +. "${LIBS_HESTIA}/hestiaKERNEL/Run_Parallel_Sentinel.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 old mode 100755 new mode 100644 similarity index 79% rename from automataCI/services/hestiaLOCALE/Get-LCID.sh.ps1 rename to automataCI/services/hestiaLOCALE/Get_LCID.sh.ps1 index 72d2291..1851b73 --- a/automataCI/services/hestiaLOCALE/Get-LCID.sh.ps1 +++ b/automataCI/services/hestiaLOCALE/Get_LCID.sh.ps1 @@ -35,30 +35,26 @@ echo \" <<'RUN_AS_POWERSHELL' >/dev/null # " | Out-Null ## More Info: ## https://learn.microsoft.com/en-us/openspecs/windows_protocols/ms-lcid/70feba9f-294e-491e-b6eb-56532684c37f function hestiaLOCALE-Get-LCID { - param( - [string]$___locale - ) - - - # execute - switch ("${___locale}") { - "en" { - return 9 - } { $_ -in "en-US", "en-us" } { - return 1033 - } "zh" { - return 30724 - } { $_ -in "zh-CN", "zh-cn" } { - return 2052 - } { $_ -in "zh-Hans", "zh-hans" } { - return 4 - } default { - return - }} - - - # report status - return 0 + param( + [string]$___locale + ) + + + # execute + switch ("${___locale}") { + "en" { + return 9 + } { $_ -in "en-US", "en-us" } { + return 1033 + } "zh" { + return 30724 + } { $_ -in "zh-CN", "zh-cn" } { + return 2052 + } { $_ -in "zh-Hans", "zh-hans" } { + return 4 + } default { + return 0 + }} } ################################################################################ # Windows POWERSHELL Codes # @@ -82,29 +78,25 @@ hestiaLOCALE_Get_LCID() { # execute case "$1" in en) - printf -- "9" + printf -- "%d" 9 ;; en-US|en-us) - printf -- "1033" + printf -- "%d" 1033 ;; zh) - printf -- "30724" + printf -- "%d" 30724 ;; zh-CN|zh-cn) - printf -- "2052" + printf -- "%d" 2052 ;; zh-Hans|zh-hans) - printf -- "4" + printf -- "%d" 4 ;; *) - printf -- "" - return 1 + printf -- "%d" 0 + return 0 ;; esac - - - # report status - return 0 } ################################################################################ # Unix Main Codes # diff --git a/automataCI/services/hestiaLOCALE/Get_Lang.sh.ps1 b/automataCI/services/hestiaLOCALE/Get_Lang.sh.ps1 new file mode 100644 index 0000000..7fb73a5 --- /dev/null +++ b/automataCI/services/hestiaLOCALE/Get_Lang.sh.ps1 @@ -0,0 +1,105 @@ +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 + $___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 -- "%s" "$1" + return 0 + elif [ ! "$PROJECT_LANG" = "" ]; then + printf -- "%s" "$PROJECT_LANG" + return 0 + elif [ ! "$AUTOMATACI_LANG" = "" ]; then + printf -- "%s" "$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 -- "%s" "$___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 old mode 100755 new mode 100644 index eda087c..3074f32 --- 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/hestiaMSI/Is_Target_Valid.sh.ps1 b/automataCI/services/hestiaMSI/Is_Target_Valid.sh.ps1 new file mode 100644 index 0000000..47256ea --- /dev/null +++ b/automataCI/services/hestiaMSI/Is_Target_Valid.sh.ps1 @@ -0,0 +1,115 @@ +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\Get_File.sh.ps1" +. "${env:LIBS_HESTIA}\hestiaSTRING\Is_Empty.sh.ps1" + + + + +function hestiaMSI-Is-Target-Valid { + param ( + [string]$___target + ) + + + # validate input + if ($(hestiaSTRING-Is-Empty "${___target}") -eq ${env:hestiaKERNEL_ERROR_OK}) { + return ${env:hestiaKERNEL_ERROR_DATA_MISSING} + } + + + # execute + $___target = hestiaFS-Get-File "${___target}" + if ( + ($("${___target}" -replace '.*\.msi$', '') -ne "${___target}") -or + ($("${___target}" -replace '^.*-msi', '') -ne "${___target}") + ) { + 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/Get_File.sh.ps1" +. "${LIBS_HESTIA}/hestiaSTRING/Is_Empty.sh.ps1" + + + + +hestiaMSI_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 + ___target="$(FS_Get_File "$1")" + if [ ! "${___target%%.msi*}" = "$___target" ] || + [ ! "${___target##*-msi}" = "$___target" ]; 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/hestiaMSI/Vanilla.sh.ps1 b/automataCI/services/hestiaMSI/Vanilla.sh.ps1 new file mode 100644 index 0000000..93a6b87 --- /dev/null +++ b/automataCI/services/hestiaMSI/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}\hestiaMSI\Is_Target_Valid.sh.ps1" +################################################################################ +# Windows POWERSHELL Codes # +################################################################################ +return +<# +RUN_AS_POWERSHELL + + + + +################################################################################ +# Unix Main Codes # +################################################################################ +. "${LIBS_HESTIA}/hestiaMSI/Is_Target_Valid.sh.ps1" +################################################################################ +# Unix Main Codes # +################################################################################ +return 0 +#> diff --git a/automataCI/services/hestiaNPM/Is_Target_Valid.sh.ps1 b/automataCI/services/hestiaNPM/Is_Target_Valid.sh.ps1 new file mode 100644 index 0000000..ffd124e --- /dev/null +++ b/automataCI/services/hestiaNPM/Is_Target_Valid.sh.ps1 @@ -0,0 +1,129 @@ +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.sh.ps1" +. "${env:LIBS_HESTIA}\hestiaGZ\Is_Target_Valid.sh.ps1" +. "${env:LIBS_HESTIA}\hestiaKERNEL\Vanilla.sh.ps1" +. "${env:LIBS_HESTIA}\hestiaSTRING\Is_Empty.sh.ps1" +. "${env:LIBS_HESTIA}\hestiaTAR\Is_Target_Valid.sh.ps1" + + + + +function hestiaNPM-Is-Target-Valid { + param ( + [string]$___target + ) + + + # validate input + if ($(hestiaSTRING-Is-Empty "${___target}") -eq 0) { + return ${env:hestiaKERNEL_ERROR_DATA_MISSING} + } + + if ($(hestiaTAR-Is-Target-Valid "${___target}") -ne 0) { + return ${env:hestiaKERNEL_ERROR_DATA_MISSING} + } + + + # execute + $___target = hestiaFS-Get-File "${___target}" + if ($("${___target}" -replace '.*_js-js\.tgz$', '') -ne "${___target}") { + 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}/hestiaFS/Get_File.sh.ps1" +. "${LIBS_HESTIA}/hestiaGZ/Is_Target_Valid.sh.ps1" +. "${LIBS_HESTIA}/hestiaKERNEL/Vanilla.sh.ps1" +. "${LIBS_HESTIA}/hestiaSTRING/Is_Empty.sh.ps1" +. "${LIBS_HESTIA}/hestiaTAR/Is_Target_Valid.sh.ps1" + + + + +hestiaNPM_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 [ $(hestiaTAR_Is_Target_Valid "$1") -ne 0 ]; then + printf -- "%d" $hestiaKERNEL_ERROR_DATA_MISMATCHED + return $hestiaKERNEL_ERROR_DATA_MISMATCHED + fi + + if [ $(hestiaGZ_Is_Target_Valid "$1") -ne 0 ]; then + printf -- "%d" $hestiaKERNEL_ERROR_DATA_MISMATCHED + return $hestiaKERNEL_ERROR_DATA_MISMATCHED + fi + + + # execute + ___target="$(hestiaFS_Get_File "$1")" + if [ ! "${___target%%_js-js.tgz*}" = "$___target" ]; 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/hestiaNPM/Vanilla.sh.ps1 b/automataCI/services/hestiaNPM/Vanilla.sh.ps1 new file mode 100644 index 0000000..9709611 --- /dev/null +++ b/automataCI/services/hestiaNPM/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}\hestiaNPM\Is_Target_Valid.sh.ps1" +################################################################################ +# Windows POWERSHELL Codes # +################################################################################ +return +<# +RUN_AS_POWERSHELL + + + + +################################################################################ +# Unix Main Codes # +################################################################################ +. "${LIBS_HESTIA}/hestiaNPM/Is_Target_Valid.sh.ps1" +################################################################################ +# Unix Main Codes # +################################################################################ +return 0 +#> diff --git a/automataCI/services/hestiaNUPKG/Is_Target_Valid.sh.ps1 b/automataCI/services/hestiaNUPKG/Is_Target_Valid.sh.ps1 new file mode 100644 index 0000000..87562a0 --- /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 "${___target}") -eq ${env:hestiaKERNEL_ERROR_OK}) { + return ${env:hestiaKERNEL_ERROR_DATA_MISSING} + } + + if ($(hestiaZIP-Is-Target-Valid "${___target}") -ne ${env:hestiaKERNEL_ERROR_OK}) { + return ${env:hestiaKERNEL_ERROR_DATA_MISSING} + } + + + # execute + $___target = hestiaFS-Get-File "${___target}" + if ($("${___target}" -replace '^.*\.nupkg$', '') -ne "${___target}") { + 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 $hestiaKERNEL_ERROR_OK ]; then + printf -- "%d" $hestiaKERNEL_ERROR_DATA_MISSING + return $hestiaKERNEL_ERROR_DATA_MISSING + fi + + if [ $(hestiaZIP_Is_Target_Valid "$1") -ne $hestiaKERNEL_ERROR_OK ]; then + printf -- "%d" $hestiaKERNEL_ERROR_DATA_MISMATCHED + return $hestiaKERNEL_ERROR_DATA_MISMATCHED + fi + + + # execute + ___target="$(hestiaFS_Get_File "$1")" + if [ ! "${___target%%.nupkg*}" = "$___target" ]; 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/Package.sh.ps1 b/automataCI/services/hestiaNUPKG/Package.sh.ps1 new file mode 100644 index 0000000..ae261e9 --- /dev/null +++ b/automataCI/services/hestiaNUPKG/Package.sh.ps1 @@ -0,0 +1,435 @@ +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.sh.ps1" +. "${env:LIBS_HESTIA}\hestiaFS\Vanilla.sh.ps1" +. "${env:LIBS_HESTIA}\hestiaSTRING\Is_Empty.sh.ps1" +. "${env:LIBS_HESTIA}\hestiaZIP\Pack.sh.ps1" + + + + +function hestiaNUPKG-Package { + param ( + [string]$___destination, + [string]$___directory, + [string]$___id, + [string]$___version, + [string]$___description, + [string]$___author, + [string]$___project_url, + [string]$___license_file, + [string]$___icon, + [string]$___readme, + [string]$___license_acceptance, + [string]$___source_url, + [string]$___title + ) + + + # validate input + if ($(hestiaSTRING-Is-Empty "${___destination}") -eq ${env:hestiaKERNEL_ERROR_OK}) { + return ${env:hestiaKERNEL_ERROR_ENTITY_MISSING} + } + + if ($(hestiaFS-Is-Exist "${___destination}") -eq ${env:hestiaKERNEL_ERROR_OK}) { + return ${env:hestiaKERNEL_ERROR_ENTITY_MISSING} + } + + if ($(hestiaFS-Is-Directory "${___destination}") -eq ${env:hestiaKERNEL_ERROR_OK}) { + return ${env:hestiaKERNEL_ERROR_ENTITY_IS_NOT_FILE} + } + + if ($(hestiaSTRING-Is-Empty "${___directory}") -eq ${env:hestiaKERNEL_ERROR_OK}) { + return ${env:hestiaKERNEL_ERROR_IS_EMPTY} + } + + if ($(hestiaFS-Is-Directory "${___directory}") -ne ${env:hestiaKERNEL_ERROR_OK}) { + return ${env:hestiaKERNEL_ERROR_BAD_DESCRIPTOR} + } + + if ($(hestiaSTRING-Is-Empty "${___id}") -eq ${env:hestiaKERNEL_ERROR_OK}) { + return ${env:hestiaKERNEL_ERROR_DATA_EMPTY} + } + + if ($(hestiaSTRING-Is-Empty "${___version}") -eq ${env:hestiaKERNEL_ERROR_OK}) { + return ${env:hestiaKERNEL_ERROR_DATA_EMPTY} + } + + if ($(hestiaSTRING-Is-Empty "${___description}") -eq ${env:hestiaKERNEL_ERROR_OK}) { + return ${env:hestiaKERNEL_ERROR_DATA_EMPTY} + } + + if ($(hestiaSTRING-Is-Empty "${___author}") -eq ${env:hestiaKERNEL_ERROR_OK}) { + return ${env:hestiaKERNEL_ERROR_DATA_EMPTY} + } + + if ($(hestiaSTRING-Is-Empty "${___project_url}") -eq ${env:hestiaKERNEL_ERROR_OK}) { + return ${env:hestiaKERNEL_ERROR_DATA_EMPTY} + } + + if ($(hestiaSTRING-Is-Empty "${___license_file}") -eq ${env:hestiaKERNEL_ERROR_OK}) { + return ${env:hestiaKERNEL_ERROR_DATA_EMPTY} + } + + if ($(hestiaFS-Is-File "${___directory}\${___license_file}") -ne ${env:hestiaKERNEL_ERROR_OK}) { + return ${env:hestiaKERNEL_ERROR_DATA_MISSING} + } + + if ($(hestiaSTRING-Is-Empty "${___icon}") -eq ${env:hestiaKERNEL_ERROR_OK}) { + return ${env:hestiaKERNEL_ERROR_DATA_EMPTY} + } + + if ($(hestiaFS-Is-File "${___directory}\${___icon}") -ne ${env:hestiaKERNEL_ERROR_OK}) { + return ${env:hestiaKERNEL_ERROR_DATA_MISSING} + } + + if ($(hestiaSTRING-Is-Empty "${___readme}") -eq ${env:hestiaKERNEL_ERROR_OK}) { + return ${env:hestiaKERNEL_ERROR_DATA_EMPTY} + } + + if ($(hestiaFS-Is-File "${___directory}\${___readme}") -ne ${env:hestiaKERNEL_ERROR_OK}) { + return ${env:hestiaKERNEL_ERROR_DATA_MISSING} + } + + if ($___license_acceptance -ne "yes") { + $___license_acceptance = "no" + } + + if ($(hestiaSTRING-Is-Empty "${___source_url}") -eq ${env:hestiaKERNEL_ERROR_OK}) { + return ${env:hestiaKERNEL_ERROR_DATA_EMPTY} + } + + if ($(hestiaSTRING-Is-Empty "${___title}") -eq ${env:hestiaKERNEL_ERROR_OK}) { + return ${env:hestiaKERNEL_ERROR_DATA_EMPTY} + } + + + # execute + $___nuspec = "" + foreach ($___file in (Get-ChildItem -File -Path "${___directory}" ` + | Where-Object { $_.Name -like "*.nuspec" })) { $___file.FullName + if ($(FS-Get-File "${___file}") -eq ".nuspec") { + return ${env:hestiaKERNEL_ERROR_BAD_DESCRIPTOR} + } + + if ($(hestiaSTRING-Is-Empty "${___nuspec}") -ne ${env:hestiaKERNEL_ERROR_OK}) { + return ${env:hestiaKERNEL_ERROR_TOO_MANY_REFERENCES} + } + + $___nuspec = $___file -replace [regex]::Escape("${___directory}\"), '' + } + + if ($(hestiaSTRING-Is-Empty "${___nuspec}") -eq ${env:hestiaKERNEL_ERROR_OK}) { + # missing nuspec - create one + $___nuspec = "${___directory}\${___id}.nuspec" + $___process = hestiaFS-Write-File "${___nuspec}" @" + + + + ${___id} + ${___version} + ${___description} + ${___author} + ${___author} + ${___project_url} + ${___license_file} + ${___icon} + ${___readme} + ${___license_acceptance} + + ${___title} + + + +"@ + if ($___process -ne 0) { + return ${env:hestiaKERNEL_ERROR_BAD_EXEC} + } + + + # loop through each detected files and register into the nuspec + foreach ($___file in (Get-ChildItem -File -Recurse -Path "${___directory}") + ) { $___file = $___file.FullName + if ( + ("$($___file -replace ".*\.nuspec$", '')" -ne "${___file}") -or + ("$($___file -replace ".*Chocolatey.*", '')" -ne "${___file}") -or + ("$($___file -replace ".*chocolatey.*", '')" -ne "${___file}") + ) { + continue + } + + # valid payload - register + $___file = $___file -replace [regex]::Escape("${___directory}\"), '' + $___process = hestiaFS-Append-File "${___nuspec}" @" + + +"@ + if ($___process -ne 0) { + return ${env:hestiaKERNEL_ERROR_BAD_EXEC} + } + } + + + # close the nuspec + $___process = hestiaFS-Append-File "${___nuspec}" @" + + + +"@ + if ($___process -ne 0) { + return ${env:hestiaKERNEL_ERROR_BAD_EXEC} + } + } + + + # package the file + $___process = hestiaZIP-Pack "${___destination}" "${___directory}" + if ($___process -ne 0) { + 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/Error_Codes.sh.ps1" +. "${LIBS_HESTIA}/hestiaFS/Vanilla.sh.ps1" +. "${LIBS_HESTIA}/hestiaSTRING/Is_Empty.sh.ps1" +. "${LIBS_HESTIA}/hestiaZIP/Pack.sh.ps1" + + + + +hestiaNUPKG_Package() { + ___destination="$1" + ___directory="$2" + ___id="$3" + ___version="$4" + ___description="$5" + ___author="$6" + ___project_url="$7" + ___license_file="$8" + ___icon="$9" + ___readme="${10}" + ___license_acceptance="${11}" + ___source_url="${12}" + ___title="${13}" + + + # validate input + if [ $(hestiaSTRING_Is_Empty "$___destination") -eq $hestiaKERNEL_ERROR_OK ]; then + return $hestiaKERNEL_ERROR_ENTITY_MISSING + fi + + if [ $(hestiaFS_Is_Exist "$___destination") -eq $hestiaKERNEL_ERROR_OK ]; then + return $hestiaKERNEL_ERROR_ENTITY_MISSING + fi + + if [ $(hestiaFS_Is_Directory "$___destination") -eq $hestiaKERNEL_ERROR_OK ]; then + return $hestiaKERNEL_ERROR_ENTITY_IS_NOT_FILE + fi + + if [ $(hestiaSTRING_Is_Empty "$___directory") -eq $hestiaKERNEL_ERROR_OK ]; then + return $hestiaKERNEL_ERROR_IS_EMPTY + fi + + if [ $(hestiaFS_Is_Directory "$___directory") -ne $hestiaKERNEL_ERROR_OK ]; then + return $hestiaKERNEL_ERROR_BAD_DESCRIPTOR + fi + + if [ $(hestiaSTRING_Is_Empty "$___id") -eq $hestiaKERNEL_ERROR_OK ]; then + return $hestiaKERNEL_ERROR_DATA_EMPTY + fi + + if [ $(hestiaSTRING_Is_Empty "$___version") -eq $hestiaKERNEL_ERROR_OK ]; then + return $hestiaKERNEL_ERROR_DATA_EMPTY + fi + + if [ $(hestiaSTRING_Is_Empty "$___description") -eq $hestiaKERNEL_ERROR_OK ]; then + return $hestiaKERNEL_ERROR_DATA_EMPTY + fi + + if [ $(hestiaSTRING_Is_Empty "$___author") -eq $hestiaKERNEL_ERROR_OK ]; then + return $hestiaKERNEL_ERROR_DATA_EMPTY + fi + + if [ $(hestiaSTRING_Is_Empty "$___project_url") -eq $hestiaKERNEL_ERROR_OK ]; then + return $hestiaKERNEL_ERROR_DATA_EMPTY + fi + + if [ $(hestiaSTRING_Is_Empty "$___license_file") -eq $hestiaKERNEL_ERROR_OK ]; then + return $hestiaKERNEL_ERROR_DATA_EMPTY + fi + + if [ $(hestiaFS_Is_File "${___directory}/${___license_file}") -ne $hestiaKERNEL_ERROR_OK ]; then + return $hestiaKERNEL_ERROR_DATA_MISSING + fi + + if [ $(hestiaSTRING_Is_Empty "$___icon") -eq $hestiaKERNEL_ERROR_OK ]; then + return $hestiaKERNEL_ERROR_DATA_EMPTY + fi + + if [ $(hestiaFS_Is_File "${___directory}/${___icon}") -ne $hestiaKERNEL_ERROR_OK ]; then + return $hestiaKERNEL_ERROR_DATA_MISSING + fi + + if [ $(hestiaSTRING_Is_Empty "$___readme") -eq $hestiaKERNEL_ERROR_OK ]; then + return $hestiaKERNEL_ERROR_DATA_EMPTY + fi + + if [ $(hestiaFS_Is_File "${___directory}/${___readme}") -ne $hestiaKERNEL_ERROR_OK ]; then + return $hestiaKERNEL_ERROR_DATA_MISSING + fi + + if [ ! "$___license_acceptance" = "yes" ]; then + ___license_acceptance="no" + fi + + if [ $(hestiaSTRING_Is_Empty "$___source_url") -eq $hestiaKERNEL_ERROR_OK ]; then + return $hestiaKERNEL_ERROR_DATA_EMPTY + fi + + if [ $(hestiaSTRING_Is_Empty "$___title") -eq $hestiaKERNEL_ERROR_OK ]; then + return $hestiaKERNEL_ERROR_DATA_EMPTY + fi + + + # execute + ___nuspec="" + ___old_IFS="$IFS" + while IFS= read -r ___file || [ -n "$___file" ]; do + if [ "$(hestiaFS_Get_File "$___file")" = ".nuspec" ]; then + return $hestiaKERNEL_ERROR_BAD_DESCRIPTOR + fi + + if [ $(hestiaSTRING_Is_Empty "$___nuspec") -ne $hestiaKERNEL_ERROR_OK ]; then + return $hestiaKERNEL_ERROR_TOO_MANY_REFERENCES + fi + + ___nuspec="${___file##*${___directory}/}" + done < /dev/null) +EOF + IFS="$___old_IFS" && unset ___old_IFS + + if [ $(hestiaSTRING_Is_Empty "$___nuspec") -eq $hestiaKERNEL_ERROR_OK ]; then + # missing nuspec - create one + ___nuspec="${___directory}/${___id}.nuspec" + hestiaFS_Write_File "$___nuspec" "\ + + + + ${___id} + ${___version} + ${___description} + ${___author} + ${___author} + ${___project_url} + ${___license_file} + ${___icon} + ${___readme} + ${___license_acceptance} + + ${___title} + + +" + if [ $? -ne $hestiaKERNEL_ERROR_OK ]; then + return $hestiaKERNEL_ERROR_BAD_EXEC + fi + + + # loop through each detected files and register into the nuspec + ___old_IFS="$IFS" + while IFS= read -r ___file || [ -n "$___file" ]; do + if [ ! "${___file%%.nuspec*}" = "$___file" ] || + [ ! "${___file%%Chocolatey*}" = "$___file" ] || + [ ! "${___file%%chocolatey*}" = "$___file" ]; then + continue + fi + + # valid payload - register + ___file="${___file#*${___directory}/}" + hestiaFS_Append_File "$___nuspec" "\ + +" + if [ $? -ne $hestiaKERNEL_ERROR_OK ]; then + return $hestiaKERNEL_ERROR_BAD_EXEC + fi + done < /dev/null) +EOF + IFS="$___old_IFS" && unset ___old_IFS + + + # close the nuspec + hestiaFS_Append_File "$___nuspec" "\ + + +" + if [ $? -ne $hestiaKERNEL_ERROR_OK ]; then + return $hestiaKERNEL_ERROR_BAD_EXEC + fi + fi + + + # package the file + hestiaZIP_Pack "$___destination" "$___directory" + 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/Publish.sh.ps1 b/automataCI/services/hestiaNUPKG/Publish.sh.ps1 new file mode 100644 index 0000000..753e8fc --- /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\Is_Empty.sh.ps1" +. "${env:LIBS_HESTIA}\hestiaHTTP\Is_Available.sh.ps1" + + + + +function hestiaNUPKG-Publish { + param ( + [string]$___url, + [string]$___target, + [string]$___auth_token + ) + + + # validate input + if ($(hestiaHTTP-Is-Available) -ne ${env:hestiaKERNEL_ERROR_OK}) { + return ${env:hestiaKERNEL_ERROR_ENTITY_MISSING} + } + + if (($(hestiaSTRING-Is-Empty "${___url}") -eq ${env:hestiaKERNEL_ERROR_OK}) -or + ($(hestiaSTRING-Is-Empty "${___auth_token}") -eq ${env:hestiaKERNEL_ERROR_OK}) -or + ($(hestiaSTRING-Is-Empty "${___target}") -eq ${env:hestiaKERNEL_ERROR_OK})) { + 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 $hestiaKERNEL_ERROR_OK ]; 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 100644 index 0000000..8cd85eb --- /dev/null +++ b/automataCI/services/hestiaNUPKG/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}\hestiaNUPKG\Is_Target_Valid.sh.ps1" +. "${env:LIBS_HESTIA}\hestiaNUPKG\Package.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/Package.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 100644 index 0000000..831f597 --- /dev/null +++ b/automataCI/services/hestiaOS/Exec.sh.ps1 @@ -0,0 +1,207 @@ +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 100644 index 0000000..66dfcfd --- /dev/null +++ b/automataCI/services/hestiaOS/Is_Command_Available.sh.ps1 @@ -0,0 +1,108 @@ +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 + $___process = Get-Command $___command -ErrorAction SilentlyContinue + if ($___process) { + 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" +. "${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")") -ne $hestiaKERNEL_ERROR_OK ]; 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/Is_Simulation_Mode.sh.ps1 b/automataCI/services/hestiaOS/Is_Simulation_Mode.sh.ps1 new file mode 100644 index 0000000..7c7325d --- /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 100644 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/hestiaPDF/Is_Target_Valid.sh.ps1 b/automataCI/services/hestiaPDF/Is_Target_Valid.sh.ps1 new file mode 100644 index 0000000..9b788d9 --- /dev/null +++ b/automataCI/services/hestiaPDF/Is_Target_Valid.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}\hestiaFS\Get_File.sh.ps1" +. "${env:LIBS_HESTIA}\hestiaSTRING\Is_Empty.sh.ps1" + + + + +function hestiaPDF-Is-Target-Valid { + param ( + [string]$___target + ) + + + # validate input + if ($(hestiaSTRING-Is-Empty "${___target}") -eq ${env:hestiaKERNEL_ERROR_OK}) { + return ${env:hestiaKERNEL_ERROR_DATA_MISSING} + } + + + # execute + $___target = hestiaFS-Get-File "${___target}" + if ($("${___target}" -replace '.*\.pdf$', '') -ne "${___target}") { + 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/Get_File.sh.ps1" +. "${LIBS_HESTIA}/hestiaSTRING/Is_Empty.sh.ps1" + + + + +hestiaPDF_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 + ___target="$(hestiaFS_Get_File "$1")" + if [ ! "${___target%%.pdf*}" = "$___target" ]; 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/hestiaPDF/Vanilla.sh.ps1 b/automataCI/services/hestiaPDF/Vanilla.sh.ps1 new file mode 100644 index 0000000..95f0ff6 --- /dev/null +++ b/automataCI/services/hestiaPDF/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}\hestiaPDF\Is_Target_Valid.sh.ps1" +################################################################################ +# Windows POWERSHELL Codes # +################################################################################ +return +<# +RUN_AS_POWERSHELL + + + + +################################################################################ +# Unix Main Codes # +################################################################################ +. "${LIBS_HESTIA}/hestiaPDF/Is_Target_Valid.sh.ps1" +################################################################################ +# Unix Main Codes # +################################################################################ +return 0 +#> diff --git a/automataCI/services/hestiaRUST/Is_Target_Valid.sh.ps1 b/automataCI/services/hestiaRUST/Is_Target_Valid.sh.ps1 new file mode 100644 index 0000000..2bf8475 --- /dev/null +++ b/automataCI/services/hestiaRUST/Is_Target_Valid.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}\hestiaFS\Get_File.sh.ps1" +. "${env:LIBS_HESTIA}\hestiaSTRING\Is_Empty.sh.ps1" + + + + +function hestiaRUST-Is-Target-Valid { + param ( + [string]$___target + ) + + + # validate input + if ($(hestiaSTRING-Is-Empty "${___target}") -eq ${env:hestiaKERNEL_ERROR_OK}) { + return ${env:hestiaKERNEL_ERROR_DATA_MISSING} + } + + + # execute + $___target = hestiaFS-Get-File "${___target}" + if ($("${___target}" -replace '^.*-cargo', '') -ne "${___target}") { + 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/Get_File.sh.ps1" +. "${LIBS_HESTIA}/hestiaSTRING/Is_Empty.sh.ps1" + + + + +hestiaRUST_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 + ___target="$(FS_Get_File "$1")" + if [ ! "${___target##*-cargo}" = "$___target" ]; 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/hestiaRUST/Vanilla.sh.ps1 b/automataCI/services/hestiaRUST/Vanilla.sh.ps1 new file mode 100644 index 0000000..618ae13 --- /dev/null +++ b/automataCI/services/hestiaRUST/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}\hestiaRUST\Is_Target_Valid.sh.ps1" +################################################################################ +# Windows POWERSHELL Codes # +################################################################################ +return +<# +RUN_AS_POWERSHELL + + + + +################################################################################ +# Unix Main Codes # +################################################################################ +. "${LIBS_HESTIA}/hestiaRUST/Is_Target_Valid.sh.ps1" +################################################################################ +# Unix Main Codes # +################################################################################ +return 0 +#> diff --git a/automataCI/services/hestiaSTRING/Has.sh.ps1 b/automataCI/services/hestiaSTRING/Has.sh.ps1 new file mode 100644 index 0000000..ee217a3 --- /dev/null +++ b/automataCI/services/hestiaSTRING/Has.sh.ps1 @@ -0,0 +1,116 @@ +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 hestiaSTRING-Has { + param ( + [string]$___subject, + [string]$___target + ) + + + # validate input + if ([string]::IsNullOrEmpty($___target)) { + return ${env:hestiaKERNEL_ERROR_DATA_EMPTY} + } + + if ([string]::IsNullOrEmpty($___subject)) { + return ${env:hestiaKERNEL_ERROR_ENTITY_EMPTY} + } + + + # execute + if ($("${___subject}" -replace "^.*${___target}", '') -ne "${___subject}") { + return ${env:hestiaKERNEL_ERROR_OK} + } + + + # report status + return ${hestiaKERNEL_ERROR_DATA_MISMATCHED} +} +################################################################################ +# Windows POWERSHELL Codes # +################################################################################ +return +<# +RUN_AS_POWERSHELL + + + + +################################################################################ +# Unix Main Codes # +################################################################################ +. "${LIBS_HESTIA}/hestiaKERNEL/Vanilla.sh.ps1" + + + + +hestiaSTRING_Has() { + #___subject="$1" + #___target="$2" + + + # validate input + if [ -z "$1" ]; then + printf -- "%d" $hestiaKERNEL_ERROR_ENTITY_EMPTY + return $hestiaKERNEL_ERROR_ENTITY_EMPTY + fi + + if [ -z "$2" ]; then + printf -- "%d" $hestiaKERNEL_ERROR_DATA_EMPTY + return $hestiaKERNEL_ERROR_DATA_EMPTY + fi + + + # execute + if [ ! "${1##*${2}}" = "$1" ]; 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/hestiaSTRING/Is_Empty.sh.ps1 b/automataCI/services/hestiaSTRING/Is_Empty.sh.ps1 new file mode 100644 index 0000000..09c1540 --- /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 # +################################################################################ +. "${env: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 100644 index 0000000..4a2d217 --- /dev/null +++ b/automataCI/services/hestiaSTRING/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}\hestiaSTRING\Has.sh.ps1" +. "${env:LIBS_HESTIA}\hestiaSTRING\Is_Empty.sh.ps1" +################################################################################ +# Windows POWERSHELL Codes # +################################################################################ +return +<# +RUN_AS_POWERSHELL + + + + +################################################################################ +# Unix Main Codes # +################################################################################ +. "${LIBS_HESTIA}/hestiaSTRING/Has.sh.ps1" +. "${LIBS_HESTIA}/hestiaSTRING/Is_Empty.sh.ps1" +################################################################################ +# Unix Main Codes # +################################################################################ +return 0 +#> diff --git a/automataCI/services/hestiaTAR/Is_Available.sh.ps1 b/automataCI/services/hestiaTAR/Is_Available.sh.ps1 new file mode 100644 index 0000000..da4155b --- /dev/null +++ b/automataCI/services/hestiaTAR/Is_Available.sh.ps1 @@ -0,0 +1,85 @@ +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}\hestiaOS\Is_Command_Available.sh.ps1" + + + + +function hestiaTAR-Is-Available { + if ($(hestiaOS-Is-Command-Available "tar") -eq ${env:hestiaKERNEL_ERROR_OK}) { + 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" +. "${LIBS_HESTIA}/hestiaOS/Is_Command_Available.sh.ps1" + + + + +hestiaTAR_Is_Available() { + # execute + if [ $(hestiaOS_Is_Command_Available "tar") -eq $hestiaKERNEL_ERROR_OK ]; 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/hestiaTAR/Is_Target_Valid.sh.ps1 b/automataCI/services/hestiaTAR/Is_Target_Valid.sh.ps1 new file mode 100644 index 0000000..6e539e7 --- /dev/null +++ b/automataCI/services/hestiaTAR/Is_Target_Valid.sh.ps1 @@ -0,0 +1,119 @@ +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\Get_File.sh.ps1" +. "${env:LIBS_HESTIA}\hestiaSTRING\Is_Empty.sh.ps1" + + + + +function hestiaTAR-Is-Target-Valid { + param ( + [string]$___target + ) + + + # validate input + if ($(hestiaSTRING-Is-Empty "${___target}") -eq ${env:hestiaKERNEL_ERROR_OK}) { + return ${env:hestiaKERNEL_ERROR_DATA_MISSING} + } + + + # execute + $___subject = hestiaFS-Get-File "${___target}" + if (($("${___subject}" -replace '.*\.tar$', '') -ne "${___subject}") -or + ($("${___subject}" -replace '.*\.tar\.gz$', '') -ne "${___subject}") -or + ($("${___subject}" -replace '.*\.tgz$', '') -ne "${___subject}") -or + ($("${___subject}" -replace '.*\.tar\.xz$', '') -ne "${___subject}") -or + ($("${___subject}" -replace '.*\.txz$', '') -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/Get_File.sh.ps1" +. "${LIBS_HESTIA}/hestiaSTRING/Is_Empty.sh.ps1" + + + + +hestiaTAR_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 + ___subject="$(FS_Get_File "$1")" + if [ ! "${___subject%%.tar*}" = "$___subject" ] || + [ ! "${___subject%%.tar.gz*}" = "$___subject" ] || + [ ! "${___subject%%.tgz*}" = "$___subject" ] || + [ ! "${___subject%%.tar.xz*}" = "$___subject" ] || + [ ! "${___subject%%.txz*}" = "$___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/hestiaTAR/Pack.sh.ps1 b/automataCI/services/hestiaTAR/Pack.sh.ps1 new file mode 100644 index 0000000..343a7a0 --- /dev/null +++ b/automataCI/services/hestiaTAR/Pack.sh.ps1 @@ -0,0 +1,305 @@ +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\Vanilla.sh.ps1" +. "${env:LIBS_HESTIA}\hestiaGZ\Compress.sh.ps1" +. "${env:LIBS_HESTIA}\hestiaKERNEL\Vanilla.sh.ps1" +. "${env:LIBS_HESTIA}\hestiaSTRING\Is_Empty.sh.ps1" +. "${env:LIBS_HESTIA}\hestiaTAR\Is_Available.sh.ps1" +. "${env:LIBS_HESTIA}\hestiaOS\Vanilla.sh.ps1" +. "${env:LIBS_HESTIA}\hestiaXZ\Compress.sh.ps1" + + + + +function hestiaTAR-Pack { + param ( + [string]$___destination, + [string]$___source, + [string]$___compression, + [string]$___owner, + [string]$___group + ) + + + # validate input + if ($(hestiaSTRING-Is-Empty "${___destination}") -eq ${env:hestiaKERNEL_ERROR_OK}) { + return ${env:hestiaKERNEL_ERROR_ENTITY_MISSING} + } + + if ($(hestiaSTRING-Is-Empty "${___source}") -eq ${env:hestiaKERNEL_ERROR_OK}) { + return ${env:hestiaKERNEL_ERROR_IS_EMPTY} + } + + if ($(hestiaTAR-Is-Available) -ne ${env:hestiaKERNEL_ERROR_OK}) { + return ${env:hestiaKERNEL_ERROR_NOT_POSSIBLE} + } + + if ($(hestiaFS-Is-Exist "${___destination}") -eq ${env:hestiaKERNEL_ERROR_OK}) { + return ${env:hestiaKERNEL_ERROR_ENTITY_EXISTS} + } + + if ($(hestiaFS-Is-Directory "${___destination}") -eq ${env:hestiaKERNEL_ERROR_OK}) { + return ${env:hestiaKERNEL_ERROR_ENTITY_IS_NOT_FILE} + } + + if ($(hestiaFS-Is-Directory "${___source}") -ne ${env:hestiaKERNEL_ERROR_OK}) { + return ${env:hestiaKERNEL_ERROR_DATA_INVALID} + } + + if ($(hestiaFS-Is-Directory-Empty "${___source}") -eq ${env:hestiaKERNEL_ERROR_OK}) { + return ${env:hestiaKERNEL_ERROR_DATA_EMPTY} + } + + + # execute + if ($($___destination -replace '\.txz$') -ne $___destination) { + $___dest = $___destination -replace '\.txz$', '' + } elseif ($($___destination -replace '\.tgz$') -ne $___destination) { + $___dest = $___destination -replace '\.tgz$', '' + } else { + $___dest = $___destination -replace '\.tar.*$', '' + } + $___dest = "${___dest}.tar" + + if ($(hestiaFS-Get-Directory "${___destination}") -ne "${___destination}") { + $null = hestiaFS-Create-Directory "$(hestiaFS-Get-Directory "${___destination}")" + } + + + # archive to tar + # IMPORTANT: to prevent CVE-2022-21675 from happening, hestiaTAR shall + # change directory explictly into the archive root directory + # and form the relative pathings. + $___current_path = Get-Location + $null = Set-Location "${___source}" + + ## NOTE: Currently, windows' TAR does not support UNIX UGID system and + ## there isn't a way to determine yet. + $___supported = $false + if ( + ($___supported) -and + ($(hestiaSTRING-Is-Empty "${___owner}" -ne 0)) -and + ($(hestiaSTRING-Is-Empty "${___group}" -ne 0)) + ) { + $___process = hestiaOS-Exec "tar" @" +--numeric-owner --group=`"${___group}`" --owner=`"${___owner}`" " -cvf `"${___dest}`" . +"@ + } else { + $___process = hestiaOS-Exec "tar" "-cvf `"${___dest}`" ." + } + + $null = Set-Location "${___current_path}" + $null = Remove-Variable -name ___current_path + + if ($___process -ne ${env:hestiaKERNEL_ERROR_OK}) { + $null = hestiaFS-Remove "${___dest}" + return ${env:hestiaKERNEL_ERROR_BAD_EXEC} + } + + + # handles compression + switch ("${___compression}") { + { $_ -in "xz", "XZ" } { + $___process = hestiaXZ-Compress "${___dest}" + $___dest = "${___dest}.xz" + } { $_ -in "gz", "GZ" } { + $___process = hestiaGZ-Compress "${___dest}" + $___dest = "${___dest}.gz" + } default { + $___process = ${env:hestiaKERNEL_ERROR_OK} + }} + + if ($___process -ne ${env:hestiaKERNEL_ERROR_OK}) { + $null = hestiaFS-Remove "${___dest}" + return ${env:hestiaKERNEL_ERROR_BAD_EXEC} + } + + + # export to non-standard naming convention's destination + if ($___dest -ne $___destination) { + $___process = hestiaFS-Move "${___dest}" "${___destination}" + if ($___process -ne ${env:hestiaKERNEL_ERROR_OK}) { + $null = hestiaFS-Remove "${___dest}" + 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}/hestiaFS/Vanilla.sh.ps1" +. "${LIBS_HESTIA}/hestiaGZ/Compress.sh.ps1" +. "${LIBS_HESTIA}/hestiaKERNEL/Vanilla.sh.ps1" +. "${LIBS_HESTIA}/hestiaSTRING/Is_Empty.sh.ps1" +. "${LIBS_HESTIA}/hestiaTAR/Is_Available.sh.ps1" +. "${LIBS_HESTIA}/hestiaOS/Vanilla.sh.ps1" +. "${LIBS_HESTIA}/hestiaXZ/Compress.sh.ps1" + + + + +hestiaTAR_Pack() { + ___destination="$1" + ___source="$2" + ___compression="$3" + ___owner="$4" + ___group="$5" + + + # validate input + if [ $(hestiaSTRING_Is_Empty "$___destination") -eq $hestiaKERNEL_ERROR_OK ]; then + return $hestiaKERNEL_ERROR_ENTITY_MISSING + fi + + if [ $(hestiaSTRING_Is_Empty "${___source}") -eq $hestiaKERNEL_ERROR_OK ]; then + return $hestiaKERNEL_ERROR_IS_EMPTY + fi + + if [ $(hestiaTAR_Is_Available) -ne $hestiaKERNEL_ERROR_OK ]; then + return $hestiaKERNEL_ERROR_NOT_POSSIBLE + fi + + if [ $(hestiaFS_Is_Exist "$___destination") -eq $hestiaKERNEL_ERROR_OK ]; then + return $hestiaKERNEL_ERROR_ENTITY_EXISTS + fi + + if [ $(hestiaFS_Is_Directory "${___destination}") -eq $hestiaKERNEL_ERROR_OK ]; then + return $hestiaKERNEL_ERROR_ENTITY_IS_NOT_FILE + fi + + if [ $(hestiaFS_Is_Directory "${___source}") -ne $hestiaKERNEL_ERROR_OK ]; then + return $hestiaKERNEL_ERROR_DATA_INVALID + fi + + if [ $(hestiaFS_Is_Directory_Empty "${___source}") -eq $hestiaKERNEL_ERROR_OK ]; then + return $hestiaKERNEL_ERROR_DATA_EMPTY + fi + + + # execute + if [ ! "${___destination%%.txz*}" = "$___destination" ]; then + ___dest="${___destination%%.txz*}" + elif [ ! "${___destination%%.tgz*}" = "$___destination" ]; then + ___dest="${___destination%%.tgz*}" + else + ___dest="${___destination%%.tar*}" + fi + ___dest="${___dest}.tar" + + if [ ! "$(hestiaFS_Get_Directory "$___destination")" = "$___destination" ]; then + hestiaFS_Create_Directory "$(hestiaFS_Get_Directory "$___destination")" + fi + + + # archive to tar + # IMPORTANT: to prevent CVE-2022-21675 from happening, hestiaTAR shall + # change directory explictly into the archive root directory + # and form the relative pathings. + ___current_path="$PWD" + cd "$___source" + + if [ $(hestiaSTRING_Is_Empty "$___group") -ne $hestiaKERNEL_ERROR_OK ] && + [ $(hestiaSTRING_Is_Empty "$___group") -ne $hestiaKERNEL_ERROR_OK ]; then + tar --numeric-owner --group "$___group" --owner "$___owner" -cvf "$___dest" "." + ___process=$? + else + tar -cvf "$___dest" "." + ___process=$? + fi + + cd "$___current_path" + unset ___current_path + + if [ $___process -ne $hestiaKERNEL_ERROR_OK ]; then + hestiaFS_Remove "$___dest" + return $hestiaKERNEL_ERROR_OK + fi + + + # handles compression + case "$___compression" in + xz|XZ) + hestiaXZ_Compress "$___dest" + ___process=$? + ___dest="${___dest}.xz" + ;; + gz|GZ) + hestiaGZ_Compress "$___dest" + ___process=$? + ___dest="${___dest}.gz" + ;; + *) + ___process=$hestiaKERNEL_ERROR_OK + ;; + esac + + if [ $___process -ne $hestiaKERNEL_ERROR_OK ]; then + hestiaFS_Remove "$___dest" + return $hestiaKERNEL_ERROR_OK + fi + + + # export to non-standard naming convention's destination + if [ ! "$___dest" = "$___destination" ]; then + hestiaFS_Move "$___destination" "$___dest" + if [ $? -ne $hestiaKERNEL_ERROR_OK ]; then + hestiaFS_Remove "$___dest" + return $hestiaKERNEL_ERROR_BAD_EXEC + fi + fi + + + # report status + return $hestiaKERNEL_ERROR_OK +} +################################################################################ +# Unix Main Codes # +################################################################################ +return 0 +#> diff --git a/automataCI/services/hestiaTAR/Unpack.sh.ps1 b/automataCI/services/hestiaTAR/Unpack.sh.ps1 new file mode 100644 index 0000000..6d6caa1 --- /dev/null +++ b/automataCI/services/hestiaTAR/Unpack.sh.ps1 @@ -0,0 +1,187 @@ +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\Vanilla.sh.ps1" +. "${env:LIBS_HESTIA}\hestiaKERNEL\Vanilla.sh.ps1" +. "${env:LIBS_HESTIA}\hestiaSTRING\Is_Empty.sh.ps1" +. "${env:LIBS_HESTIA}\hestiaTAR\Is_Available.sh.ps1" + + + + +function hestiaTAR-Unpack { + param ( + [string]$___destination, + [string]$___source, + [string]$___compression + ) + + + # validate input + if ($(hestiaSTRING-Is-Empty "${___destination}") -eq ${env:hestiaKERNEL_ERROR_OK}) { + return ${env:hestiaKERNEL_ERROR_ENTITY_MISSING} + } + + if ($(hestiaSTRING-Is-Empty "${___source}") -eq ${env:hestiaKERNEL_ERROR_OK}) { + return ${env:hestiaKERNEL_ERROR_IS_EMPTY} + } + + if ($(hestiaFS-Is-Exist "${___destination}") -eq ${env:hestiaKERNEL_ERROR_OK}) { + if ($(hestiaFS-Is-Directory "${___destination}") -ne ${env:hestiaKERNEL_ERROR_OK}) { + return ${env:hestiaKERNEL_ERROR_ENTITY_IS_NOT_DIRECTORY} + } + } + + if ($(hestiaTAR-Is-Command-Available) -ne ${env:hestiaKERNEL_ERROR_OK}) { + return ${env:hestiaKERNEL_ERROR_NOT_POSSIBLE} + } + + if ($(hestiaFS-Is-File "${___source}") -ne ${env:hestiaKERNEL_ERROR_OK}) { + return ${env:hestiaKERNEL_ERROR_DATA_INVALID} + } + + if ($(hestiaFS-Is-Directory-Empty "${___destination}") -ne ${env:hestiaKERNEL_ERROR_OK}) { + return ${env:hestiaKERNEL_ERROR_DATA_EMPTY} + } + + + # execute + $null = hestiaFS-Create-Directory "${___destination}" + switch ("${___compression}") { + { $_ -in "xz", "XZ" } { + $___process = hestiaOS-Exec "tar" @" +-C `"${___destination}`" -xf `"${___source}`" +"@ + } { $_ -in "gz", "GZ" } { + $___process = hestiaOS-Exec "tar" @" +-C `"${___destination}`" -xzf `"${___source}`" +"@ + } default { + $___process = hestiaOS-Exec "tar" @" +-C `"${___destination}`" -xf `"${___source}`" +"@ + }} + + 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}/hestiaFS/Vanilla.sh.ps1" +. "${LIBS_HESTIA}/hestiaSTRING/Is_Empty.sh.ps1" +. "${LIBS_HESTIA}/hestiaTAR/Is_Available.sh.ps1" + + + + +hestiaTAR_Unpack() { + ___destination="$1" + ___source="$2" + ___compression="$3" + + + # validate input + if [ $(hestiaSTRING_Is_Empty "$___destination") -eq $hestiaKERNEL_ERROR_OK ]; then + return $hestiaKERNEL_ERROR_ENTITY_MISSING + fi + + if [ $(hestiaSTRING_Is_Empty "$___source") -eq $hestiaKERNEL_ERROR_OK ]; then + return $hestiaKERNEL_ERROR_IS_EMPTY + fi + + hestiaTAR_Is_Available + if [ $? -ne 0 ]; then + return $hestiaKERNEL_ERROR_NOT_POSSIBLE + fi + + if [ $(hestiaFS_Is_File "$___source") -ne $hestiaKERNEL_ERROR_OK ]; then + return $hestiaKERNEL_ERROR_DATA_IS_NOT_FILE + fi + + if [ $(hestiaFS_Is_Directory "$___destination") -ne $hestiaKERNEL_ERROR_OK ]; then + return $hestiaKERNEL_ERROR_ENTITY_IS_NOT_DIRECTORY + fi + + if [ $(hestiaFS_Is_Directory_Empty "$___destination") -ne $hestiaKERNEL_ERROR_OK ]; then + return $hestiaKERNEL_ERROR_DATA_EMPTY + fi + + + # execute + FS_Make_Directory "$___destination" + case "$___compression" in + xz|XZ) + tar -C "$___destination" -xf "$___source" + ___process=$? + ;; + gz|GZ) + tar -C "$___destination" -xzf "$___source" + ___process=$? + ;; + *) + tar -C "$___destination" -xf "$___source" + ___process=$? + ;; + esac + + 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/hestiaTAR/Vanilla.sh.ps1 b/automataCI/services/hestiaTAR/Vanilla.sh.ps1 new file mode 100644 index 0000000..98b7ed3 --- /dev/null +++ b/automataCI/services/hestiaTAR/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}\hestiaTAR\Is_Available.sh.ps1" +. "${env:LIBS_HESTIA}\hestiaTAR\Is_Target_Valid.sh.ps1" +. "${env:LIBS_HESTIA}\hestiaTAR\Pack.sh.ps1" +. "${env:LIBS_HESTIA}\hestiaTAR\Unpack.sh.ps1" +################################################################################ +# Windows POWERSHELL Codes # +################################################################################ +return +<# +RUN_AS_POWERSHELL + + + + +################################################################################ +# Unix Main Codes # +################################################################################ +. "${LIBS_HESTIA}/hestiaTAR/Is_Available.sh.ps1" +. "${LIBS_HESTIA}/hestiaTAR/Is_Target_Valid.sh.ps1" +. "${LIBS_HESTIA}/hestiaTAR/Pack.sh.ps1" +. "${LIBS_HESTIA}/hestiaTAR/Unpack.sh.ps1" +################################################################################ +# Unix Main Codes # +################################################################################ +return 0 +#> diff --git a/automataCI/services/hestiaTIME/Format_Date_ISO8601.sh.ps1 b/automataCI/services/hestiaTIME/Format_Date_ISO8601.sh.ps1 new file mode 100644 index 0000000..9ef118c --- /dev/null +++ b/automataCI/services/hestiaTIME/Format_Date_ISO8601.sh.ps1 @@ -0,0 +1,107 @@ +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" + + + + +function hestiaTIME-Format-Date-ISO8601 { + param( + [string]$___unix_epoch + ) + + + # validate input + if ($(hestiaSTRING-Is-Empty "${___unix_epoch}") -eq ${env:hestiaKERNEL_ERROR_OK}) { + return "" + } + + + # execute + $___t = (Get-Date "1970-01-01 00:00:00.000Z") + ([TimeSpan]::FromSeconds($___unix_epoch)) + return $___t.ToString("yyyy-MM-dd") +} +################################################################################ +# Windows POWERSHELL Codes # +################################################################################ +return +<# +RUN_AS_POWERSHELL + + + + +################################################################################ +# Unix Main Codes # +################################################################################ +. "${LIBS_HESTIA}/hestiaKERNEL/Vanilla.sh.ps1" +. "${LIBS_HESTIA}/hestiaSTRING/Is_Empty.sh.ps1" +. "${LIBS_HESTIA}/hestiaTIME/Is_Available.sh.ps1" + + + + +hestiaTIME_Format_Date_ISO8601() { + #___unix_epoch="$1" + + + # validate input + if [ $(hestiaSTRING_Is_Empty "$1") -eq $hestiaKERNEL_ERROR_OK ]; then + printf -- "" + return $hestiaKERNEL_ERROR_DATA_EMPTY + fi + + if [ $(hestiaTIME_Is_Available) -ne $hestiaKERNEL_ERROR_OK ]; then + printf -- "" + return $hestiaKERNEL_ERROR_NOT_POSSIBLE + fi + + + # execute + if [ "$(echo "$(uname)" | tr '[:upper:]' '[:lower:]')" = "darwin" ]; then + printf -- "%b" "$(date -j -f "%s" "${1}" +"%Y-%m-%d")" + else + printf -- "%b" "$(date --date="@${1}" +"%Y-%m-%d")" + fi + + + # report status + return $hestiaKERNEL_ERROR_OK +} +################################################################################ +# Unix Main Codes # +################################################################################ +return 0 +#> diff --git a/automataCI/services/hestiaTIME/Format_Date_RPM.sh.ps1 b/automataCI/services/hestiaTIME/Format_Date_RPM.sh.ps1 new file mode 100644 index 0000000..d2eed5d --- /dev/null +++ b/automataCI/services/hestiaTIME/Format_Date_RPM.sh.ps1 @@ -0,0 +1,107 @@ +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" + + + + +function hestiaTIME-Format-Date-RPM { + param ( + [string]$___unix_epoch + ) + + + # validate input + if ($(hestiaSTRING-Is-Empty "${___unix_epoch}") -eq ${env:hestiaKERNEL_ERROR_OK}) { + return "" + } + + + # execute + $___t = (Get-Date "1970-01-01 00:00:00.000Z") + ([TimeSpan]::FromSeconds($___unix_epoch)) + return $___t.ToString("ddd MMM dd yyyy") +} +################################################################################ +# Windows POWERSHELL Codes # +################################################################################ +return +<# +RUN_AS_POWERSHELL + + + + +################################################################################ +# Unix Main Codes # +################################################################################ +. "${LIBS_HESTIA}/hestiaKERNEL/Vanilla.sh.ps1" +. "${LIBS_HESTIA}/hestiaSTRING/Is_Empty.sh.ps1" +. "${LIBS_HESTIA}/hestiaTIME/Is_Available.sh.ps1" + + + + +hestiaTIME_Format_Date_RPM() { + #___unix_epoch="$1" + + + # validate input + if [ $(hestiaSTRING_Is_Empty "$1") -eq $hestiaKERNEL_ERROR_OK ]; then + printf -- "" + return $hestiaKERNEL_ERROR_DATA_EMPTY + fi + + if [ $(hestiaTIME_Is_Available) -ne $hestiaKERNEL_ERROR_OK ]; then + printf -- "" + return $hestiaKERNEL_ERROR_NOT_POSSIBLE + fi + + + # execute + if [ "$(echo "$(uname)" | tr '[:upper:]' '[:lower:]')" = "darwin" ]; then + printf -- "%b" "$(date -j -f "%s" "${1}" +"%a %b %d %Y")" + else + printf -- "%b" "$(date --date="@${1}" +"%a %b %d %Y")" + fi + + + # report status + return $hestiaKERNEL_ERROR_OK +} +################################################################################ +# Unix Main Codes # +################################################################################ +return 0 +#> diff --git a/automataCI/services/hestiaTIME/Format_Datetime_RFC5322.sh.ps1 b/automataCI/services/hestiaTIME/Format_Datetime_RFC5322.sh.ps1 new file mode 100644 index 0000000..8f9730e --- /dev/null +++ b/automataCI/services/hestiaTIME/Format_Datetime_RFC5322.sh.ps1 @@ -0,0 +1,107 @@ +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" + + + + +function hestiaTIME-Format-Datetime-RFC5322 { + param ( + [string]$___unix_epoch + ) + + + # validate input + if ($(hestiaSTRING-Is-Empty "${___unix_epoch}") -eq ${env:hestiaKERNEL_ERROR_OK}) { + return "" + } + + + # execute + $___t = (Get-Date "1970-01-01 00:00:00.000Z") + ([TimeSpan]::FromSeconds($___unix_epoch)) + return $___t.ToString("ddd, dd MMM YYYY HH:mm:ss zzz") +} +################################################################################ +# Windows POWERSHELL Codes # +################################################################################ +return +<# +RUN_AS_POWERSHELL + + + + +################################################################################ +# Unix Main Codes # +################################################################################ +. "${LIBS_HESTIA}/hestiaKERNEL/Vanilla.sh.ps1" +. "${LIBS_HESTIA}/hestiaSTRING/Is_Empty.sh.ps1" +. "${LIBS_HESTIA}/hestiaTIME/Is_Available.sh.ps1" + + + + +hestiaTIME_Format_Datetime_RFC5322() { + #___unix_epoch="$1" + + + # validate input + if [ $(hestiaSTRING_Is_Empty "$1") -eq $hestiaKERNEL_ERROR_OK ]; then + printf -- "" + return $hestiaKERNEL_ERROR_DATA_EMPTY + fi + + if [ $(hestiaTIME_Is_Available) -ne $hestiaKERNEL_ERROR_OK ]; then + printf -- "" + return $hestiaKERNEL_ERROR_NOT_POSSIBLE + fi + + + # execute + if [ "$(echo "$(uname)" | tr '[:upper:]' '[:lower:]')" = "darwin" ]; then + printf -- "%b" "$(date -j -f "%s" "${1}" +"%a, %d %b %Y %H:%M:%S %z")" + else + printf -- "%b" "$(date --date="@${1}" +"%a, %d %b %Y %H:%M:%S %z")" + fi + + + # report status + return $hestiaKERNEL_ERROR_OK +} +################################################################################ +# Unix Main Codes # +################################################################################ +return 0 +#> diff --git a/automataCI/services/hestiaTIME/Format_Datetime_RFC5322_UTC.sh.ps1 b/automataCI/services/hestiaTIME/Format_Datetime_RFC5322_UTC.sh.ps1 new file mode 100644 index 0000000..32b0039 --- /dev/null +++ b/automataCI/services/hestiaTIME/Format_Datetime_RFC5322_UTC.sh.ps1 @@ -0,0 +1,107 @@ +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" + + + + +function hestiaTIME-Format-Datetime-RFC5322-UTC { + param ( + [string]$___unix_epoch + ) + + + # validate input + if ($(hestiaSTRING-Is-Empty "${___unix_epoch}") -eq ${env:hestiaKERNEL_ERROR_OK}) { + return "" + } + + + # execute + $___t = (Get-Date "1970-01-01 00:00:00.000Z") + ([TimeSpan]::FromSeconds($___unix_epoch)) + return $___t.ToUniversalTime().ToString("ddd, dd MMM YYYY HH:mm:ss zzz") +} +################################################################################ +# Windows POWERSHELL Codes # +################################################################################ +return +<# +RUN_AS_POWERSHELL + + + + +################################################################################ +# Unix Main Codes # +################################################################################ +. "${LIBS_HESTIA}/hestiaKERNEL/Vanilla.sh.ps1" +. "${LIBS_HESTIA}/hestiaSTRING/Is_Empty.sh.ps1" +. "${LIBS_HESTIA}/hestiaTIME/Is_Available.sh.ps1" + + + + +hestiaTIME_Format_Datetime_RFC5322_UTC() { + #___unix_epoch="$1" + + + # validate input + if [ $(hestiaSTRING_Is_Empty "$1") -eq $hestiaKERNEL_ERROR_OK ]; then + printf -- "" + return $hestiaKERNEL_ERROR_DATA_EMPTY + fi + + if [ $(hestiaTIME_Is_Available) -ne $hestiaKERNEL_ERROR_OK ]; then + printf -- "" + return $hestiaKERNEL_ERROR_NOT_POSSIBLE + fi + + + # execute + if [ "$(echo "$(uname)" | tr '[:upper:]' '[:lower:]')" = "darwin" ]; then + printf -- "%b" "$(date -u -j -f "%s" "${1}" +"%a, %d %b %Y %H:%M:%S %z")" + else + printf -- "%b" "$(date -u --date="@${1}" +"%a, %d %b %Y %H:%M:%S %z")" + fi + + + # report status + return $hestiaKERNEL_ERROR_OK +} +################################################################################ +# Unix Main Codes # +################################################################################ +return 0 +#> diff --git a/automataCI/services/hestiaTIME/Is_Available.sh.ps1 b/automataCI/services/hestiaTIME/Is_Available.sh.ps1 new file mode 100644 index 0000000..a0e992c --- /dev/null +++ b/automataCI/services/hestiaTIME/Is_Available.sh.ps1 @@ -0,0 +1,73 @@ +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 hestiaTIME-Is-Available { + return 0 +} +################################################################################ +# Windows POWERSHELL Codes # +################################################################################ +return +<# +RUN_AS_POWERSHELL + + + + +################################################################################ +# Unix Main Codes # +################################################################################ +. "${LIBS_HESTIA}/hestiaKERNEL/Vanilla.sh.ps1" +. "${LIBS_HESTIA}/hestiaOS/Is_Command_Available.sh.ps1" + + + + +hestiaTIME_Is_Available() { + # execute + if [ $(hestiaOS_Is_Command_Available "date") -ne $hestiaKERNEL_ERROR_OK ]; then + printf -- "%d" "$hestiaKERNEL_ERROR_NOT_POSSIBLE" + return $hestiaKERNEL_ERROR_NOT_POSSIBLE + fi + + + # report status + printf -- "%d" "$hestiaKERNEL_ERROR_OK" + return $hestiaKERNEL_ERROR_OK +} +################################################################################ +# Unix Main Codes # +################################################################################ +return 0 +#> diff --git a/automataCI/services/hestiaTIME/Now.sh.ps1 b/automataCI/services/hestiaTIME/Now.sh.ps1 new file mode 100644 index 0000000..9457fc6 --- /dev/null +++ b/automataCI/services/hestiaTIME/Now.sh.ps1 @@ -0,0 +1,76 @@ +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 hestiaTIME-Now { + return Get-Date (Get-Date).ToUniversalTime() -UFormat %s +} +################################################################################ +# Windows POWERSHELL Codes # +################################################################################ +return +<# +RUN_AS_POWERSHELL + + + + +################################################################################ +# Unix Main Codes # +################################################################################ +. "${LIBS_HESTIA}/hestiaKERNEL/Vanilla.sh.ps1" +. "${LIBS_HESTIA}/hestiaTIME/Is_Available.sh.ps1" + + + + +hestiaTIME_Now() { + # validate input + hestiaTIME_Is_Available + if [ $? -ne $hestiaKERNEL_ERROR_OK ]; then + return $hestiaKERNEL_ERROR_NOT_POSSIBLE + fi + + + # execute + printf -- "%b" "$(date -u '+%s')" + + + # report status + return $hestiaKERNEL_ERROR_OK +} +################################################################################ +# Unix Main Codes # +################################################################################ +return 0 +#> diff --git a/automataCI/services/hestiaTIME/Vanilla.sh.ps1 b/automataCI/services/hestiaTIME/Vanilla.sh.ps1 new file mode 100644 index 0000000..def94a2 --- /dev/null +++ b/automataCI/services/hestiaTIME/Vanilla.sh.ps1 @@ -0,0 +1,64 @@ +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}\hestiaTIME\Format_Date_ISO8601.sh.ps1" +. "${env:LIBS_HESTIA}\hestiaTIME\Format_Date_RPM.sh.ps1" +. "${env:LIBS_HESTIA}\hestiaTIME\Format_Datetime_RFC5322.sh.ps1" +. "${env:LIBS_HESTIA}\hestiaTIME\Format_Datetime_RFC5322_UTC.sh.ps1" +. "${env:LIBS_HESTIA}\hestiaTIME\Is_Available.sh.ps1" +. "${env:LIBS_HESTIA}\hestiaTIME\Now.sh.ps1" +################################################################################ +# Windows POWERSHELL Codes # +################################################################################ +return +<# +RUN_AS_POWERSHELL + + + + +################################################################################ +# Unix Main Codes # +################################################################################ +. "${LIBS_HESTIA}/hestiaTIME/Format_Date_ISO8601.sh.ps1" +. "${LIBS_HESTIA}/hestiaTIME/Format_Date_RPM.sh.ps1" +. "${LIBS_HESTIA}/hestiaTIME/Format_Datetime_RFC5322.sh.ps1" +. "${LIBS_HESTIA}/hestiaTIME/Format_Datetime_RFC5322_UTC.sh.ps1" +. "${LIBS_HESTIA}/hestiaTIME/Is_Available.sh.ps1" +. "${LIBS_HESTIA}/hestiaTIME/Now.sh.ps1" +################################################################################ +# Unix Main Codes # +################################################################################ +return 0 +#> diff --git a/automataCI/services/hestiaWASM/Is_Target_Valid.sh.ps1 b/automataCI/services/hestiaWASM/Is_Target_Valid.sh.ps1 new file mode 100644 index 0000000..6a3fa20 --- /dev/null +++ b/automataCI/services/hestiaWASM/Is_Target_Valid.sh.ps1 @@ -0,0 +1,115 @@ +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\Get_File.sh.ps1" +. "${env:LIBS_HESTIA}\hestiaSTRING\Is_Empty.sh.ps1" + + + + +function hestiaWASM-Is-Target-Valid { + param ( + [string]$___target + ) + + + # validate input + if ($(hestiaSTRING-Is-Empty "${___target}") -eq ${env:hestiaKERNEL_ERROR_OK}) { + return ${env:hestiaKERNEL_ERROR_DATA_MISSING} + } + + + # execute + $___target = hestiaFS-Get-File "${___target}" + if ( + ($("${___target}" -replace '.*-wasm.*', '') -ne "${___file_subject}") -or + ($("${___subject}" -replace '.*\.wasm$', '') -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/Get_File.sh.ps1" +. "${LIBS_HESTIA}/hestiaSTRING/Is_Empty.sh.ps1" + + + + +hestiaWASM_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 + ___target="$(FS_Get_File "$1")" + if [ ! "${___target##*-wasm}" = "$___target" ] || + [ ! "${___target%%.wasm*}" = "$___target" ]; 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/hestiaWASM/Is_Target_Valid_JS.sh.ps1 b/automataCI/services/hestiaWASM/Is_Target_Valid_JS.sh.ps1 new file mode 100644 index 0000000..5d8bcb8 --- /dev/null +++ b/automataCI/services/hestiaWASM/Is_Target_Valid_JS.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\Get_File.sh.ps1" +. "${env:LIBS_HESTIA}\hestiaSTRING\Is_Empty.sh.ps1" +. "${env:LIBS_HESTIA}\hestiaWASM\Is_Target_Valid.sh.ps1" + + + + +function hestiaWASM-Is-Target-Valid-JS { + param ( + [string]$___target + ) + + + # validate input + if ($(hestiaSTRING-Is-Empty "${___target}") -eq ${env:hestiaKERNEL_ERROR_OK}) { + return ${env:hestiaKERNEL_ERROR_DATA_MISSING} + } + + if ($(hestiaWASM-Is-Target-Valid "${___target}") -eq ${env:hestiaKERNEL_ERROR_OK}) { + return ${env:hestiaKERNEL_ERROR_DATA_INVALID} + } + + + # execute + $___target = hestiaFS-Get-File "${___target}" + if ($("${___target}" -replace '.*\.js$', '') -ne "${___target}") { + 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/Get_File.sh.ps1" +. "${LIBS_HESTIA}/hestiaSTRING/Is_Empty.sh.ps1" +. "${LIBS_HESTIA}/hestiaWASM/Is_Target_Valid.sh.ps1" + + + + +hestiaWASM_Is_Target_Valid_JS() { + #___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 + + if [ $(hestiaWASM_Is_Target_Valid "$1") -eq $hestiaKERNEL_ERROR_OK ]; then + printf -- "%d" $hestiaKERNEL_ERROR_DATA_INVALID + return $hestiaKERNEL_ERROR_DATA_INVALID + fi + + + # execute + ___target="$(FS_Get_File "$1")" + if [ ! "${___target%%.js*}" = "$___target" ]; 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/hestiaWASM/Vanilla.sh.ps1 b/automataCI/services/hestiaWASM/Vanilla.sh.ps1 new file mode 100644 index 0000000..f1e596d --- /dev/null +++ b/automataCI/services/hestiaWASM/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}\hestiaWASM\Is_Target_Valid.sh.ps1" +. "${env:LIBS_HESTIA}\hestiaWASM\Is_Target_Valid_JS.sh.ps1" +################################################################################ +# Windows POWERSHELL Codes # +################################################################################ +return +<# +RUN_AS_POWERSHELL + + + + +################################################################################ +# Unix Main Codes # +################################################################################ +. "${LIBS_HESTIA}/hestiaWASM/Is_Target_Valid.sh.ps1" +. "${LIBS_HESTIA}/hestiaWASM/Is_Target_Valid_JS.sh.ps1" +################################################################################ +# Unix Main Codes # +################################################################################ +return 0 +#> diff --git a/automataCI/services/hestiaXZ/Compress.sh.ps1 b/automataCI/services/hestiaXZ/Compress.sh.ps1 new file mode 100644 index 0000000..7e3fc5a --- /dev/null +++ b/automataCI/services/hestiaXZ/Compress.sh.ps1 @@ -0,0 +1,128 @@ +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\Is_File.sh.ps1" +. "${env:LIBS_HESTIA}\hestiaKERNEL\Vanilla.sh.ps1" +. "${env:LIBS_HESTIA}\hestiaOS\Vanilla.sh.ps1" +. "${env:LIBS_HESTIA}\hestiaSTRING\Is_Empty.sh.ps1" + + + + +function hestiaXZ-Compress { + param ( + [string]$___source + ) + + + # validate input + if ($(hestiaSTRING-Is-Empty "${___source}") -eq ${env:hestiaKERNEL_ERROR_OK}) { + return ${env:hestiaKERNEL_ERROR_DATA_MISSING} + } + + if ($(hestiaFS-Is-File "${___source}") -eq ${env:hestiaKERNEL_ERROR_OK}) { + return ${env:hestiaKERNEL_ERROR_DATA_IS_NOT_FILE} + } + + + # execute + $___source = $___source -replace "\.xz$" + if ($(hestiaOS-Is-Command-Available "xz") -eq ${env:hestiaKERNEL_ERROR_OK}) { + $___process = hestiaOS-Exec "xz" "-9 --compress `"${___source}`"" + if ($___process -ne ${env:hestiaKERNEL_ERROR_OK}) { + return ${env:hestiaKERNEL_ERROR_BAD_EXEC} + } + + return ${env:hestiaKERNEL_ERROR_OK} + } + + + # report status + return ${env:hestiaKERNEL_ERROR_BAD_EXEC} +} +################################################################################ +# Windows POWERSHELL Codes # +################################################################################ +return +<# +RUN_AS_POWERSHELL + + + + +################################################################################ +# Unix Main Codes # +################################################################################ +. "${LIBS_HESTIA}/hestiaKERNEL/Vanilla.sh.ps1" +. "${LIBS_HESTIA}/hestiaFS/Is_File.sh.ps1" +. "${LIBS_HESTIA}/hestiaSTRING/Is_Empty.sh.ps1" +. "${LIBS_HESTIA}/hestiaOS/Is_Command_Available.sh.ps1" + + + + +hestiaXZ_Compress() { + #___source="$1" + + + # validate input + if [ $(hestiaSTRING_Is_Empty "$1") -eq $hestiaKERNEL_ERROR_OK ]; then + return $hestiaKERNEL_ERROR_DATA_MISSING + fi + + if [ $(hestiaFS_Is_File "$1") -ne $hestiaKERNEL_ERROR_OK ]; then + return $hestiaKERNEL_ERROR_DATA_IS_NOT_FILE + fi + + + # execute + ___source="${1%.xz*}" + if [ $(hestiaOS_Is_Command_Available "xz") -eq $hestiaKERNEL_ERROR_OK ]; then + xz -9 --compress "$___source" + if [ $? -ne 0 ]; then + return $hestiaKERNEL_ERROR_BAD_EXEC + fi + + return $hestiaKERNEL_ERROR_OK + fi + + + # report status + return $hestiaKERNEL_ERROR_BAD_EXEC +} +################################################################################ +# Unix Main Codes # +################################################################################ +return 0 +#> diff --git a/automataCI/services/hestiaXZ/Deflate.sh.ps1 b/automataCI/services/hestiaXZ/Deflate.sh.ps1 new file mode 100644 index 0000000..7b23159 --- /dev/null +++ b/automataCI/services/hestiaXZ/Deflate.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}\hestiaOS\Vanilla.sh.ps1" +. "${env:LIBS_HESTIA}\hestiaSTRING\Is_Empty.sh.ps1" +. "${env:LIBS_HESTIA}\hestiaXZ\Is_Target_Valid.sh.ps1" + + + + +function hestiaXZ-Deflate { + param ( + [string]$___source + ) + + + # validate input + if ($(hestiaSTRING-Is-Empty "${___source}") -eq ${env:hestiaKERNEL_ERROR_OK}) { + return ${env:hestiaKERNEL_ERROR_DATA_MISSING} + } + + if ($(hestiaXZ-Is-Target-Valid "${___source}") -eq ${env:hestiaKERNEL_ERROR_OK}) { + return ${env:hestiaKERNEL_ERROR_DATA_INVALID} + } + + + # execute + if ($(hestiaOS-Is-Command-Available "xz") -eq ${env:hestiaKERNEL_ERROR_OK}) { + $___process = hestiaOS-Exec "xz" "--decompress `"${___source}`"" + if ($___process -ne ${env:hestiaKERNEL_ERROR_OK}) { + return ${env:hestiaKERNEL_ERROR_BAD_EXEC} + } + + return ${env:hestiaKERNEL_ERROR_OK} + } + + + # report status + return ${env:hestiaKERNEL_ERROR_BAD_EXEC} +} +################################################################################ +# Windows POWERSHELL Codes # +################################################################################ +return +<# +RUN_AS_POWERSHELL + + + + +################################################################################ +# Unix Main Codes # +################################################################################ +. "${LIBS_HESTIA}/hestiaKERNEL/Vanilla.sh.ps1" +. "${LIBS_HESTIA}/hestiaOS/Is_Command_Available.sh.ps1" +. "${LIBS_HESTIA}/hestiaSTRING/Is_Empty.sh.ps1" +. "${LIBS_HESTIA}/hestiaXZ/Is_Target_Valid.sh.ps1" + + + + +hestiaXZ_Deflate() { + #___source="$1" + + + # validate input + if [ $(hestiaSTRING_Is_Empty "$1") -eq $hestiaKERNEL_ERROR_OK ]; then + return $hestiaKERNEL_ERROR_DATA_MISSING + fi + + if [ $(hestiaXZ_Is_Target_Valid "$1") -ne $hestiaKERNEL_ERROR_OK ]; then + return $hestiaKERNEL_ERROR_DATA_INVALID + fi + + + # execute + if [ $(hestiaOS_Is_Command_Available "xz") -eq $hestiaKERNEL_ERROR_OK ]; then + xz --decompress "$1" + if [ $? -ne $hestiaKERNEL_ERROR_OK ]; then + return $hestiaKERNEL_ERROR_BAD_EXEC + fi + + return $hestiaKERNEL_ERROR_OK + fi + + + # report status + return $hestiaKERNEL_ERROR_BAD_EXEC +} +################################################################################ +# Unix Main Codes # +################################################################################ +return 0 +#> diff --git a/automataCI/services/hestiaXZ/Is_Available.sh.ps1 b/automataCI/services/hestiaXZ/Is_Available.sh.ps1 new file mode 100644 index 0000000..9912abf --- /dev/null +++ b/automataCI/services/hestiaXZ/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" +. "${env:LIBS_HESTIA}\hestiaOS\Is_Command_Available.sh.ps1" + + + + +function hestiaXZ-Is-Available { + # execute + if ($(hestiaOS-Is-Command-Available "xz") -eq ${env:hestiaKERNEL_ERROR_OK}) { + return ${env:hestiaKERNEL_ERROR_OK} + } + + + # report status + return ${env:hestiaKERNEL_ERROR_NOT_POSSIBLE} +} +################################################################################ +# Windows POWERSHELL Codes # +################################################################################ +return +<# +RUN_AS_POWERSHELL + + + + +################################################################################ +# Unix Main Codes # +################################################################################ +. "${LIBS_HESTIA}/hestiaKERNEL/Vanilla.sh.ps1" +. "${LIBS_HESTIA}/hestiaOS/Is_Command_Available.sh.ps1" + + + + +hestiaXZ_Is_Available() { + # execute + if [ $(hestiaOS_Is_Command_Available "xz") -eq $hestiaKERNEL_ERROR_OK ]; then + return $hestiaKERNEL_ERROR_OK + fi + + + # report status + return $hestiaKERNEL_ERROR_NOT_POSSIBLE +} +################################################################################ +# Unix Main Codes # +################################################################################ +return 0 +#> diff --git a/automataCI/services/hestiaXZ/Is_Target_Valid.sh.ps1 b/automataCI/services/hestiaXZ/Is_Target_Valid.sh.ps1 new file mode 100644 index 0000000..8581b0f --- /dev/null +++ b/automataCI/services/hestiaXZ/Is_Target_Valid.sh.ps1 @@ -0,0 +1,120 @@ +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\Get_File.sh.ps1" +. "${env:LIBS_HESTIA}\hestiaSTRING\Is_Empty.sh.ps1" + + + + +function hestiaXZ-Is-Target-Valid { + param ( + [string]$___target + ) + + + # validate input + if ($(hestiaSTRING-Is-Empty "${___target}") -eq ${env:hestiaKERNEL_ERROR_OK}) { + return ${env:hestiaKERNEL_ERROR_DATA_MISSING} + } + + + # execute + $___target = hestiaFS-Get-File "${___target}" + if ($("${___target}" -replace '.*\.txz$', '') -ne "${___target}") { + return ${env:hestiaKERNEL_ERROR_OK} + } + + if ($("${___target}" -replace '.*\.xz$', '') -ne "${___target}") { + 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/Get_File.sh.ps1" +. "${LIBS_HESTIA}/hestiaSTRING/Is_Empty.sh.ps1" + + + + +hestiaXZ_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 + ___target="$(hestiaFS_Get_File "$1")" + if [ ! "${___target%%.txz*}" = "$___target" ]; then + printf -- "%d" $hestiaKERNEL_ERROR_OK + return $hestiaKERNEL_ERROR_OK + fi + + if [ ! "${___target%%.xz*}" = "$___target" ]; 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/hestiaXZ/Vanilla.sh.ps1 b/automataCI/services/hestiaXZ/Vanilla.sh.ps1 new file mode 100644 index 0000000..56245d9 --- /dev/null +++ b/automataCI/services/hestiaXZ/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}\hestiaXZ\Compress.sh.ps1" +. "${env:LIBS_HESTIA}\hestiaXZ\Deflate.sh.ps1" +. "${env:LIBS_HESTIA}\hestiaXZ\Is_Available.sh.ps1" +. "${env:LIBS_HESTIA}\hestiaXZ\Is_Target_Valid.sh.ps1" +################################################################################ +# Windows POWERSHELL Codes # +################################################################################ +return +<# +RUN_AS_POWERSHELL + + + + +################################################################################ +# Unix Main Codes # +################################################################################ +. "${LIBS_HESTIA}/hestiaXZ/Compress.sh.ps1" +. "${LIBS_HESTIA}/hestiaXZ/Deflate.sh.ps1" +. "${LIBS_HESTIA}/hestiaXZ/Is_Available.sh.ps1" +. "${LIBS_HESTIA}/hestiaXZ/Is_Target_Valid.sh.ps1" +################################################################################ +# Unix Main Codes # +################################################################################ +return 0 +#> diff --git a/automataCI/services/hestiaZIP/Is_Available.sh.ps1 b/automataCI/services/hestiaZIP/Is_Available.sh.ps1 new file mode 100644 index 0000000..0bcccff --- /dev/null +++ b/automataCI/services/hestiaZIP/Is_Available.sh.ps1 @@ -0,0 +1,81 @@ +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 hestiaZIP-Is-Available { + # 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}/hestiaOS/Is_Command_Available.sh.ps1" + + + + +hestiaZIP_Is_Available() { + # execute + hestiaOS_Is_Command_Available "zip" + if [ $? -ne 0 ]; then + printf -- "%d" $hestiaKERNEL_ERROR_DATA_MISSING + return $hestiaKERNEL_ERROR_DATA_MISSING + fi + + hestiaOS_Is_Command_Available "unzip" + if [ $? -ne 0 ]; 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/hestiaZIP/Is_Target_Valid.sh.ps1 b/automataCI/services/hestiaZIP/Is_Target_Valid.sh.ps1 new file mode 100644 index 0000000..a7dc171 --- /dev/null +++ b/automataCI/services/hestiaZIP/Is_Target_Valid.sh.ps1 @@ -0,0 +1,128 @@ +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\Get_File.sh.ps1" +. "${env:LIBS_HESTIA}\hestiaSTRING\Is_Empty.sh.ps1" + + + + +function hestiaZIP-Is-Target-Valid { + param ( + [string]$___target + ) + + + # validate input + if ($(hestiaSTRING-Is-Empty "${___target}") -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}/hestiaFS/Vanilla.sh.ps1" +. "${LIBS_HESTIA}/hestiaKERNEL/Vanilla.sh.ps1" +. "${LIBS_HESTIA}/hestiaSTRING/Is_Empty.sh.ps1" +. "${LIBS_HESTIA}/hestiaOS/Is_Command_Available.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/Pack.sh.ps1 b/automataCI/services/hestiaZIP/Pack.sh.ps1 new file mode 100644 index 0000000..19c912b --- /dev/null +++ b/automataCI/services/hestiaZIP/Pack.sh.ps1 @@ -0,0 +1,228 @@ +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\Is_Empty.sh.ps1" +. "${env:LIBS_HESTIA}\hestiaZIP\Is_Available.sh.ps1" + + + + +function hestiaZIP-Pack { + param ( + [string]$___destination, + [string]$___source, + [string]$___compression + ) + + + # validate input + if ($(hestiaSTRING-Is-Empty "${___destination}") -eq ${env:hestiaKERNEL_ERROR_OK}) { + return ${env:hestiaKERNEL_ERROR_ENTITY_MISSING} + } + + if ($(hestiaSTRING-Is-Empty "${___source}") -eq ${env:hestiaKERNEL_ERROR_OK}) { + return ${env:hestiaKERNEL_ERROR_IS_EMPTY} + } + + if ($(hestiaZIP-Is-Available) -eq ${env:hestiaKERNEL_ERROR_OK}) { + return ${env:hestiaKERNEL_ERROR_NOT_POSSIBLE} + } + + if ($(hestiaFS-Is-Exist "${___destination}") -eq ${env:hestiaKERNEL_ERROR_OK}) { + return ${env:hestiaKERNEL_ERROR_ENTITY_EXISTS} + } + + if ($(hestiaFS-Is-Directory "${___destination}") -eq ${env:hestiaKERNEL_ERROR_OK}) { + return ${env:hestiaKERNEL_ERROR_ENTITY_IS_NOT_FILE} + } + + if ($(hestiaFS-Is-Directory "${___source}") -ne ${env:hestiaKERNEL_ERROR_OK}) { + return ${env:hestiaKERNEL_ERROR_DATA_INVALID} + } + + if ($(hestiaFS-Is-Directory-Empty "${___source}") -eq ${env:hestiaKERNEL_ERROR_OK}) { + return ${env:hestiaKERNEL_ERROR_DATA_EMPTY} + } + + + # execute + if ($(hestiaFS-Get-Directory "${___destination}") -ne "${___destination}") { + $null = hestiaFS-Create-Directory "$(hestiaFS-Get-Directory "${___destination}")" + } + + + # archive to zip + # IMPORTANT: to prevent CVE-2022-21675 from happening, hestiaZIP shall + # change directory explictly into the archive root directory + # and form the relative pathings. + $___current_path = Get-Location + $null = Set-Location "${___source}" + + try { + switch ($___compression) { + { $_ -in "none", "None", "NONE" } { + $null = Compress-Archive -Update ` + -CompressionLevel NoCompression ` + -DestinationPath $___destination ` + -Path "." + } { $_ -in "speed", "Speed", "SPEED" } { + $null = Compress-Archive -Update ` + -CompressionLevel Fastest ` + -DestinationPath $___destination ` + -Path "." + } default { + $null = Compress-Archive -Update ` + -CompressionLevel Optimal ` + -DestinationPath $___destination ` + -Path "." + }} + $___process = hestiaFS-Is-File "${___destination}" + } catch { + $___process = ${env:hestiaKERNEL_ERROR_BAD_EXEC} + } + + $null = Set-Location "${___current_path}" + $null = Remove-Variable -name ___current_path + + if ($___process -ne ${env:hestiaKERNEL_ERROR_OK}) { + $null = hestiaFS-Remove "${___destination}" + 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}/hestiaFS/Vanilla.sh.ps1" +. "${LIBS_HESTIA}/hestiaKERNEL/Vanilla.sh.ps1" +. "${LIBS_HESTIA}/hestiaSTRING/Is_Empty.sh.ps1" +. "${LIBS_HESTIA}/hestiaZIP/Is_Available.sh.ps1" + + + + +hestiaZIP_Pack() { + ___destination="$1" + ___source="$2" + ___compression="$3" + + + # validate input + if [ $(hestiaSTRING_Is_Empty "$___destination") -eq $hestiaKERNEL_ERROR_OK ]; then + return $hestiaKERNEL_ERROR_ENTITY_MISSING + fi + + if [ $(hestiaSTRING_Is_Empty "${___source}") -eq $hestiaKERNEL_ERROR_OK ]; then + return $hestiaKERNEL_ERROR_IS_EMPTY + fi + + if [ $(hestiaZIP_Is_Available) -ne $hestiaKERNEL_ERROR_OK ]; then + return $hestiaKERNEL_ERROR_NOT_POSSIBLE + fi + + if [ $(hestiaFS_Is_Exist "$___destination") -eq $hestiaKERNEL_ERROR_OK ]; then + return $hestiaKERNEL_ERROR_ENTITY_EXISTS + fi + + if [ $(hestiaFS_Is_Directory "${___destination}") -eq $hestiaKERNEL_ERROR_OK ]; then + return $hestiaKERNEL_ERROR_ENTITY_IS_NOT_FILE + fi + + if [ $(hestiaFS_Is_Directory "${___source}") -ne $hestiaKERNEL_ERROR_OK ]; then + return $hestiaKERNEL_ERROR_DATA_INVALID + fi + + if [ $(hestiaFS_Is_Directory_Empty "${___source}") -eq $hestiaKERNEL_ERROR_OK ]; then + return $hestiaKERNEL_ERROR_DATA_EMPTY + fi + + + # execute + if [ ! "$(hestiaFS_Get_Directory "$___destination")" = "$___destination" ]; then + hestiaFS_Create_Directory "$(hestiaFS_Get_Directory "$___destination")" + fi + + + # archive to zip + # IMPORTANT: to prevent CVE-2022-21675 from creation, hestiaZIP shall + # change directory into the archive root directory and form + # the relative pathings. + ___current_path="$PWD" + cd "$___source" + + case "$___compression" in + none|None|NONE) + zip -0 -r "$___destination" "." + ;; + speed|Speed|SPEED) + zip -1 -r "$___destination" "." + ;; + *) + zip -9 -r "$___destination" "." + ;; + esac + ___process=$? + + cd "$___current_path" + unset ___current_path + + if [ $___process -ne 0 ]; then + hestiaFS_Remove "$___destination" + return $hestiaKERNEL_ERROR_BAD_EXEC + fi + + + # report status + return $hestiaKERNEL_ERROR_OK +} +################################################################################ +# Unix Main Codes # +################################################################################ +return 0 +#> diff --git a/automataCI/services/hestiaZIP/Unpack.sh.ps1 b/automataCI/services/hestiaZIP/Unpack.sh.ps1 new file mode 100644 index 0000000..e0575ce --- /dev/null +++ b/automataCI/services/hestiaZIP/Unpack.sh.ps1 @@ -0,0 +1,160 @@ +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\Is_Empty.sh.ps1" +. "${env:LIBS_HESTIA}\hestiaOS\Is_Command_Available.sh.ps1" + + + + +function hestiaZIP-Unpack { + param ( + [string]$___destination, + [string]$___source + ) + + + # validate input + if ($(hestiaSTRING-Is-Empty "${___destination}") -eq ${env:hestiaKERNEL_ERROR_OK}) { + return ${env:hestiaKERNEL_ERROR_ENTITY_MISSING} + } + + if ($(hestiaSTRING-Is-Empty "${___source}") -eq ${env:hestiaKERNEL_ERROR_OK}) { + return ${env:hestiaKERNEL_ERROR_IS_EMPTY} + } + + if ( + ($(hestiaFS-Is-Exist "${___destination}") -eq ${env:hestiaKERNEL_ERROR_OK}) -and + ($(hestiaFS-Is-Directory "${___destination}") -ne ${env:hestiaKERNEL_ERROR_OK}) + ) { + return ${env:hestiaKERNEL_ERROR_ENTITY_IS_NOT_DIRECTORY} + } + + if ($(hestiaFS-Is-File "${___source}") -ne ${env:hestiaKERNEL_ERROR_OK}) { + return ${env:hestiaKERNEL_ERROR_DATA_INVALID} + } + + if ($(hestiaFS-Is-Directory-Empty "${___destination}") -ne ${env:hestiaKERNEL_ERROR_OK}) { + return ${env:hestiaKERNEL_ERROR_DATA_EMPTY} + } + + + # execute + try { + $null = hestiaFS-Create-Directory $___destination + $null = Expand-Archive -DestinationPath $___destination -Path $___source + $___process = ${env:hestiaKERNEL_ERROR_OK} + } catch { + $___process = ${env:hestiaKERNEL_ERROR_BAD_EXEC} + } + + 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}/hestiaFS/Vanilla.sh.ps1" +. "${LIBS_HESTIA}/hestiaSTRING/Is_Empty.sh.ps1" + + + + +hestiaZIP_Unpack() { + ___destination="$1" + ___source="$2" + + + # validate input + if [ $(hestiaSTRING_Is_Empty "$___destination") -eq $hestiaKERNEL_ERROR_OK ]; then + return $hestiaKERNEL_ERROR_ENTITY_MISSING + fi + + if [ $(hestiaSTRING_Is_Empty "${___source}") -eq $hestiaKERNEL_ERROR_OK ]; then + return $hestiaKERNEL_ERROR_IS_EMPTY + fi + + hestiaOS_Is_Command_Available "unzip" + if [ $? -ne 0 ]; then + return $hestiaKERNEL_ERROR_NOT_POSSIBLE + fi + + if [ $(hestiaFS_Is_Exist "$___destination") -eq $hestiaKERNEL_ERROR_OK ] && + [ $(hestiaFS_Is_Directory "${___destination}") -ne $hestiaKERNEL_ERROR_OK ]; then + return $hestiaKERNEL_ERROR_ENTITY_IS_NOT_DIRECTORY + fi + + if [ $(hestiaFS_Is_Directory "${___source}") -ne $hestiaKERNEL_ERROR_OK ]; then + return $hestiaKERNEL_ERROR_DATA_INVALID + fi + + if [ $(hestiaFS_Is_Directory_Empty "${___source}") -eq $hestiaKERNEL_ERROR_OK ]; then + return $hestiaKERNEL_ERROR_DATA_EMPTY + fi + + + # execute + FS_Make_Directory "$___destination" + unzip "$___source" -d "$___destination" + 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/hestiaZIP/Vanilla.sh.ps1 b/automataCI/services/hestiaZIP/Vanilla.sh.ps1 new file mode 100644 index 0000000..fb75c61 --- /dev/null +++ b/automataCI/services/hestiaZIP/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}\hestiaZIP\Is_Available.sh.ps1" +. "${env:LIBS_HESTIA}\hestiaZIP\Is_Target_Valid.sh.ps1" +. "${env:LIBS_HESTIA}\hestiaZIP\Pack.sh.ps1" +. "${env:LIBS_HESTIA}\hestiaZIP\Unpack.sh.ps1" +################################################################################ +# Windows POWERSHELL Codes # +################################################################################ +return +<# +RUN_AS_POWERSHELL + + + + +################################################################################ +# Unix Main Codes # +################################################################################ +. "${LIBS_HESTIA}/hestiaZIP/Is_Available.sh.ps1" +. "${LIBS_HESTIA}/hestiaZIP/Is_Target_Valid.sh.ps1" +. "${LIBS_HESTIA}/hestiaZIP/Pack.sh.ps1" +. "${LIBS_HESTIA}/hestiaZIP/Unpack.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/automataCI/x-package_unix-any.sh b/automataCI/x-package_unix-any.sh new file mode 100644 index 0000000..0fea5e8 --- /dev/null +++ b/automataCI/x-package_unix-any.sh @@ -0,0 +1,224 @@ +#!/bin/sh +# Copyright 2023 (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. + + + + +# initialize +if [ "$PROJECT_PATH_ROOT" = "" ]; then + >&2 printf "[ ERROR ] - Please run me from automataCI/ci.sh.ps1 instead!\n" + return 1 +fi + + + + +# begin registering packagers +for i in "${PROJECT_PATH_ROOT}/${PROJECT_PATH_BUILD}"/*; do + if [ $(hestiaPDF_Is_Target_Valid "$i") -eq 0 ]; then + __log="single-pdf" + if [ $(hestiaFS_Is_Filename_Has "$i" "$PROJECT_RESEARCH_ID") -eq 0 ]; then + __log="${__log}-${PROJECT_RESEARCH_ID}" + fi + __log="${__log}_${TARGET_FILENAME}_${TARGET_OS}-${TARGET_ARCH}.log" + + __log="${__log_directory}/${__log}" + FS_Append_File "$__parallel_control" "\ +${__common}|${__log}|PACKAGE_Run_SINGLE +" + if [ $? -ne 0 ]; then + return 1 + fi + else + __log="archive_${TARGET_FILENAME}_${TARGET_OS}-${TARGET_ARCH}.log" + __log="${__log_directory}/${__log}" + FS_Append_File "$__parallel_control" "\ +${__common}|${__log}|PACKAGE_Run_ARCHIVE +" + if [ $? -ne 0 ]; then + return 1 + fi + fi + + + # NOTE: deb does not work in windows or mac + if [ $(STRINGS_Is_Empty "$PROJECT_DEB_URL") -ne 0 ]; then + case "$TARGET_OS" in + windows|darwin) + ;; + *) + __log="deb_${TARGET_FILENAME}_${TARGET_OS}-${TARGET_ARCH}.log" + __log="${__log_directory}/${__log}" + FS_Append_File "$__parallel_control" "\ +${__common}|${FILE_CHANGELOG_DEB}|${__log}|PACKAGE_Run_DEB +" + if [ $? -ne 0 ]; then + return 1 + fi + ;; + esac + fi + + + # NOTE: container only serve windows and linux + if [ $(STRINGS_Is_Empty "$PROJECT_CONTAINER_REGISTRY") -ne 0 ]; then + case "$TARGET_OS" in + any|linux|windows) + __log="docker_${TARGET_FILENAME}_${TARGET_OS}-${TARGET_ARCH}.log" + __log="${__log_directory}/${__log}" + FS_Append_File "$__serial_control" "\ +${__common}|${__log}|PACKAGE_Run_DOCKER +" + if [ $? -ne 0 ]; then + return 1 + fi + ;; + *) + ;; + esac + fi + + + # NOTE: flatpak only serve linux + FLATPAK_Is_Available + if [ $? -eq 0 ] && [ $(STRINGS_Is_Empty "$PROJECT_FLATPAK_URL") -ne 0 ]; then + case "$TARGET_OS" in + any|linux) + __log="flatpak_${TARGET_FILENAME}_${TARGET_OS}-${TARGET_ARCH}.log" + __log="${__log_directory}/${__log}" + FS_Append_File "$__serial_control" "\ +${__common}|${FLATPAK_REPO}|${__log}|PACKAGE_Run_FLATPAK +" + if [ $? -ne 0 ]; then + return 1 + fi + ;; + *) + ;; + esac + fi + + # NOTE: homebrew only serve linux and mac + if [ $(STRINGS_Is_Empty "$PROJECT_HOMEBREW_URL") -ne 0 ]; then + case "$TARGET_OS" in + any|darwin|linux) + __log="homebrew_${TARGET_FILENAME}_${TARGET_OS}-${TARGET_ARCH}.log" + __log="${__log_directory}/${__log}" + FS_Append_File "$__parallel_control" "\ +${__common}|${HOMEBREW_WORKSPACE}|${__log}|PACKAGE_Run_HOMEBREW +" + if [ $? -ne 0 ]; then + return 1 + fi + ;; + *) + ;; + esac + fi + + if [ $(STRINGS_Is_Empty "$PROJECT_RELEASE_IPK") -ne 0 ]; then + __log="ipk_${TARGET_FILENAME}_${TARGET_OS}-${TARGET_ARCH}.log" + __log="${__log_directory}/${__log}" + FS_Append_File "$__parallel_control" "\ +${__common}|${__log}|PACKAGE_Run_IPK +" + if [ $? -ne 0 ]; then + return 1 + fi + fi + + # NOTE: MSI only works in windows + if [ $(STRINGS_Is_Empty "$PROJECT_MSI_INSTALL_DIRECTORY") -ne 0 ]; then + case "$TARGET_OS" in + any|windows) + __log="msi_${TARGET_FILENAME}_${TARGET_OS}-${TARGET_ARCH}.log" + __log="${__log_directory}/${__log}" + FS_Append_File "$__parallel_control" "\ +${__common}|${MSI_WORKSPACE}|${__log}|PACKAGE_Run_MSI +" + if [ $? -ne 0 ]; then + return 1 + fi + ;; + *) + ;; + esac + + fi + + # NOTE: RPM only serve linux + if [ $(STRINGS_Is_Empty "$PROJECT_RPM_URL") -ne 0 ]; then + case "$TARGET_OS" in + any|linux) + __log="rpm_${TARGET_FILENAME}_${TARGET_OS}-${TARGET_ARCH}.log" + __log="${__log_directory}/${__log}" + FS_Append_File "$__parallel_control" "\ +${__common}|${__log}|PACKAGE_Run_RPM +" + if [ $? -ne 0 ]; then + return 1 + fi + ;; + *) + ;; + esac + fi +done + + +if [ $(STRINGS_Is_Empty "$PROJECT_HOMEBREW_URL") -ne 0 ]; then + I18N_Newline + I18N_Newline + + __dest="${PROJECT_SKU}.rb" + I18N_Export "$__dest" + __dest="${PROJECT_PATH_ROOT}/${PROJECT_PATH_PKG}/${__dest}" + HOMEBREW_Seal "$__dest" \ + "${PROJECT_SKU}-homebrew_${PROJECT_VERSION}_any-any.tar.xz" \ + "$HOMEBREW_WORKSPACE" \ + "$PROJECT_SKU" \ + "$PROJECT_PITCH" \ + "$PROJECT_CONTACT_WEBSITE" \ + "$PROJECT_LICENSE" \ + "$PROJECT_HOMEBREW_URL" + if [ $? -ne 0 ];then + I18N_Export_Failed + return 1 + fi +fi + + +if [ "$(STRINGS_Is_Empty "$PROJECT_MSI_INSTALL_DIRECTORY")" -ne 0 ]; then + I18N_Newline + I18N_Newline + + # sort any arch into others + PACKAGE_Sort_MSI "$MSI_WORKSPACE" + if [ $? -ne 0 ];then + return 1 + fi + + # seal all MSI packages + for _candidate in "${MSI_WORKSPACE}/"*; do + FS_Is_Directory "$_candidate" + if [ $? -ne 0 ]; then + continue + fi + + I18N_Newline + PACKAGE_Seal_MSI "$_candidate" "${PROJECT_PATH_ROOT}/${PROJECT_PATH_PKG}" + if [ $? -ne 0 ];then + return 1 + fi + done +fi diff --git a/automataCI/x-package_windows-any.ps1 b/automataCI/x-package_windows-any.ps1 new file mode 100644 index 0000000..7e04037 --- /dev/null +++ b/automataCI/x-package_windows-any.ps1 @@ -0,0 +1,229 @@ +# Copyright 2023 (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. + + + + +# initialize +if (-not (Test-Path -Path $env:PROJECT_PATH_ROOT)) { + Write-Error "[ ERROR ] - Please run me from automataCI\ci.sh.ps1 instead!`n" + return 1 +} + +# prepare for parallel package +foreach ($i in (Get-ChildItem -Path "${env:PROJECT_PATH_ROOT}\${env:PROJECT_PATH_BUILD}")) { + + $___process = FS-Is-File "$i" + if ($___process -ne 0) { + continue + } + + + # begin registrations + $null = I18N-Sync-Register "$i" + + if ($(hestiaPDF-Is-Target-Valid "$i") -eq 0) { + $__log = "single-pdf" + if ($(hestiaFS-Is-Filename-Has "$i" "${env:PROJECT_RESEARCH_ID}") -eq 0) { + $__log = "${__log}-${env:PROJECT_RESEARCH_ID}" + } + $__log = "${__log}_${TARGET_FILENAME}_${TARGET_OS}-${TARGET_ARCH}.log" + + $__log = "${__log_directory}\${__log}" + $___process = FS-Append-File "${__parallel_control}" @" +${__common}|${__log}|PACKAGE-Run-SINGLE + +"@ + if ($___process -ne 0) { + return 1 + } + } else { + $__log = "archive_${TARGET_FILENAME}_${TARGET_OS}-${TARGET_ARCH}.log" + $__log = "${__log_directory}\${__log}" + $___process = FS-Append-File "${__parallel_control}" @" +${__common}|${__log}|PACKAGE-Run-ARCHIVE + +"@ + if ($___process -ne 0) { + return 1 + } + } + + + # NOTE: deb does not work in windows or mac + if ($(STRINGS-Is-Empty "${env:PROJECT_DEB_URL}") -ne 0) { + switch ("${TARGET_OS}") { + { $_ -in "windows", "darwin" } { + $__log = "deb_${TARGET_FILENAME}_${TARGET_OS}-${TARGET_ARCH}.log" + $__log = "${__log_directory}\${__log}" + $___process = FS-Append-File "${__parallel_control}" @" +${__common}|${FILE_CHANGELOG_DEB}|${__log}|PACKAGE-Run-DEB + +"@ + if ($___process -ne 0) { + return 1 + } + } default { + }} + } + + + # NOTE: container only server windows and linux + if ($(STRINGS-Is-Empty "${env:PROJECT_CONTAINER_REGISTRY}") -ne 0) { + switch ("${TARGET_OS}") { + { $_ -in "any", "linux", "windows" } { + $__log = "docker_${TARGET_FILENAME}_${TARGET_OS}-${TARGET_ARCH}.log" + $__log = "${__log_directory}\${__log}" + $___process = FS-Append-File "${__serial_control}" @" +${__common}|${__log}|PACKAGE-Run-DOCKER + +"@ + if ($___process -ne 0) { + return 1 + } + } default { + }} + } + + + # NOTE: flatpak only serve linux + $___process = FLATPAK-Is-Available + if (($___process -eq 0) -and + ($(STRINGS-Is-Empty "${env:PROJECT_FLATPAK_URL}") -ne 0)) { + switch ("${TARGET_OS}") { + { $_ -in "any", "linux" } { + $__log = "flatpak_${TARGET_FILENAME}_${TARGET_OS}-${TARGET_ARCH}.log" + $__log = "${__log_directory}\${__log}" + $___process = FS-Append-File "${__serial_control}" @" +${__common}|${FLATPAK_REPO}|${__log}|PACKAGE-Run-FLATPAK + +"@ + if ($___process -ne 0) { + return 1 + } + } default { + }} + } + + + # NOTE: homebrew only serve linux and mac + if ($(STRINGS-Is-Empty "${env:PROJECT_HOMEBREW_URL}") -ne 0) { + switch ("${TARGET_OS}") { + { $_ -in "any", "darwin", "linux" } { + $__log = "homebrew_${TARGET_FILENAME}_${TARGET_OS}-${TARGET_ARCH}.log" + $__log = "${__log_directory}\${__log}" + $___process = FS-Append-File "${__parallel_control}" @" +${__common}|${HOMEBREW_WORKSPACE}|${__log}|PACKAGE-Run-HOMEBREW + +"@ + if ($___process -ne 0) { + return 1 + } + } default { + }} + } + + if ($(STRINGS-Is-Empty "${env:PROJECT_RELEASE_IPK}") -ne 0) { + $__log = "ipk_${TARGET_FILENAME}_${TARGET_OS}-${TARGET_ARCH}.log" + $__log = "${__log_directory}\${__log}" + $___process = FS-Append-File "${__parallel_control}" @" +${__common}|${__log}|PACKAGE-Run-IPK + +"@ + if ($___process -ne 0) { + return 1 + } + } + + # NOTE: MSI only works in windows + if ($(STRINGS-Is-Empty "${env:PROJECT_MSI_INSTALL_DIRECTORY}") -ne 0) { + switch ("${TARGET_OS}") { + { $_ -in "any", "windows" } { + $__log = "msi_${TARGET_FILENAME}_${TARGET_OS}-${TARGET_ARCH}.log" + $__log = "${__log_directory}\${__log}" + $___process = FS-Append-File "${__parallel_control}" @" +${__common}|${MSI_WORKSPACE}|${__log}|PACKAGE-Run-MSI + +"@ + if ($___process -ne 0) { + return 1 + } + } default { + }} + } + + # NOTE: RPM only serve linux + if ($(STRINGS-Is-Empty "${env:PROJECT_RPM_URL}") -ne 0) { + switch ("${TARGET_OS}") { + { $_ -in "any", "linux" } { + $__log = "rpm_${TARGET_FILENAME}_${TARGET_OS}-${TARGET_ARCH}.log" + $__log = "${__log_directory}\${__log}" + $___process = FS-Append-File "${__parallel_control}" @" +${__common}|${__log}|PACKAGE-Run-RPM + +"@ + if ($___process -ne 0) { + return 1 + } + } default { + }} + } +} + + +if ($(STRINGS-Is-Empty "${env:PROJECT_HOMEBREW_URL}") -ne 0) { + $null = I18N-Newline + $null = I18N-Newline + + $__dest = "${env:PROJECT_SKU}.rb" + $null = I18N-Export "${__dest}" + $__dest = "${env:PROJECT_PATH_ROOT}\${env:PROJECT_PATH_PKG}\${__dest}" + $___process = HOMEBREW-Seal "${__dest}" ` + "${env:PROJECT_SKU}-homebrew_${env:PROJECT_VERSION}_any-any.tar.xz" ` + "${HOMEBREW_WORKSPACE}" ` + "${env:PROJECT_SKU}" ` + "${env:PROJECT_PITCH}" ` + "${env:PROJECT_CONTACT_WEBSITE}" ` + "${env:PROJECT_LICENSE}" ` + "${env:PROJECT_HOMEBREW_URL}" + if ($___process -ne 0) { + $null = I18N-Export-Failed + return 1 + } +} + + +if ($(STRINGS-Is-Empty "${env:PROJECT_MSI_INSTALL_DIRECTORY}") -ne 0) { + $null = I18N-Newline + $null = I18N-Newline + + + # sort 'any' arch into others + $___process = PACKAGE-Sort-MSI "${MSI_WORKSPACE}" + if ($___process -ne 0) { + return 1 + } + + # seal all MSI packages + foreach ($_candidate in (Get-ChildItem -Path "${MSI_WORKSPACE}" -Directory)) { + $_candidate = $_candidate.FullName + + $null = I18N-Newline + + $___process = PACKAGE-Seal-MSI ` + "${_candidate}" ` + "${env:PROJECT_PATH_ROOT}\${env:PROJECT_PATH_PKG}" + if ($___process -ne 0) { + return 1 + } + } +} diff --git a/src/.ci/_package-archive_unix-any.sh b/src/.ci/_package-archive_unix-any.sh deleted file mode 100644 index 066772c..0000000 --- a/src/.ci/_package-archive_unix-any.sh +++ /dev/null @@ -1,144 +0,0 @@ -#!/bin/sh -# Copyright 2023 (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. - - - - -# initialize -if [ "$PROJECT_PATH_ROOT" = "" ]; then - >&2 printf "[ ERROR ] - Please run from automataCI/ci.sh.ps1 instead!\n" - return 1 -fi - -. "${LIBS_AUTOMATACI}/services/io/fs.sh" -. "${LIBS_AUTOMATACI}/services/i18n/translations.sh" - - - - -PACKAGE_Assemble_ARCHIVE_Content() { - _target="$1" - _directory="$2" - _target_name="$3" - _target_os="$4" - _target_arch="$5" - - - # package based on target's nature - if [ $(FS_Is_Target_A_Source "$_target") -eq 0 ]; then - return 10 # not applicable - elif [ $(FS_Is_Target_A_Docs "$_target") -eq 0 ]; then - __source="${PROJECT_PATH_ROOT}/${PROJECT_PATH_DOCS}" - __dest="${_directory}/docs" - - FS_Is_Directory "$__source" - if [ $? -ne 0 ]; then - return 10 # not applicable - fi - - I18N_Assemble "$__source" "$__dest" - FS_Make_Directory "$__dest" - FS_Copy_All "$__source" "$__dest" - if [ $? -ne 0 ]; then - I18N_Assemble_Failed - return 1 - fi - elif [ $(FS_Is_Target_A_Library "$_target") -eq 0 ]; then - return 10 # handled by lib packager - elif [ $(FS_Is_Target_A_WASM_JS "$_target") -eq 0 ]; then - return 10 # handled by wasm instead - elif [ $(FS_Is_Target_A_WASM "$_target") -eq 0 ]; then - __dest="${_directory}/assets/$(FS_Get_File "$_target")" - - I18N_Assemble "$_target" "$__dest" - FS_Make_Housing_Directory "$__dest" - FS_Copy_File "$_target" "$__dest" - if [ $? -ne 0 ]; then - I18N_Assemble_Failed - return 1 - fi - - __source="$(FS_Extension_Remove "$_target" ".wasm").js" - FS_Is_File "$__source" - if [ $? -eq 0 ]; then - __dest="${__dest}/$(FS_Get_File "$__source")" - I18N_Assemble "$__source" "$__dest" - FS_Copy_File "$__source" "$__dest" - if [ $? -ne 0 ]; then - I18N_Assemble_Failed - return 1 - fi - fi - elif [ $(FS_Is_Target_A_Chocolatey "$_target") -eq 0 ]; then - return 10 # not applicable - elif [ $(FS_Is_Target_A_Homebrew "$_target") -eq 0 ]; then - return 10 # not applicable - elif [ $(FS_Is_Target_A_Cargo "$_target") -eq 0 ]; then - return 10 # not applicable - elif [ $(FS_Is_Target_A_MSI "$_target") -eq 0 ]; then - return 10 # not applicable - elif [ $(FS_Is_Target_A_PDF "$_target") -eq 0 ]; then - return 10 # not applicable - else - __dest="${_directory}/bin/${PROJECT_SKU}" - if [ "$_target_os" = "windows" ]; then - __dest="${__dest}.exe" - fi - - I18N_Assemble "$_target" "$__dest" - FS_Make_Housing_Directory "$__dest" - FS_Copy_File "$_target" "$__dest" - if [ $? -ne 0 ]; then - I18N_Assemble_Failed - return 1 - fi - fi - - - # copy user guide - for __source in "${PROJECT_PATH_ROOT}/${PROJECT_PATH_SOURCE}/docs/USER-GUIDES"*.pdf; do - FS_Is_Target_Exist "$__source" - if [ $? -ne 0 ]; then - continue - fi - - __dest="${_directory}/$(FS_Get_File "$__source")" - I18N_Assemble "$__source" "$__dest" - FS_Copy_File "$__source" "$__dest" - if [ $? -ne 0 ]; then - I18N_Assemble_Failed - return 1 - fi - done - - - # copy license file - for __source in "${PROJECT_PATH_ROOT}/${PROJECT_PATH_SOURCE}/licenses/LICENSE"*.pdf; do - FS_Is_Target_Exist "$__source" - if [ $? -ne 0 ]; then - continue - fi - - __dest="${_directory}/$(FS_Get_File "$__source")" - I18N_Assemble "$__source" "$__dest" - FS_Copy_File "$__source" "$__dest" - if [ $? -ne 0 ]; then - I18N_Assemble_Failed - return 1 - fi - done - - - # report status - return 0 -} diff --git a/src/.ci/_package-archive_windows-any.ps1 b/src/.ci/_package-archive_windows-any.ps1 deleted file mode 100644 index 0d28260..0000000 --- a/src/.ci/_package-archive_windows-any.ps1 +++ /dev/null @@ -1,139 +0,0 @@ -# Copyright 2023 (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. - - - - -# initialize -if (-not (Test-Path -Path $env:PROJECT_PATH_ROOT)) { - Write-Error "[ ERROR ] - Please run from automataCI\ci.sh.ps1 instead!`n" - return 1 -} - -. "${env:LIBS_AUTOMATACI}\services\io\fs.ps1" -. "${env:LIBS_AUTOMATACI}\services\i18n\translations.ps1" - - - - -function PACKAGE-Assemble-ARCHIVE-Content { - param( - [string]$_target, - [string]$_directory, - [string]$_target_name, - [string]$_target_os, - [string]$_target_arch - ) - - - # copy main program - if ($(FS-Is-Target-A-Source "${_target}") -eq 0) { - return 10 # not applicable - } elseif ($(FS-Is-Target-A-Docs "${_target}") -eq 0) { - $__source = "${env:PROJECT_PATH_ROOT}\${env:PROJECT_PATH_DOCS}" - $__dest = "${_directory}\docs" - - $___process = FS-Is-Directory "${__source}" - if ($___process -ne 0) { - return 10 # not applicable - } - - $null = I18N-Assemble "${__source}" "${__dest}" - $null = FS-Make-Directory "${__dest}" - $___process = FS-Copy-All "${__source}" "${__dest}" - if ($___process -ne 0) { - $null = I18N-Assemble-Failed - return 1 - } - } elseif ($(FS-Is-Target-A-Library "${_target}") -eq 0) { - return 10 # handled by lib packager - } elseif ($(FS-Is-Target-A-WASM-JS "${_target}") -eq 0) { - return 10 # handled by wasm instead - } elseif ($(FS-Is-Target-A-WASM "${_target}") -eq 0) { - $__dest = "${_directory}\assets\$(FS-Get-File "${_target}")" - - $null = I18N-Assemble "${_target}" "${__dest}" - $null = FS-Make-Directory "${__dest}" - $___process = FS-Copy-File "${_target}" "${__dest}" - if ($___process -ne 0) { - $null = I18N-Assemble-Failed - return 1 - } - - $__source = "$(FS-Extension-Remove "${_target}" ".wasm").js" - $___process = FS-Is-File "${__source}" - if ($___process -eq 0) { - $__dest = "${__dest}\$(FS-Get-File "${__source}")" - $null = I18N-Assemble "${__source}" "${__dest}" - $___process = FS-Copy-File "${__source}" "${__dest}" - if ($___process -ne 0) { - $null = I18N-Assemble-Failed - return 1 - } - } - } elseif ($(FS-Is-Target-A-Chocolatey "${_target}") -eq 0) { - return 10 # not applicable - } elseif ($(FS-Is-Target-A-Homebrew "${_target}") -eq 0) { - return 10 # not applicable - } elseif ($(FS-Is-Target-A-Cargo "${_target}") -eq 0) { - return 10 # not applicable - } elseif ($(FS-Is-Target-A-MSI "${_target}") -eq 0) { - return 10 # not applicable - } elseif ($(FS-Is-Target-A-PDF "${_target}") -eq 0) { - return 10 # not applicable - } else { - $__dest = "${_directory}\bin\${env:PROJECT_SKU}" - if ($_target_os -eq "windows") { - $__dest = "${__dest}.exe" - } - - $null = I18N-Assemble "${_target}" "${__dest}" - $null = FS-Make-Housing-Directory "${__dest}" - $___process = FS-Copy-File "${_target}" "${__dest}" - if ($___process -ne 0) { - $null = I18N-Assemble-Failed - return 1 - } - } - - - # 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 - $__dest = "${_directory}\$(FS-Get-File "${__source}")" - $null = I18N-Assemble "${__source}" "${__dest}" - $___process = FS-Copy-File "${__source}" "${__dest}" - if ($___process -ne 0) { - $null = I18N-Assemble-Failed - return 1 - } - } - - - # 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 - $__dest = "${_directory}\$(FS-Get-File "${__source}")" - $null = I18N-Assemble "${__source}" "${__dest}" - $___process = FS-Copy-File "${__source}" "${__dest}" - if ($___process -ne 0) { - $null = I18N-Assemble-Failed - return 1 - } - } - - - # report status - return 0 -} diff --git a/src/.ci/_package-cargo_unix-any.sh b/src/.ci/_package-cargo_unix-any.sh deleted file mode 100644 index 3072899..0000000 --- a/src/.ci/_package-cargo_unix-any.sh +++ /dev/null @@ -1,36 +0,0 @@ -#!/bin/sh -# Copyright 2023 (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. - - - - -# initialize -if [ "$PROJECT_PATH_ROOT" = "" ]; then - >&2 printf "[ ERROR ] - Please run from automataCI/ci.sh.ps1 instead!\n" - return 1 -fi - - - - -PACKAGE_Assemble_CARGO_Content() { - _target="$1" - _directory="$2" - _target_name="$3" - _target_os="$4" - _target_arch="$5" - - - # execute - return 10 # IMPORTANT: please do it inside rust source instead. -} diff --git a/src/.ci/_package-cargo_windows-any.ps1 b/src/.ci/_package-cargo_windows-any.ps1 deleted file mode 100644 index 76ad385..0000000 --- a/src/.ci/_package-cargo_windows-any.ps1 +++ /dev/null @@ -1,37 +0,0 @@ -# Copyright 2023 (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. - - - - -# initialize -if (-not (Test-Path -Path $env:PROJECT_PATH_ROOT)) { - Write-Error "[ ERROR ] - Please run from automataCI\ci.sh.ps1 instead!`n" - return 1 -} - - - - -function PACKAGE-Assemble-CARGO-Content { - param ( - [string]$_target, - [string]$_directory, - [string]$_target_name, - [string]$_target_os, - [string]$_target_arch - ) - - - # execute - return 10 # IMPORTANT: please do it inside rust source instead. -} diff --git a/src/.ci/_package-chocolatey_unix-any.sh b/src/.ci/_package-chocolatey_unix-any.sh deleted file mode 100644 index c8523df..0000000 --- a/src/.ci/_package-chocolatey_unix-any.sh +++ /dev/null @@ -1,256 +0,0 @@ -#!/bin/sh -# Copyright 2023 (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. - - - - -# initialize -if [ "$PROJECT_PATH_ROOT" == "" ]; then - >&2 printf "[ ERROR ] - Please run from automataCI/ci.sh.ps1 instead!\n" - return 1 -fi - -. "${LIBS_AUTOMATACI}/services/io/fs.sh" -. "${LIBS_AUTOMATACI}/services/i18n/translations.sh" - - - - -PACKAGE_Assemble_CHOCOLATEY_Content() { - _target="$1" - _directory="$2" - _target_name="$3" - _target_os="$4" - _target_arch="$5" - - - # validate input - case "$_target_os" in - any|windows) - ;; - *) - return 10 # not supported - ;; - esac - - if [ $(FS_Is_Target_A_Source "$_target") -eq 0 ]; then - return 10 # not applicable - elif [ $(FS_Is_Target_A_Docs "$_target") -eq 0 ]; then - return 10 # not applicable - elif [ $(FS_Is_Target_A_Library "$_target") -eq 0 ]; then - __dest="${_directory}/lib" - - if [ $(FS_Is_Target_A_NPM "$_target") -eq 0 ]; then - return 10 # not applicable - elif [ $(FS_Is_Target_A_TARGZ "$_target") -eq 0 ]; then - # unpack library - I18N_Assemble "$_target" "$__dest" - FS_Make_Directory "$__dest" - TAR_Extract_GZ "$__dest" "$_target" - if [ $? -ne 0 ]; then - I18N_Assemble_Failed - return 1 - fi - elif [ $(FS_Is_Target_A_TARXZ "$_target") -eq 0 ]; then - # unpack library - I18N_Assemble "$_target" "$__dest" - FS_Make_Directory "$__dest" - TAR_Extract_XZ "$__dest" "$_target" - if [ $? -ne 0 ]; then - I18N_Assemble_Failed - return 1 - fi - elif [ $(FS_Is_Target_A_ZIP "$_target") -eq 0 ]; then - # unpack library - I18N_Assemble "$_target" "$__dest" - FS_Make_Directory "$__dest" - ZIP_Extract "$__dest" "$_target" - if [ $? -ne 0 ]; then - I18N_Assemble_Failed - return 1 - fi - else - # copy library file - __dest="${__dest}/$(FS_Get_File "$_target")" - I18N_Assemble "$_target" "$__dest" - FS_Make_Directory "$__dest" - FS_Copy_File "$_target" "$__dest" - if [ $? -ne 0 ]; then - I18N_Assemble_Failed - return 1 - fi - fi - - _package="lib${PROJECT_SKU}" - elif [ $(FS_Is_Target_A_WASM_JS "$_target") -eq 0 ]; then - return 10 # not applicable - elif [ $(FS_Is_Target_A_WASM "$_target") -eq 0 ]; then - return 10 # not applicable - elif [ $(FS_Is_Target_A_Chocolatey "$_target") -eq 0 ]; then - return 10 # not applicable - elif [ $(FS_Is_Target_A_Homebrew "$_target") -eq 0 ]; then - return 10 # not applicable - elif [ $(FS_Is_Target_A_Cargo "$_target") -eq 0 ]; then - return 10 # not applicable - elif [ $(FS_Is_Target_A_MSI "$_target") -eq 0 ]; then - return 10 # not applicable - elif [ $(FS_Is_Target_A_PDF "$_target") -eq 0 ]; then - return 10 # not applicable - else - # copy main program - __dest="${_directory}/bin/${PROJECT_SKU}.exe" - - I18N_Assemble "$_target" "$__dest" - FS_Make_Housing_Directory "$__dest" - FS_Copy_File "$_target" "$__dest" - if [ $? -ne 0 ]; then - I18N_Assemble_Failed - return 1 - fi - - _package="${PROJECT_SKU}" - fi - - __source="${PROJECT_PATH_ROOT}/${PROJECT_PATH_SOURCE}/icons/icon-128x128.png" - __dest="${_directory}/icon.png" - I18N_Assemble "$__source" "$__dest" - FS_Copy_File "$__source" "$__dest" - if [ $? -ne 0 ]; then - I18N_Assemble_Failed - return 1 - fi - - __source="${PROJECT_PATH_ROOT}/${PROJECT_README}" - __dest="${_directory}/${PROJECT_README}" - 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" - FS_Make_Directory "$__dest" - if [ $? -ne 0 ]; then - I18N_Create_Failed - return 1 - fi - - - # OPTIONAL: chocolatey tools\chocolateyBeforeModify.ps1 - __dest="${_directory}/tools/chocolateyBeforeModify.ps1" - I18N_Create "$__dest" - FS_Write_File "$__dest" "\ -# REQUIRED - BEGIN EXECUTION -Write-Host \"Performing pre-configurations...\" -" - if [ $? -ne 0 ]; then - I18N_Create_Failed - return 1 - fi - - - # REQUIRED: chocolatey tools\chocolateyinstall.ps1 - __dest="${_directory}/tools/chocolateyinstall.ps1" - I18N_Create "$__dest" - FS_Write_File "$__dest" "\ -# REQUIRED - PREPARING INSTALLATION -Write-Host \"Installing ${PROJECT_SKU} (${PROJECT_VERSION})...\" -" - if [ $? -ne 0 ]; then - I18N_Create_Failed - return 1 - fi - - - # REQUIRED: chocolatey tools\chocolateyuninstall.ps1 - __dest="${_directory}/tools/chocolateyuninstall.ps1" - I18N_Create "$__dest" - FS_Write_File "$__dest" "\ -# REQUIRED - PREPARING UNINSTALLATION -Write-Host \"Uninstalling ${PROJECT_SKU} (${PROJECT_VERSION})...\" -" - if [ $? -ne 0 ]; then - I18N_Create_Failed - return 1 - fi - - - # REQUIRED: chocolatey xml.nuspec file - __dest="${_directory}/${_package}.nuspec" - I18N_Create "$__dest" - FS_Write_File "$__dest" "\ - - - - ${PROJECT_SKU} - ${PROJECT_NAME} - ${PROJECT_VERSION} - ${PROJECT_CONTACT_NAME} - ${PROJECT_CONTACT_NAME} - ${PROJECT_CONTACT_WEBSITE} - ${PROJECT_LICENSE} - ${PROJECT_PITCH} - ${PROJECT_README} - icon.png - - - - - - - -" - if [ $? -ne 0 ]; then - I18N_Create_Failed - return 1 - fi - - FS_Is_Directory_Empty "${_directory}/bin" - if [ $? -ne 0 ]; then - FS_Append_File "$__dest" "\ - -" - if [ $? -ne 0 ]; then - I18N_Create_Failed - return 1 - fi - fi - - FS_Is_Directory_Empty "${_directory}/lib" - if [ $? -ne 0 ]; then - FS_Append_File "$__dest" "\ - -" - if [ $? -ne 0 ]; then - I18N_Create_Failed - return 1 - fi - fi - - FS_Append_File "$__dest" "\ - - -" - if [ $? -ne 0 ]; then - I18N_Create_Failed - return 1 - fi - - - # execute - return 0 -} diff --git a/src/.ci/_package-chocolatey_windows-any.ps1 b/src/.ci/_package-chocolatey_windows-any.ps1 deleted file mode 100644 index 0bd8bd8..0000000 --- a/src/.ci/_package-chocolatey_windows-any.ps1 +++ /dev/null @@ -1,263 +0,0 @@ -# Copyright 2023 (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. - - - - -# initialize -if (-not (Test-Path -Path $env:PROJECT_PATH_ROOT)) { - Write-Error "[ ERROR ] - Please run from automataCI\ci.sh.ps1 instead!`n" - exit 1 -} - -. "${env:LIBS_AUTOMATACI}\services\io\fs.ps1" -. "${env:LIBS_AUTOMATACI}\services\i18n\translations.ps1" - - - - -function PACKAGE-Assemble-CHOCOLATEY-Content { - param ( - [string]$_target, - [string]$_directory, - [string]$_target_name, - [string]$_target_os, - [string]$_target_arch - ) - - - # validate project - switch ("${_target_os}") { - { $_ -in "any", "windows" } { - # accepted - } default { - return 10 # not supported - }} - - if ($(FS-Is-Target-A-Source "${_target}") -eq 0) { - return 10 # not applicable - } elseif ($(FS-Is-Target-A-Docs "${_target}") -eq 0) { - return 10 # not applicable - } elseif ($(FS-Is-Target-A-Library "${_target}") -eq 0) { - $__dest = "${_directory}\lib" - - if ($(FS-Is-Target-A-NPM "${_target}") -eq 0) { - return 10 # not applicable - } elseif ($(FS-Is-Target-A-TARGZ "${_target}") -eq 0) { - # unpack library - $null = I18N-Assemble "${_target}" "${__dest}" - $null = FS-Make-Directory "${__dest}" - $___process = TAR-Extract-GZ "${__dest}" "${_target}" - if ($___process -ne 0) { - $null = I18N-Assemble-Failed - return 1 - } - } elseif ($(FS-Is-Target-A-TARXZ "${_target}") -eq 0) { - # unpack library - $null = I18N-Assemble "${_target}" "${__dest}" - $null = FS-Make-Directory "${__dest}" - $___process = TAR-Extract-XZ "${__dest}" "${_target}" - if ($___process -ne 0) { - $null = I18N-Assemble-Failed - return 1 - } - } elseif ($(FS-Is-Target-A-ZIP "${_target}") -eq 0) { - # unpack library - $null = I18N-Assemble "${_target}" "${__dest}" - $null = FS-Make-Directory "${__dest}" - $___process = ZIP-Extract "${__dest}" "${_target}" - if ($___process -ne 0) { - $null = I18N-Assemble-Failed - return 1 - } - } else { - # copy library file - $__dest = "${__dest}\$(FS-Get-File "${_target}")" - $null = I18N-Assemble "${_target}" "${__dest}" - $null = FS-Make-Directory "${__dest}" - $___process = FS-Copy-File "${_target}" "${__dest}" - if ($___process -ne 0) { - $null = I18N-Assemble-Failed - return 1 - } - } - - $_package = "lib${env:PROJECT_SKU}" - } elseif ($(FS-Is-Target-A-WASM-JS "${_target}") -eq 0) { - return 10 # not applicable - } elseif ($(FS-Is-Target-A-WASM "${_target}") -eq 0) { - return 10 # not applicable - } elseif ($(FS-Is-Target-A-Chocolatey "${_target}") -eq 0) { - return 10 # not applicable - } elseif ($(FS-Is-Target-A-Homebrew "${_target}") -eq 0) { - return 10 # not applicable - } elseif ($(FS-Is-Target-A-Cargo "${_target}") -eq 0) { - return 10 # not applicable - } elseif ($(FS-Is-Target-A-MSI "${_target}") -eq 0) { - return 10 # not applicable - } elseif ($(FS-Is-Target-A-PDF "${_target}") -eq 0) { - return 10 # not applicable - } else { - # copy main program - $__dest = "${_directory}\bin\${env:PROJECT_SKU}.exe" - - $null = I18N-Assemble "${_target}" "${__dest}" - $null = FS-Make-Housing-Directory "${__dest}" - $___process = FS-Copy-File "${_target}" "${__dest}" - if ($___process -ne 0) { - $null = I18N-Assemble-Failed - return 1 - } - - $_package = "${env:PROJECT_SKU}" - } - - - $__source = "${env:PROJECT_PATH_ROOT}\${env:PROJECT_PATH_SOURCE}\icons\icon-128x128.png" - $__dest = "${_directory}\icon.png" - $null = I18N-Assemble "${__source}" "${__dest}" - $___process = FS-Copy-File "${__source}" "${__dest}" - if ($___process -ne 0) { - $null = I18N-Assemble-Failed - return 1 - } - - $__source = "${env:PROJECT_PATH_ROOT}\${env:PROJECT_README}" - $__dest = "${_directory}\${env:PROJECT_README}" - $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}" - $___process = FS-Make-Directory "${__dest}" - if ($___process -ne 0) { - $null = I18N-Create-Failed - return 1 - } - - - # OPTIONAL: chocolatey tools\chocolateyBeforeModify.ps1 - $__dest = "${_directory}\tools\chocolateyBeforeModify.ps1" - $null = I18N-Create "${__dest}" - $___process = FS-Write-File "${__dest}" @" -# REQUIRED - BEGIN EXECUTION -Write-Host "Performing pre-configurations..." -"@ - if ($___process -ne 0) { - $null = I18N-Create-Failed - return 1 - } - - - # REQUIRED: chocolatey tools\chocolateyinstall.ps1 - $__dest = "${_directory}\tools\chocolateyinstall.ps1" - $null = I18N-Create "${__dest}" - $___process = FS-Write-File "${__dest}" @" -# REQUIRED - PREPARING INSTALLATION -Write-Host "Installing ${env:PROJECT_SKU} (${env:PROJECT_VERSION})..." - -"@ - if ($___process -ne 0) { - $null = I18N-Create-Failed - return 1 - } - - - # REQUIRED: chocolatey tools\chocolateyuninstall.ps1 - $__dest = "${_directory}\tools\chocolateyuninstall.ps1" - $null = I18N-Create "${__dest}" - $___process = FS-Write-File "${__dest}" @" -# REQUIRED - PREPARING UNINSTALLATION -Write-Host "Uninstalling ${env:PROJECT_SKU} (${env:PROJECT_VERSION})..." - -"@ - if ($___process -ne 0) { - $null = I18N-Create-Failed - return 1 - } - - - # REQUIRED: chocolatey xml.nuspec file - $__dest = "${_directory}\${env:PROJECT_SKU}.nuspec" - $null = I18N-Create "${__dest}" - $___process = FS-Write-File "${__dest}" @" - - - - ${env:PROJECT_SKU} - ${env:PROJECT_NAME} - ${env:PROJECT_VERSION} - ${env:PROJECT_CONTACT_NAME} - ${env:PROJECT_CONTACT_NAME} - ${env:PROJECT_CONTACT_WEBSITE} - ${env:PROJECT_LICENSE} - ${env:PROJECT_PITCH} - ${env:PROJECT_README} - icon.png - - - - - - - - -"@ - if ($___process -ne 0) { - $null = I18N-Create-Failed - return 1 - } - - $___process = FS-Is-Directory-Empty "${_directory}\bin" - if ($___process -ne 0) { - $___process = FS-Append-File "${__dest}" @" - - -"@ - if ($___process -ne 0) { - $null = I18N-Create-Failed - return 1 - } - } - - $___process = FS-Is-Directory-Empty "${_directory}\lib" - if ($___process -ne 0) { - $___process = FS-Append-File "${__dest}" @" - - -"@ - if ($___process -ne 0) { - $null = I18N-Create-Failed - return 1 - } - } - - $___process = FS-Append-File "${__dest}" @" - - - -"@ - if ($___process -ne 0) { - $null = I18N-Create-Failed - return 1 - } - - - # report status - return 0 -} diff --git a/src/.ci/_package-lib_unix-any.sh b/src/.ci/_package-lib_unix-any.sh deleted file mode 100644 index 3e2324b..0000000 --- a/src/.ci/_package-lib_unix-any.sh +++ /dev/null @@ -1,244 +0,0 @@ -#!/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/io/fs.sh" -. "${LIBS_AUTOMATACI}/services/io/strings.sh" -. "${LIBS_AUTOMATACI}/services/archive/tar.sh" -. "${LIBS_AUTOMATACI}/services/archive/zip.sh" -. "${LIBS_AUTOMATACI}/services/i18n/translations.sh" - - - - -# initialize -if [ "$PROJECT_PATH_ROOT" = "" ]; then - >&2 printf "[ ERROR ] - Please run from automataCI/ci.sh.ps1 instead!\n" - return 1 -fi - - - - -PACKAGE_Assemble_LIB_Content() { - _target="$1" - _directory="$2" - _target_name="$3" - _target_os="$4" - _target_arch="$5" - - - # validate project - if [ $(FS_Is_Target_A_Library "$_target") -ne 0 ]; then - return 10 # not applicable - fi - - - # execute - _workspace="packagers-lib-$(FS_Get_File "$_target")" - _workspace="${PROJECT_PATH_ROOT}/${PROJECT_PATH_TEMP}/${_workspace}" - FS_Remove_Silently "$_workspace" - - __dest="${_workspace}/lib" - if [ $(FS_Is_Target_A_NPM "$_target") -eq 0 ]; then - # copy over - do not further modify its content anymore - __dest="lib${PROJECT_SKU}-NPM_${PROJECT_VERSION}_js-js.tgz" - __dest="${_directory}/${__dest}" - I18N_Copy "$_target" "$__dest" - FS_Copy_File "$_target" "$__dest" - if [ $? -ne 0 ]; then - I18N_Copy_Failed - return 1 - fi - - return 0 - elif [ $(FS_Is_Target_A_TARGZ "$_target") -eq 0 ]; then - # unpack library - I18N_Assemble "$_target" "$__dest" - FS_Make_Directory "$__dest" - TAR_Extract_GZ "$__dest" "$_target" - if [ $? -ne 0 ]; then - I18N_Copy_Failed - return 1 - fi - elif [ $(FS_Is_Target_A_TARXZ "$_target") -eq 0 ]; then - # unpack library - I18N_Assemble "$_target" "$__dest" - FS_Make_Directory "$__dest" - TAR_Extract_XZ "$__dest" "$_target" - if [ $? -ne 0 ]; then - I18N_Copy_Failed - return 1 - fi - elif [ $(FS_Is_Target_A_ZIP "$_target") -eq 0 ]; then - # unpack library - I18N_Assemble "$_target" "$__dest" - FS_Make_Directory "$__dest" - ZIP_Extract "$__dest" "$_target" - if [ $? -ne 0 ]; then - I18N_Assemble_Failed - return 1 - fi - else - # assumed it is a standalone library file - I18N_Assemble "$_target" "$__dest" - FS_Make_Directory "$__dest" - FS_Copy_File "$_target" "$__dest" - if [ $? -ne 0 ]; then - I18N_Assemble_Failed - return 1 - fi - fi - - - # sanity check before proceeding - FS_Is_Directory_Empty "$__dest" - if [ $? -eq 0 ]; then - I18N_Assemble_Failed - return 1 - fi - - - # copy README.md - __source="${PROJECT_PATH_ROOT}/${PROJECT_README}" - __dest="${_workspace}/${PROJECT_README}" - I18N_Assemble "$__source" "$__dest" - FS_Copy_File "$__source" "$__dest" - if [ $? -ne 0 ]; then - I18N_Assemble_Failed - return 1 - fi - - - # copy user guide files - for __source in "${PROJECT_PATH_ROOT}/${PROJECT_PATH_SOURCE}/docs/USER-GUIDES"*.pdf; do - FS_Is_Target_Exist "$__source" - if [ $? -ne 0 ]; then - continue - fi - - __dest="${_workspace}/$(FS_Get_File "$__source")" - I18N_Copy "$__source" "$__dest" - FS_Copy_File "$__source" "$__dest" - if [ $? -ne 0 ]; then - I18N_Copy_Failed - return 1 - fi - done - - - # copy license files - for __source in "${PROJECT_PATH_ROOT}/${PROJECT_PATH_SOURCE}/licenses/LICENSE"*.pdf; do - FS_Is_Target_Exist "$__source" - if [ $? -ne 0 ]; then - continue - fi - - __dest="${_workspace}/$(FS_Get_File "$__source")" - I18N_Copy "$__source" "$__dest" - FS_Copy_File "$__source" "$__dest" - if [ $? -ne 0 ]; then - I18N_Copy_Failed - return 1 - fi - done - - - # assemble icon.png - __source="${PROJECT_PATH_ROOT}/${PROJECT_PATH_SOURCE}/icons/icon-128x128.png" - __dest="${_workspace}/icon.png" - I18N_Assemble "$__source" "$__dest" - FS_Copy_File "$__source" "$__dest" - if [ $? -ne 0 ]; then - I18N_Assemble_Failed - return 1 - fi - - - # begin packaging - __current_path="$PWD" && cd "$_workspace" - - ## package tar.xz - __dest="lib${PROJECT_SKU}_${PROJECT_VERSION}_${_target_os}-${_target_arch}.tar.xz" - I18N_Create_Package "$__dest" - __dest="${_directory}/${__dest}" - TAR_Create_XZ "$__dest" "." - if [ $? -ne 0 ]; then - I18N_Create_Failed - cd "$__current_path" && unset __current_path - return 1 - fi - - ## package zip - __dest="lib${PROJECT_SKU}_${PROJECT_VERSION}_${_target_os}-${_target_arch}.zip" - I18N_Create_Package "$__dest" - __dest="${_directory}/${__dest}" - ZIP_Create "$__dest" "." - if [ $? -ne 0 ]; then - I18N_Create_Failed - cd "$__current_path" && unset __current_path - return 1 - fi - - ## package nupkg - __acceptance="false" - if [ $(STRINGS_To_Lowercase "$PROJECT_LICENSE_ACCEPTANCE_REQUIRED") = "true" ]; then - __acceptance="true" - fi - - __dest="lib${PROJECT_SKU}.nuspec" - I18N_Create "$__dest" - FS_Write_File "./${__dest}" "\ - - - - ${PROJECT_SKU} - ${PROJECT_VERSION} - ${PROJECT_CONTACT_NAME} - ${PROJECT_CONTACT_NAME} - ${PROJECT_SOURCE_URL} - ${PROJECT_NAME} - ${PROJECT_PITCH} - ${PROJECT_LICENSE} - ${__acceptance} - ${PROJECT_README} - icon.png - - - - - - - -" - if [ $? -ne 0 ]; then - I18N_Create_Failed - cd "$__current_path" && unset __current_path - return 1 - fi - - __dest="lib${PROJECT_SKU}_${PROJECT_VERSION}_${_target_os}-${_target_arch}.nupkg" - I18N_Create_Package "$__dest" - __dest="${_directory}/${__dest}" - ZIP_Create "$__dest" "." - if [ $? -ne 0 ]; then - I18N_Create_Failed - cd "$__current_path" && unset __current_path - return 1 - fi - - ## done - clean up - cd "$__current_path" && unset __current_path - - - # report status - return 0 -} diff --git a/src/.ci/_package-lib_windows-any.ps1 b/src/.ci/_package-lib_windows-any.ps1 deleted file mode 100644 index 9cdd117..0000000 --- a/src/.ci/_package-lib_windows-any.ps1 +++ /dev/null @@ -1,246 +0,0 @@ -# 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\io\fs.ps1" -. "${env:LIBS_AUTOMATACI}\services\io\strings.ps1" -. "${env:LIBS_AUTOMATACI}\services\archive\tar.ps1" -. "${env:LIBS_AUTOMATACI}\services\archive\zip.ps1" -. "${env:LIBS_AUTOMATACI}\services\i18n\translations.ps1" - - - - -# initialize -if (-not (Test-Path -Path $env:PROJECT_PATH_ROOT)) { - Write-Error "[ ERROR ] - Please run from automataCI\ci.sh.ps1 instead!`n" - exit 1 -} - - - - -function PACKAGE-Assemble-LIB-Content { - param ( - [string]$_target, - [string]$_directory, - [string]$_target_name, - [string]$_target_os, - [string]$_target_arch - ) - - - # validate project - if ($(FS-Is-Target-A-Library "${_target}") -ne 0) { - return 10 # not applicable - } - - - # execute - $_workspace = "packagers-lib-lib${env:PROJECT_SKU}_${_target_os}-${_target_arch}" - $_workspace = "${env:PROJECT_PATH_ROOT}\${env:PROJECT_PATH_TEMP}\${_workspace}" - $null = FS-Remove-Silently "${_workspace}" - - $__dest = "${_workspace}\lib" - if ($(FS-Is-Target-A-NPM "${_target}") -eq 0) { - # copy over - do not modify anymore - $__dest = "lib${env:PROJECT_SKU}-NPM_${env:PROJECT_VERSION}_js-js.tgz" - $__dest = "${_directory}\${__dest}" - $null = I18N-Copy "${_target}" "${__dest}" - $___process = FS-Copy-File "${_target}" "${__dest}" - if ($___process -ne 0) { - $null = I18N-Copy-Failed - return 1 - } - - return 0 - } elseif ($(FS-Is-Target-A-TARGZ "${_target}") -eq 0) { - # unpack library - $null = I18N-Assemble "${_target}" "${__dest}" - $null = FS-Make-Directory "${__dest}" - $___process = TAR-Extract-GZ "${__dest}" "${_target}" - if ($___process -ne 0) { - $null = I18N-Assemble-Failed - return 1 - } - } elseif ($(FS-Is-Target-A-TARXZ "${_target}") -eq 0) { - # unpack library - $null = I18N-Assemble "${_target}" "${__dest}" - $null = FS-Make-Directory "${__dest}" - $___process = TAR-Extract-XZ "${__dest}" "${_target}" - if ($___process -ne 0) { - $null = I18N-Assemble-Failed - return 1 - } - } elseif ($(FS-Is-Target-A-ZIP "${_target}") -eq 0) { - # unpack library - $null = I18N-Assemble "${_target}" "${__dest}" - $null = FS-Make-Directory "${__dest}" - $___process = ZIP-Extract "${__dest}" "${_target}" - if ($___process -ne 0) { - $null = I18N-Assemble-Failed - return 1 - } - } else { - # assumed it is a standalone library file - $null = I18N-Assemble "${_target}" "${__dest}" - $null = FS-Make-Directory "${__dest}" - $___process = FS-Copy-File "${_target}" "${__dest}" - if ($___process -ne 0) { - $null = I18N-Assemble-Failed - return 1 - } - } - - - # sanity check before proceeding - $___process = FS-Is-Directory-Empty "${__dest}" - if ($___process -eq 0) { - $null = I18N-Assemble-Failed - return 1 - } - - - # copy README.md - $__source = "${env:PROJECT_PATH_ROOT}\${env:PROJECT_README}" - $__dest = "${_workspace}\${env:PROJECT_README}" - $null = I18N-Assemble "${__source}" "${__dest}" - $___process = FS-Copy-File "${__source}" "${__dest}" - if ($___process -ne 0) { - $null = I18N-Assemble-Failed - return 1 - } - - - # 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 - $__dest = "${_workspace}\$(FS-Get-File "${__source}")" - $null = I18N-Assemble "${__source}" "${__dest}" - $___process = FS-Copy-File "${__source}" "${__dest}" - if ($___process -ne 0) { - $null = I18N-Assemble-Failed - return 1 - } - } - - - # 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 - $__dest = "${_workspace}\$(FS-Get-File "${__source}")" - $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" - $null = I18N-Assemble "${__source}" "${__dest}" - $___process = FS-Copy-File "${__source}" "${__dest}" - if ($___process -ne 0) { - $null = I18N-Assemble-Failed - return 1 - } - - - # begin packaging - $__current_path = Get-Location - $null = Set-Location -Path "${_workspace}" - - ## package tar.xz - $__dest = "lib${env:PROJECT_SKU}_${env:PROJECT_VERSION}_${_target_os}-${_target_arch}.tar.xz" - $null = I18N-Create-Package "${__dest}" - $__dest = "${_directory}\${__dest}" - $___process = TAR-Create-XZ "${__dest}" "." - if ($___process -ne 0) { - $null = I18N-Create-Failed - $null = Set-Location -Path "${__current_path}" - $null = Remove-Variable -Name __current_path - return 1 - } - - ## package zip - $__dest = "lib${env:PROJECT_SKU}_${env:PROJECT_VERSION}_${_target_os}-${_target_arch}.zip" - $null = I18N-Create-Package "${__dest}" - $__dest = "${_directory}\${__dest}" - $___process = ZIP-Create "${__dest}" "." - if ($___process -ne 0) { - $null = I18N-Create-Failed - $null = Set-Location -Path "${__current_path}" - $null = Remove-Variable -Name __current_path - return 1 - } - - ## package nupkg - $__acceptance = "false" - if ($(STRINGS-To-Lowercase "${env:PROJECT_LICENSE_ACCEPTANCE_REQUIRED}") -eq "true") { - $__acceptance = "true" - } - - $__dest = "lib${env:PROJECT_SKU}.nuspec" - $null = I18N-Create "${__dest}" - $__dest = ".\${__dest}" - $___process = FS-Write-File "${__dest}" @" - - - - ${env:PROJECT_SKU} - ${env:PROJECT_VERSION} - ${env:PROJECT_CONTACT_NAME} - ${env:PROJECT_CONTACT_NAME} - ${env:PROJECT_SOURCE_URL} - ${env:PROJECT_NAME} - ${env:PROJECT_PITCH} - ${env:PROJECT_LICENSE} - ${__acceptance} - ${env:PROJECT_README} - - - - - - - - -"@ - if ($___process -ne 0) { - $null = I18N-Create-Failed - $null = Set-Location -Path "${__current_path}" - $null = Remove-Variable -Name __current_path - return 1 - } - - $__dest = "lib${env:PROJECT_SKU}_${env:PROJECT_VERSION}_${_target_os}-${_target_arch}.nupkg" - $null = I18N-Create-Package "${__dest}" - $__dest = "${_directory}\${__dest}" - $___process = ZIP-Create "${__dest}" "." - if ($___process -ne 0) { - $null = I18N-Create-Failed - $null = Set-Location -Path "${__current_path}" - $null = Remove-Variable -Name __current_path - return 1 - } - - ## done - clean up - $null = Set-Location -Path "${__current_path}" - $null = Remove-Variable -Name __current_path - - - # report status - return 0 -} diff --git a/src/.ci/_package-pdf_unix-any.sh b/src/.ci/_package-pdf_unix-any.sh deleted file mode 100644 index a9d8735..0000000 --- a/src/.ci/_package-pdf_unix-any.sh +++ /dev/null @@ -1,54 +0,0 @@ -#!/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/io/fs.sh" -. "${LIBS_AUTOMATACI}/services/i18n/translations.sh" - - - - -# initialize -if [ "$PROJECT_PATH_ROOT" = "" ]; then - >&2 printf "[ ERROR ] - Please run from automataCI/ci.sh.ps1 instead!\n" - return 1 -fi - - - - -PACKAGE_Assemble_PDF_Content() { - _target="$1" - _directory="$2" - _target_name="$3" - _target_os="$4" - _target_arch="$5" - - - # validate project - if [ $(FS_Is_Target_A_PDF "$_target") -ne 0 ]; then - return 10 # not applicable - fi - - - # execute - __dest="${_directory}/$(FS_Get_File "$_target")" - I18N_Copy "$_target" "$__dest" - FS_Copy_File "$_target" "$__dest" - if [ $? -ne 0 ]; then - I18N_Copy_Failed - return 1 - fi - - - # report status - return 0 -} diff --git a/src/.ci/_package-pdf_windows-any.ps1 b/src/.ci/_package-pdf_windows-any.ps1 deleted file mode 100644 index e769fe5..0000000 --- a/src/.ci/_package-pdf_windows-any.ps1 +++ /dev/null @@ -1,55 +0,0 @@ -# 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\io\fs.ps1" -. "${env:LIBS_AUTOMATACI}\services\i18n\translations.ps1" - - - - -# initialize -if (-not (Test-Path -Path $env:PROJECT_PATH_ROOT)) { - Write-Error "[ ERROR ] - Please run from automataCI\ci.sh.ps1 instead!`n" - exit 1 -} - - - - -function PACKAGE-Assemble-PDF-Content { - param ( - [string]$_target, - [string]$_directory, - [string]$_target_name, - [string]$_target_os, - [string]$_target_arch - ) - - - # validate project - if ($(FS-Is-Target-A-PDF "${_target}") -ne 0) { - return 10 # not applicable - } - - - # execute - $__dest = "${_directory}\$(FS-Get-File "${_target}")" - $null = I18N-Copy "${_target}" "${__dest}" - $___process = FS-Copy-File "${_target}" "${__dest}" - if ($___process -ne 0) { - $null = I18N-Copy-Failed - return 1 - } - - - # report status - return 0 -} diff --git a/src/.ci/_package-pypi_unix-any.sh b/src/.ci/_package-pypi_unix-any.sh deleted file mode 100644 index bd8308d..0000000 --- a/src/.ci/_package-pypi_unix-any.sh +++ /dev/null @@ -1,36 +0,0 @@ -#!/bin/sh -# Copyright 2023 (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. - - - - -# initialize -if [ "$PROJECT_PATH_ROOT" = "" ]; then - >&2 printf "[ ERROR ] - Please run from automataCI/ci.sh.ps1 instead!\n" - return 1 -fi - - - - -PACKAGE_Assemble_PYPI_Content() { - _target="$1" - _directory="$2" - _target_name="$3" - _target_os="$4" - _target_arch="$5" - - - # execute - return 10 # IMPORTANT: please do it inside python source instead. -} diff --git a/src/.ci/_package-pypi_windows-any.ps1 b/src/.ci/_package-pypi_windows-any.ps1 deleted file mode 100644 index af4f437..0000000 --- a/src/.ci/_package-pypi_windows-any.ps1 +++ /dev/null @@ -1,37 +0,0 @@ -# Copyright 2023 (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. - - - - -# initialize -if (-not (Test-Path -Path $env:PROJECT_PATH_ROOT)) { - Write-Error "[ ERROR ] - Please run from automataCI\ci.sh.ps1 instead!`n" - return 1 -} - - - - -function PACKAGE-Assemble-PYPI-Content { - param ( - [string]$_target, - [string]$_directory, - [string]$_target_name, - [string]$_target_os, - [string]$_target_arch - ) - - - # execute - return 10 # IMPORTANT: please do it inside python source instead. -} diff --git a/src/.ci/package-archive_unix-any.sh b/src/.ci/package-archive_unix-any.sh new file mode 100644 index 0000000..5a60618 --- /dev/null +++ b/src/.ci/package-archive_unix-any.sh @@ -0,0 +1,130 @@ +#!/bin/sh +# Copyright 2023 (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. + + + + +# initialize +if [ "$PROJECT_PATH_ROOT" = "" ]; then + >&2 printf "[ ERROR ] - Please run from automataCI/ci.sh.ps1 instead!\n" + return 1 +fi + +. "${LIBS_AUTOMATACI}/services/hestiaCONSOLE/Vanilla.sh.ps1" +. "${LIBS_AUTOMATACI}/services/hestiaFS/Vanilla.sh.ps1" +. "${LIBS_AUTOMATACI}/services/hestiaKERNEL/Vanilla.sh.ps1" +. "${LIBS_AUTOMATACI}/services/hestiaMSI/Vanilla.sh.ps1" +. "${LIBS_AUTOMATACI}/services/hestiaPDF/Vanilla.sh.ps1" +. "${LIBS_AUTOMATACI}/services/hestiaWASM/Vanilla.sh.ps1" + +. "${LIBS_AUTOMATACI}/__package-assemble-archive_unix-any.sh" + + + + +PACKAGE_Assemble_ARCHIVE_Content() { + _target="$1" + _directory="$2" + _target_name="$3" + _target_os="$4" + _target_arch="$5" + + + # validate input + if [ $(hestiaMSI_Is_Target_Valid "$_target") -eq $hestiaKERNEL_ERROR_OK ] || + [ $(hestiaPDF_Is_Target_Valid "$_target") -eq $hestiaKERNEL_ERROR_OK ] || + [ $(hestiaWASM_Is_Target_Valid_JS "$_target") -eq $hestiaKERNEL_ERROR_OK ]; then + return $hestiaKERNEL_ERROR_CANCELLED # not applicable + fi + + + # IMPORTANT NOTES: + # (1) It's your choice to assemble the content of the package as per + # your use cases. By default, AutomataCI offers FHS content + # assembly function ('PACKAGE_Assemble_As_FSH') that you can use. + # + # (2) Duly noted that this is a multi-pipelines task where it produces + # the following artifacts in sequences: + # (2.1) NPM.tgz (when enabled & detected) + # (2.2) RUST.crate (when enabled & detected) + # (2.3) .tar.xz (when enabled) + # (2.4) .zip (when enabled) + # (2.5) chocolatey.nupkg (when enabled) + # (2.6) dotnet.nupkg (when enabled) + # + # (3) If you wish to customize chocolatey tool scripts, apply into + # ${PROJECT_PATH_ROOT}/${PROJECT_PATH_SOURCE}/data/chocolatey/tools + # directory. They will be appeneded during packaging process. + # + # (4) Dated to this note, there is no need to customize .nuspec file + # since they are heavily governed by specifications. AutomataCI + # currently generate them autonomously with files detections. + # Hence, you only need to place the content as it would appear at + # client side. + PACKAGE_Assemble_As_ARCHIVE \ + "$_target" \ + "$_directory" \ + "$_target_name" \ + "$_target_os" \ + "$_target_arch" + if [ $? -ne $hestiaKERNEL_ERROR_OK ]; then + return $hestiaKERNEL_ERROR_BAD_EXEC + fi + + + # copy user guide files for all languages + for __source in "${PROJECT_PATH_ROOT}/${PROJECT_PATH_SOURCE}/docs/USER-GUIDES"*.pdf; do + if [ $(hestiaFS_Is_Exist "$__source") -ne $hestiaKERNEL_ERROR_OK ]; then + continue + fi + + __dest="${_directory}/$(hestiaFS_Get_File "$__source")" + hestiaCONSOLE_Log_Assemble "$__dest" "$_target" + hestiaFS_Copy_File "$__dest" "$__source" + if [ $? -ne $hestiaKERNEL_ERROR_OK ]; then + hestiaCONSOLE_Log_Assemble_Failed + return $hestiaKERNEL_ERROR_BAD_EXEC + fi + done + + + # copy license files for all languages + for __source in "${PROJECT_PATH_ROOT}/${PROJECT_PATH_SOURCE}/licenses/LICENSE"*.pdf; do + if [ $(hestiaFS_Is_Exist "$__source") -ne $hestiaKERNEL_ERROR_OK ]; then + continue + fi + + __dest="${_directory}/$(hestiaFS_Get_File "$__source")" + hestiaCONSOLE_Log_Assemble "$__dest" "$_target" + hestiaFS_Copy_File "$__dest" "$__source" + if [ $? -ne $hestiaKERNEL_ERROR_OK ]; then + hestiaCONSOLE_Log_Assemble_Failed + return $hestiaKERNEL_ERROR_BAD_EXEC + fi + done + + + # REQUIRED: assemble icon.png + __source="${PROJECT_PATH_ROOT}/${PROJECT_PATH_SOURCE}/icons/icon-128x128.png" + __dest="${_directory}/icon.png" + hestiaCONSOLE_Log_Assemble "$__dest" "$_target" + hestiaFS_Copy_File "$__dest" "$__source" + if [ $? -ne $hestiaKERNEL_ERROR_OK ]; then + hestiaCONSOLE_Log_Assemble_Failed + return $hestiaKERNEL_ERROR_BAD_EXEC + fi + + + # report status + return $hestiaKERNEL_ERROR_OK +} diff --git a/src/.ci/package-archive_windows-any.ps1 b/src/.ci/package-archive_windows-any.ps1 new file mode 100644 index 0000000..628f927 --- /dev/null +++ b/src/.ci/package-archive_windows-any.ps1 @@ -0,0 +1,137 @@ +#!/bin/sh +# Copyright 2023 (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. + + + + +# initialize +if (-not (Test-Path -Path $env:PROJECT_PATH_ROOT)) { + Write-Error "[ ERROR ] - Please run from automataCI\ci.sh.ps1 instead!`n" + return 1 +} + +. "${env:LIBS_AUTOMATACI}\services\hestiaCONSOLE\Vanilla.sh.ps1" +. "${env:LIBS_AUTOMATACI}\services\hestiaFS\Vanilla.sh.ps1" +. "${env:LIBS_AUTOMATACI}\services\hestiaKERNEL\Vanilla.sh.ps1" +. "${env:LIBS_AUTOMATACI}\services\hestiaMSI\Vanilla.sh.ps1" +. "${env:LIBS_AUTOMATACI}\services\hestiaPDF\Vanilla.sh.ps1" +. "${env:LIBS_AUTOMATACI}\services\hestiaWASM\Vanilla.sh.ps1" + +. "${env:LIBS_AUTOMATACI}\__package-assemble-archive_windows-any.ps1" + + + + +function PACKAGE-Assemble-ARCHIVE-Content { + param ( + [string]$_target, + [string]$_directory, + [string]$_target_name, + [string]$_target_os, + [string]$_target_arch + ) + + + # validate input + if ( + ($(hestiaMSI-Is-Target-Valid "${_target}") -eq $hestiaKERNEL_ERROR_OK) -or + ($(hestiaPDF-Is-Target-Valid "${_target}") -eq $hestiaKERNEL_ERROR_OK) -or + ($(hestiaWASM-Is-Target-Valid-JS "${_target}") -eq $hestiaKERNEL_ERROR_OK) + ) { + return ${env:hestiaKERNEL_ERROR_CANCELLED} # not applicable + } + + + # IMPORTANT NOTES: + # (1) It's your choice to assemble the content of the package as per + # your use cases. By default, AutomataCI offers FHS content + # assembly function ('PACKAGE_Assemble_As_FSH') that you can use. + # + # (2) Duly noted that this is a multi-pipelines task where it produces + # the following artifacts in sequences: + # (2.1) NPM.tgz (when enabled & detected) + # (2.2) RUST.crate (when enabled & detected) + # (2.1) .tar.xz (when enabled) + # (2.2) .zip (when enabled) + # (2.3) chocolatey.nupkg (when enabled) + # (2.4) dotnet.nupkg (when enabled) + # + # (3) If you wish to customize chocolatey tool scripts, apply into + # ${PROJECT_PATH_ROOT}/${PROJECT_PATH_SOURCE}/data/chocolatey/tools + # directory. They will be appeneded during packaging process. + # + # (4) Dated to this note, there is no need to customize .nuspec file + # since they are heavily governed by specifications. AutomataCI + # currently generate them autonomously with files detections. + # Hence, you only need to place the content as it would appear at + # client side. + #$___process = PACKAGE-Assemble-As-ARCHIVE ` + # "${_target}" ` + # "${_directory}" ` + # "${_target_name}" ` + # "${_target_os}" ` + # "${_target_arch}" + #if ($___process -ne ${env:hestiaKERNEL_ERROR_OK}) { + # return ${env:hestiaKERNEL_ERROR_BAD_EXEC} + #} + + + # copy user guide files for all languages + #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 + # if ($(hestiaFS-Is-Exist "${__source}") -ne ${env:hestiaKERNEL_ERROR_OK}) { + # continue + # } + + # $__dest = "${_directory}\$(hestiaFS-Get-File "${__source}")" + # $null = hestiaCONSOLE-Log-Assemble "${__dest}" "${_target}" + # $___process = hestiaFS-Copy-File "${__dest}" "${__source}" + # if ($___process -ne ${env:hestiaKERNEL_ERROR_OK}) { + # $null = hestiaCONSOLE-Log-Assemble-Failed + # return ${env:hestiaKERNEL_ERROR_BAD_EXEC} + # } + #} + + + # copy license files for all languages + foreach ($__source in (Get-ChildItem ` + -File ` + -Path "${env:PROJECT_PATH_ROOT}\${env:PROJECT_PATH_SOURCE}\licenses" ` + | where { ($_ -like "*LICENSE*.pdf") } + )) { + $__source = $__source.FullName + $__dest = "${_directory}\$(hestiaFS-Get-File "${__source}")" + #$null = hestiaCONSOLE-Log-Assemble "${__dest}" "${_target}" + #$___process = hestiaFS-Copy-File "${__dest}" "${__source}" + #if ($___process -ne ${env:hestiaKERNEL_ERROR_OK}) { + # $null = hestiaCONSOLE-Log-Assemble-Failed + # return ${env:hestiaKERNEL_ERROR_BAD_EXEC} + #} + } + + + # REQUIRED: assemble icon.png + $__source = "${env:PROJECT_PATH_ROOT}\${env:PROJECT_PATH_SOURCE}\icons\icon-128x128.png" + $__dest = "${_directory}\icon.png" + $null = hestiaCONSOLE-Log-Assemble "${__dest}" "${_target}" + $___process = hestiaFS-Copy-File "${__dest}" "${__source}" + if ($___process -ne ${env:hestiaKERNEL_ERROR_OK}) { + $null = hestiaCONSOLE-Log-Assemble-Failed + return ${env:hestiaKERNEL_ERROR_BAD_EXEC} + } + + + # report status + return ${env:hestiaKERNEL_ERROR_OK} +} diff --git a/src/.ci/package-single_unix-any.sh b/src/.ci/package-single_unix-any.sh new file mode 100644 index 0000000..8a7cd2e --- /dev/null +++ b/src/.ci/package-single_unix-any.sh @@ -0,0 +1,47 @@ +#!/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}/__package-assemble-default-single-content_unix-any.sh" + + + + +# initialize +if [ "$PROJECT_PATH_ROOT" = "" ]; then + >&2 printf "[ ERROR ] - Please run from automataCI/ci.sh.ps1 instead!\n" + return 1 +fi + + + + +PACKAGE_Assemble_Single_Content() { + #_target="$1" + #_directory="$2" + #_target_name="$3" + #_target_os="$4" + #_target_arch="$5" + + + # execute + # IMPORTANT NOTICE: + # AutomataCI supplies default function called + # 'PACKAGE_Assemble_Default_Single_Content' from the subroutine + # library: + # '__package-assemble-default-single-content_unix-any.sh'. + # + # You may remove it and customize the assembly behavior on your + # own. This function only affects single content built artifacts + # like PDF and etc. + PACKAGE_Assemble_Default_Single_Content "$1" "$2" "$3" "$4" "$5" + return $? +} diff --git a/src/.ci/package-single_windows-any.ps1 b/src/.ci/package-single_windows-any.ps1 new file mode 100644 index 0000000..38c76c1 --- /dev/null +++ b/src/.ci/package-single_windows-any.ps1 @@ -0,0 +1,53 @@ +#!/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. +. "${env:LIBS_AUTOMATACI}\__package-assemble-default-single-content_windows-any.ps1" + + + + +# initialize +if (-not (Test-Path -Path $env:PROJECT_PATH_ROOT)) { + Write-Error "[ ERROR ] - Please run from automataCI\ci.sh.ps1 instead!`n" + return 1 +} + + + + +function PACKAGE-Assemble-Single-Content { + param ( + [string]$_target, + [string]$_directory, + [string]$_target_name, + [string]$_target_os, + [string]$_target_arch + ) + + + # execute + # IMPORTANT NOTICE: + # AutomataCI supplies default function called + # 'PACKAGE-Assemble-Default-Single-Content' from the subroutine + # library: + # '__package-assemble-default-single-content_windows-any.ps1'. + # + # You may remove it and customize the assembly behavior on your + # own. This function only affects single content built artifacts + # like PDF and etc. + return PACKAGE-Assemble-Default-Single-Content ` + "${_target}" ` + "${_directory}" ` + "${_target_name}" ` + "${_target_os}" ` + "${_target_arch}" +} diff --git a/src/.ci/package_unix-any.sh b/src/.ci/package_unix-any.sh index e81727d..f148ad6 100644 --- a/src/.ci/package_unix-any.sh +++ b/src/.ci/package_unix-any.sh @@ -20,18 +20,12 @@ if [ "$PROJECT_PATH_ROOT" == "" ]; then return 1 fi -. "${PROJECT_PATH_ROOT}/${PROJECT_PATH_SOURCE}/${PROJECT_PATH_CI}/_package-archive_unix-any.sh" -. "${PROJECT_PATH_ROOT}/${PROJECT_PATH_SOURCE}/${PROJECT_PATH_CI}/_package-cargo_unix-any.sh" -. "${PROJECT_PATH_ROOT}/${PROJECT_PATH_SOURCE}/${PROJECT_PATH_CI}/_package-chocolatey_unix-any.sh" . "${PROJECT_PATH_ROOT}/${PROJECT_PATH_SOURCE}/${PROJECT_PATH_CI}/_package-deb_unix-any.sh" . "${PROJECT_PATH_ROOT}/${PROJECT_PATH_SOURCE}/${PROJECT_PATH_CI}/_package-docker_unix-any.sh" . "${PROJECT_PATH_ROOT}/${PROJECT_PATH_SOURCE}/${PROJECT_PATH_CI}/_package-flatpak_unix-any.sh" . "${PROJECT_PATH_ROOT}/${PROJECT_PATH_SOURCE}/${PROJECT_PATH_CI}/_package-homebrew_unix-any.sh" . "${PROJECT_PATH_ROOT}/${PROJECT_PATH_SOURCE}/${PROJECT_PATH_CI}/_package-ipk_unix-any.sh" -. "${PROJECT_PATH_ROOT}/${PROJECT_PATH_SOURCE}/${PROJECT_PATH_CI}/_package-lib_unix-any.sh" . "${PROJECT_PATH_ROOT}/${PROJECT_PATH_SOURCE}/${PROJECT_PATH_CI}/_package-msi_unix-any.sh" -. "${PROJECT_PATH_ROOT}/${PROJECT_PATH_SOURCE}/${PROJECT_PATH_CI}/_package-pdf_unix-any.sh" -. "${PROJECT_PATH_ROOT}/${PROJECT_PATH_SOURCE}/${PROJECT_PATH_CI}/_package-pypi_unix-any.sh" . "${PROJECT_PATH_ROOT}/${PROJECT_PATH_SOURCE}/${PROJECT_PATH_CI}/_package-rpm_unix-any.sh" diff --git a/src/.ci/package_windows-any.ps1 b/src/.ci/package_windows-any.ps1 index 6423336..5fba29c 100644 --- a/src/.ci/package_windows-any.ps1 +++ b/src/.ci/package_windows-any.ps1 @@ -15,22 +15,16 @@ # initialize if (-not (Test-Path -Path $env:PROJECT_PATH_ROOT)) { - Write-Error "[ ERROR ] - Please run from automataCI\ci.sh.ps1 instead!`n" - return 1 + Write-Error "[ ERROR ] - Please run from automataCI\ci.sh.ps1 instead!`n" + return 1 } -. "${env:PROJECT_PATH_ROOT}\${env:PROJECT_PATH_SOURCE}\${env:PROJECT_PATH_CI}\_package-archive_windows-any.ps1" -. "${env:PROJECT_PATH_ROOT}\${env:PROJECT_PATH_SOURCE}\${env:PROJECT_PATH_CI}\_package-cargo_windows-any.ps1" -. "${env:PROJECT_PATH_ROOT}\${env:PROJECT_PATH_SOURCE}\${env:PROJECT_PATH_CI}\_package-chocolatey_windows-any.ps1" . "${env:PROJECT_PATH_ROOT}\${env:PROJECT_PATH_SOURCE}\${env:PROJECT_PATH_CI}\_package-deb_windows-any.ps1" . "${env:PROJECT_PATH_ROOT}\${env:PROJECT_PATH_SOURCE}\${env:PROJECT_PATH_CI}\_package-docker_windows-any.ps1" . "${env:PROJECT_PATH_ROOT}\${env:PROJECT_PATH_SOURCE}\${env:PROJECT_PATH_CI}\_package-flatpak_windows-any.ps1" . "${env:PROJECT_PATH_ROOT}\${env:PROJECT_PATH_SOURCE}\${env:PROJECT_PATH_CI}\_package-homebrew_windows-any.ps1" . "${env:PROJECT_PATH_ROOT}\${env:PROJECT_PATH_SOURCE}\${env:PROJECT_PATH_CI}\_package-ipk_windows-any.ps1" -. "${env:PROJECT_PATH_ROOT}\${env:PROJECT_PATH_SOURCE}\${env:PROJECT_PATH_CI}\_package-lib_windows-any.ps1" . "${env:PROJECT_PATH_ROOT}\${env:PROJECT_PATH_SOURCE}\${env:PROJECT_PATH_CI}\_package-msi_windows-any.ps1" -. "${env:PROJECT_PATH_ROOT}\${env:PROJECT_PATH_SOURCE}\${env:PROJECT_PATH_CI}\_package-pdf_windows-any.ps1" -. "${env:PROJECT_PATH_ROOT}\${env:PROJECT_PATH_SOURCE}\${env:PROJECT_PATH_CI}\_package-pypi_windows-any.ps1" . "${env:PROJECT_PATH_ROOT}\${env:PROJECT_PATH_SOURCE}\${env:PROJECT_PATH_CI}\_package-rpm_windows-any.ps1" diff --git a/src/data/chocolatey/tools/ChocolateyBeforeModify.ps1 b/src/data/chocolatey/tools/ChocolateyBeforeModify.ps1 new file mode 100644 index 0000000..36333cf --- /dev/null +++ b/src/data/chocolatey/tools/ChocolateyBeforeModify.ps1 @@ -0,0 +1 @@ +# Write-Host "Performing pre-configurations..." - Done by AutomataCI diff --git a/src/data/chocolatey/tools/ChocolateyInstall.ps1 b/src/data/chocolatey/tools/ChocolateyInstall.ps1 new file mode 100644 index 0000000..8abe928 --- /dev/null +++ b/src/data/chocolatey/tools/ChocolateyInstall.ps1 @@ -0,0 +1 @@ +# Write-Host "Installing ${__package_sku} (${PROJECT_VERSION})..." - Done by AutomataCI diff --git a/src/data/chocolatey/tools/ChocolateyUninstall.ps1 b/src/data/chocolatey/tools/ChocolateyUninstall.ps1 new file mode 100644 index 0000000..ca9588b --- /dev/null +++ b/src/data/chocolatey/tools/ChocolateyUninstall.ps1 @@ -0,0 +1 @@ +# Write-Host "Uninstalling ${__package_sku} (${PROJECT_VERSION})..." - Done by AutomataCI diff --git a/src/data/unix/control/post-install.sh b/src/data/unix/control/post-install.sh new file mode 100755 index 0000000..1a24852 --- /dev/null +++ b/src/data/unix/control/post-install.sh @@ -0,0 +1 @@ +#!/bin/sh diff --git a/src/data/unix/control/post-remove.sh b/src/data/unix/control/post-remove.sh new file mode 100755 index 0000000..1a24852 --- /dev/null +++ b/src/data/unix/control/post-remove.sh @@ -0,0 +1 @@ +#!/bin/sh diff --git a/src/data/unix/control/pre-install.sh b/src/data/unix/control/pre-install.sh new file mode 100755 index 0000000..1a24852 --- /dev/null +++ b/src/data/unix/control/pre-install.sh @@ -0,0 +1 @@ +#!/bin/sh diff --git a/src/data/unix/control/pre-remove.sh b/src/data/unix/control/pre-remove.sh new file mode 100755 index 0000000..1a24852 --- /dev/null +++ b/src/data/unix/control/pre-remove.sh @@ -0,0 +1 @@ +#!/bin/sh diff --git a/srcRESEARCH/.ci/build_unix-any.sh b/srcRESEARCH/.ci/build_unix-any.sh index bd64d63..081aed0 100644 --- a/srcRESEARCH/.ci/build_unix-any.sh +++ b/srcRESEARCH/.ci/build_unix-any.sh @@ -39,7 +39,7 @@ fi # setup inportant variables -___name="${PROJECT_SKU}-${PROJECT_RESEARCH_IDENTIFIER}_${PROJECT_VERSION}_any-any" +___name="${PROJECT_SKU}-${PROJECT_RESEARCH_ID}_${PROJECT_VERSION}_any-any" ___source="research-paper.odt" diff --git a/srcRESEARCH/.ci/build_windows-any.ps1 b/srcRESEARCH/.ci/build_windows-any.ps1 index cabcceb..a16142a 100644 --- a/srcRESEARCH/.ci/build_windows-any.ps1 +++ b/srcRESEARCH/.ci/build_windows-any.ps1 @@ -38,7 +38,7 @@ if ($___process -ne 0) { # setup important variables -$___name = "${env:PROJECT_SKU}-${env:PROJECT_RESEARCH_IDENTIFIER}_${env:PROJECT_VERSION}_any-any" +$___name = "${env:PROJECT_SKU}-${env:PROJECT_RESEARCH_ID}_${env:PROJECT_VERSION}_any-any" $___source = "research-paper.odt"