diff --git a/CONFIG.toml b/CONFIG.toml index da0396e..879abd6 100644 --- a/CONFIG.toml +++ b/CONFIG.toml @@ -268,14 +268,15 @@ PROJECT_BOOK = 'srcBOOK' PROJECT_C = 'srcC' -# PROJECT_C_BRANCH_TAG +# PROJECT_C_ID # This is for technology tagging purposes such as but not limited to release # branches identification. The value shall always be lowercase, short, and -# directly identify it is C technology. +# directly identify as a C-based technology. +# +# This field shall not be EMPTY. # # Default is: 'c' -# To disable: set it empty '' -PROJECT_C_BRANCH_TAG = 'c' +PROJECT_C_ID = 'c' @@ -628,14 +629,15 @@ PROJECT_NODE_VERSION = 'v22.2.0' PROJECT_NODE_NPM_REGISTRY = 'https://npm.pkg.github.com' -# PROJECT_NODE_BRANCH_TAG +# PROJECT_NODE_NPM_ID # This is for technology tagging purposes such as but not limited to release # branches identification. The value shall always be lowercase, short, and -# directly identify it is Node technology. +# directly identify as a Node NPM technology. +# +# This field shall not be EMPTY. # # Default is: 'npm' -# To disable: set it empty '' -PROJECT_NODE_BRANCH_TAG = 'npm' +PROJECT_NODE_NPM_ID = 'npm' @@ -888,8 +890,6 @@ PROJECT_RELEASE_IPK = 'enabled' PROJECT_CHOCOLATEY_URL = 'https://github.com/ChewKeanHo/AutomataCI/releases/latest/download' - - # PROJECT_CHOCOLATEY_VERSION # The Chocolatey version as a dependency. This field SHALL NOT BE EMPTY. # @@ -897,6 +897,18 @@ PROJECT_CHOCOLATEY_URL = 'https://github.com/ChewKeanHo/AutomataCI/releases/late PROJECT_CHOCOLATEY_VERSION = '0.9.8.21' +# PROJECT_CHOCOLATEY_ID +# This is for technology tagging purposes such as but not limited to release +# branches identification. The value shall always be lowercase, short, and +# directly identify as Chocolatey technology (including away from the original +# DOTNET nupkg). +# +# This field shall not be EMPTY. +# +# Default is: 'chocolatey' +PROJECT_CHOCOLATEY_ID = 'chocolatey' + + ############################# @@ -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..b0a8da7 --- /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/hestiaRUST/Vanilla.sh.ps1" +. "${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/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}/$(FS_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..37027d7 --- /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\hestiaRUST\Vanilla.sh.ps1" +. "${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\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}\$(FS-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-archive_unix-any.sh b/automataCI/_package-archive_unix-any.sh index 24a54b6..d2deeba 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,361 @@ 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 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 "$cmd" "$_target" "$_src" "$_target_filename" "$_target_os" "$_target_arch" case $? in - 10) - I18N_Assemble_Skipped - FS_Remove_Silently "$_src" - return 0 + $hestiaKERNEL_ERROR_CANCELLED) + return $hestiaKERNEL_ERROR_OK ;; - 0) + $hestiaKERNEL_ERROR_OK) ;; *) - I18N_Assemble_Failed - return 1 + 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..24873c8 100644 --- a/automataCI/_package-archive_windows-any.ps1 +++ b/automataCI/_package-archive_windows-any.ps1 @@ -1,132 +1,411 @@ +#!/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 + $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} + } + + $___process = PACKAGE-Assemble-ARCHIVE-Content ` + "${_target}" ` + "${_src}" ` + "${_target_filename}" ` + "${_target_os}" ` + "${_target_arch}" + switch($___process) { + } ${env:hestiaKERNEL_ERROR_CANCELLED} { + return ${env:hestiaKERNEL_ERROR_OK} + } ${env:hestiaKERNEL_ERROR_OK} { + # proceed further + } default { + 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-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-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-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/_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..a0e6d98 100644 --- a/automataCI/_release-research_unix-any.sh +++ b/automataCI/_release-research_unix-any.sh @@ -46,6 +46,7 @@ RELEASE_Run_RESEARCH() { __dest="PAPER.pdf" __dest="${PROJECT_PATH_ROOT}/${__dest}" I18N_Publish "$__dest" + FS_Remove_Silently "$__dest" FS_Copy_File "$1" "$__dest" if [ $? -ne 0 ]; then I18N_Publish_Failed diff --git a/automataCI/_release-research_windows-any.ps1 b/automataCI/_release-research_windows-any.ps1 index 405d074..cbf0ff7 100644 --- a/automataCI/_release-research_windows-any.ps1 +++ b/automataCI/_release-research_windows-any.ps1 @@ -48,6 +48,7 @@ function RELEASE-Run-RESEARCH { $__dest = "PAPER.pdf" $null = I18N-Publish "${__dest}" $__dest = "${env:PROJECT_PATH_ROOT}\${__dest}" + $null = FS-Remove-Silently "${__dest}" $___process = FS-Copy-File "${__target}" "${__dest}" if ($___process -ne 0) { $null = I18N-Publish-Failed diff --git a/automataCI/package_unix-any.sh b/automataCI/package_unix-any.sh index 25b7382..35e58ff 100644 --- a/automataCI/package_unix-any.sh +++ b/automataCI/package_unix-any.sh @@ -29,25 +29,18 @@ fi . "${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" - - - -# source locally provided functions +## source locally provided functions . "${LIBS_AUTOMATACI}/_package-sourcing_unix-any.sh" @@ -253,45 +246,15 @@ for i in "${PROJECT_PATH_ROOT}/${PROJECT_PATH_BUILD}"/*; do # 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" "\ + __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 + if [ $? -ne 0 ]; then + return 1 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 # NOTE: deb does not work in windows or mac if [ $(STRINGS_Is_Empty "$PROJECT_DEB_URL") -ne 0 ]; then @@ -311,6 +274,7 @@ ${__common}|${FILE_CHANGELOG_DEB}|${__log}|PACKAGE_Run_DEB esac fi + # NOTE: container only serve windows and linux if [ $(STRINGS_Is_Empty "$PROJECT_CONTAINER_REGISTRY") -ne 0 ]; then case "$TARGET_OS" in @@ -329,6 +293,7 @@ ${__common}|${__log}|PACKAGE_Run_DOCKER esac fi + # NOTE: flatpak only serve linux FLATPAK_Is_Available if [ $? -eq 0 ] && [ $(STRINGS_Is_Empty "$PROJECT_FLATPAK_URL") -ne 0 ]; then @@ -377,18 +342,6 @@ ${__common}|${__log}|PACKAGE_Run_IPK 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 @@ -419,17 +372,6 @@ ${__common}|${__log}|PACKAGE_Run_PDF fi fi - 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 @@ -509,6 +451,9 @@ if [ "$(STRINGS_Is_Empty "$PROJECT_MSI_INSTALL_DIRECTORY")" -ne 0 ]; then done fi +# remove this +I18N_Run_Successful +return 0 I18N_Sync_Run_Series FS_Is_File "$__serial_control" diff --git a/automataCI/package_windows-any.ps1 b/automataCI/package_windows-any.ps1 index 9ca070b..51abf05 100644 --- a/automataCI/package_windows-any.ps1 +++ b/automataCI/package_windows-any.ps1 @@ -15,8 +15,8 @@ # 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" @@ -39,76 +39,76 @@ $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 + $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 - } + $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 + } } 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 - } - - - if ($(STRINGS-Is-Empty "${env:PROJECT_MSI_REGISTRY_KEY}") -eq 0) { - ${env:PROJECT_MSI_REGISTRY_KEY} = @" + $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 + } + + + if ($(STRINGS-Is-Empty "${env:PROJECT_MSI_REGISTRY_KEY}") -eq 0) { + ${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 - } + $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 + } } @@ -117,7 +117,7 @@ $FILE_CHANGELOG_MD = "${env:PROJECT_PATH_ROOT}\${env:PROJECT_PATH_PKG}\${FILE_CH $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 + return 1 } @@ -125,7 +125,7 @@ $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 + return 1 } @@ -140,8 +140,8 @@ $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 + $null = I18N-Remake-Failed + return 1 } @@ -150,8 +150,8 @@ $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 + $null = I18N-Remake-Failed + return 1 } @@ -164,64 +164,60 @@ $null = FS-Remove-Silently "${__serial_control}" 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 + ) + + + # 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-changelog_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-msi_windows-any.ps1" + $null = . "${env:LIBS_AUTOMATACI}\_package-pdf_windows-any.ps1" + $null = . "${env:LIBS_AUTOMATACI}\_package-rpm_windows-any.ps1" + + ## source locally provided functions + $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 } @@ -230,240 +226,188 @@ function SUBROUTINE-Package { # 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}" @" + $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" + + $__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}" @" + 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}" @" + 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}" @" + 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}" @" + 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}" @" + 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 - } - } - - 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 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}" @" + 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}" @" + 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 "@ - 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 - -"@ - 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}" @" + 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 { - }} - } + if ($___process -ne 0) { + return 1 + } + } default { + }} + } } } @@ -471,76 +415,76 @@ ${__common}|${__log}|PACKAGE-Run-RPM $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 - } + $___process = SYNC-Exec-Parallel ` + ${function:SUBROUTINE-Package}.ToString() ` + "${__parallel_control}" ` + "${__control_directory}" + if ($___process -ne 0) { + $null = I18N-Sync-Failed + return 1 + } } 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 - } + $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 + $null = I18N-Newline + $null = I18N-Newline - # sort 'any' arch into others - $___process = PACKAGE-Sort-MSI "${MSI_WORKSPACE}" - if ($___process -ne 0) { - return 1 - } + # 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 + # seal all MSI packages + foreach ($_candidate in (Get-ChildItem -Path "${MSI_WORKSPACE}" -Directory)) { + $_candidate = $_candidate.FullName - $null = I18N-Newline + $null = I18N-Newline - $___process = PACKAGE-Seal-MSI ` - "${_candidate}" ` - "${env:PROJECT_PATH_ROOT}\${env:PROJECT_PATH_PKG}" - if ($___process -ne 0) { - return 1 - } - } + $___process = PACKAGE-Seal-MSI ` + "${_candidate}" ` + "${env:PROJECT_PATH_ROOT}\${env:PROJECT_PATH_PKG}" + if ($___process -ne 0) { + return 1 + } + } } $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 - } + $___process = SYNC-Exec-Serial ` + ${function:SUBROUTINE-Package}.ToString() ` + "${__serial_control}" + if ($___process -ne 0) { + $null = I18N-Sync-Failed + return 1 + } } diff --git a/automataCI/release_unix-any.sh b/automataCI/release_unix-any.sh index 3562d3e..9614a77 100644 --- a/automataCI/release_unix-any.sh +++ b/automataCI/release_unix-any.sh @@ -34,6 +34,7 @@ fi . "${LIBS_AUTOMATACI}/_release-homebrew_unix-any.sh" . "${LIBS_AUTOMATACI}/_release-lib_unix-any.sh" . "${LIBS_AUTOMATACI}/_release-npm_unix-any.sh" +. "${LIBS_AUTOMATACI}/_release-nupkg_unix-any.sh" . "${LIBS_AUTOMATACI}/_release-project_unix-any.sh" . "${LIBS_AUTOMATACI}/_release-pypi_unix-any.sh" . "${LIBS_AUTOMATACI}/_release-research_unix-any.sh" @@ -169,6 +170,12 @@ for TARGET in "$PACKAGE_DIRECTORY"/*; do fi + RELEASE_Run_NUPKG "$TARGET" + if [ $? -ne 0 ]; then + return 1 + fi + + RELEASE_Run_PYPI "$TARGET" if [ $? -ne 0 ]; then return 1 diff --git a/automataCI/release_windows-any.ps1 b/automataCI/release_windows-any.ps1 index 69dd698..c833a93 100644 --- a/automataCI/release_windows-any.ps1 +++ b/automataCI/release_windows-any.ps1 @@ -33,6 +33,7 @@ if (-not (Test-Path -Path $env:PROJECT_PATH_ROOT)) { . "${env:LIBS_AUTOMATACI}\_release-homebrew_windows-any.ps1" . "${env:LIBS_AUTOMATACI}\_release-lib_windows-any.ps1" . "${env:LIBS_AUTOMATACI}\_release-npm_windows-any.ps1" +. "${env:LIBS_AUTOMATACI}\_release-nupkg_windows-any.ps1" . "${env:LIBS_AUTOMATACI}\_release-project_windows-any.ps1" . "${env:LIBS_AUTOMATACI}\_release-pypi_windows-any.ps1" . "${env:LIBS_AUTOMATACI}\_release-research_windows-any.ps1" @@ -160,6 +161,11 @@ foreach ($TARGET in (Get-ChildItem -Path "${PACKAGE_DIRECTORY}")) { $TARGET = $T return 1 } + $___process = RELEASE-Run-NUPKG "$TARGET" + if ($___process -ne 0) { + return 1 + } + $___process = RELEASE-Run-PYPI "$TARGET" if ($___process -ne 0) { return 1 diff --git a/automataCI/services/compilers/deb.ps1 b/automataCI/services/compilers/deb.ps1 index faf5cec..944b89b 100644 --- a/automataCI/services/compilers/deb.ps1 +++ b/automataCI/services/compilers/deb.ps1 @@ -1104,7 +1104,9 @@ function DEB-Unpack { # execute # copy target into directory - $___process = FS-Copy-File "${___target}" "${___directory}" + $___process = FS-Copy-File ` + "${___target}" ` + "${___directory}\$(FS-Get-File "${___target}")" if ($___process -ne 0) { return 1 } diff --git a/automataCI/services/compilers/deb.sh b/automataCI/services/compilers/deb.sh index 4642f01..ce5e3d6 100644 --- a/automataCI/services/compilers/deb.sh +++ b/automataCI/services/compilers/deb.sh @@ -1063,10 +1063,6 @@ DEB_Unpack() { # validate input - if [ $(STRINGS_Is_Empty "$___directory") -eq 0 ]; then - return 1 - fi - FS_Is_Directory "$___directory" if [ $? -ne 0 ]; then return 1 @@ -1095,7 +1091,7 @@ DEB_Unpack() { # execute # copy target into directory - FS_Copy_File "$___target" "$___directory" + FS_Copy_File "$___target" "${___directory}/$(FS_Get_File "$___target")" if [ $? -ne 0 ]; then return 1 fi diff --git a/automataCI/services/hestiaCONSOLE/Log.sh.ps1 b/automataCI/services/hestiaCONSOLE/Log.sh.ps1 new file mode 100644 index 0000000..95da49c --- /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 -- "%-14s " "$___tag")" + fi + + if [ ! -z "$COLORTERM" ] || [ "$TERM" = "xterm-256color" ]; then + # terminal supports color mode + if [ ! -z "$___color" ]; then + 1>&2 printf -- "\033[1;${___color}m%s\033[0;${___color}m %b\033[0m" \ + "$___tag" \ + "$2" + else + 1>&2 printf -- "%s%b" "$___tag" "$2" + fi + else + 1>&2 printf -- "%s%b" "$___tag" "$2" + fi + + unset ___color ___tag ___lang + + + # report status + return 0 +} +################################################################################ +# Unix Main Codes # +################################################################################ +return 0 +#> diff --git a/automataCI/services/hestiaCONSOLE/Log_Assemble.sh.ps1 b/automataCI/services/hestiaCONSOLE/Log_Assemble.sh.ps1 new file mode 100644 index 0000000..76eb268 --- /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..9d68e36 --- /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..f5c1244 --- /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..c77281e --- /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..df994c7 --- /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..8562b25 --- /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..33dc6ea --- /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 info \ + "$(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..b3d2564 --- /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..892c324 --- /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..ebc04ae --- /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 info \ + "$(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..59ec792 --- /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..de5130c --- /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..4165f03 --- /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 info \ + "$(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..e9d7de9 --- /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..ee1219e --- /dev/null +++ b/automataCI/services/hestiaCONSOLE/Log_Publish_Failed.sh.ps1 @@ -0,0 +1,98 @@ +echo \" <<'RUN_AS_BATCH' >/dev/null ">NUL "\" \`" <#" +@ECHO OFF +REM LICENSE CLAUSES HERE +REM ---------------------------------------------------------------------------- + + + + +REM ############################################################################ +REM # Windows BATCH Codes # +REM ############################################################################ +where /q powershell +if errorlevel 1 ( + echo "ERROR: missing powershell facility." + exit /b 1 +) + +copy /Y "%~nx0" "%~n0.ps1" >nul +timeout /t 1 /nobreak >nul +powershell -executionpolicy remotesigned -Command "& '.\%~n0.ps1' %*" +start /b "" cmd /c del "%~f0" & exit /b %errorcode% +REM ############################################################################ +REM # Windows BATCH Codes # +REM ############################################################################ +RUN_AS_BATCH +#> | Out-Null + + + + +echo \" <<'RUN_AS_POWERSHELL' >/dev/null # " | Out-Null +################################################################################ +# Windows POWERSHELL Codes # +################################################################################ +. "${env:LIBS_HESTIA}\hestiaCONSOLE\Log.sh.ps1" +. "${env:LIBS_HESTIA}\hestiaLOCALE\Get_Lang.sh.ps1" +. "${env:LIBS_HESTIA}\hestiaI18N\Translate_Publish_Failed.sh.ps1" + + + + +function hestiaCONSOLE-Log-Publish-Failed { + param( + [string]___subject, + [string]___lang + ) + + + # execute + $___lang = "$(hestiaLOCALE-Get-Lang "${___lang}")" + $null = hestiaCONSOLE-Log error ` + "$(hestiaI18N-Translate-Publish-Failed "${___lang}" "${___subject}")`n" ` + "${___lang}" + + + # report status + return 0 +} +################################################################################ +# Windows POWERSHELL Codes # +################################################################################ +return +<# +RUN_AS_POWERSHELL + + + + +################################################################################ +# Unix Main Codes # +################################################################################ +. "${LIBS_HESTIA}/hestiaCONSOLE/Log.sh.ps1" +. "${LIBS_HESTIA}/hestiaLOCALE/Get_Lang.sh.ps1" +. "${LIBS_HESTIA}/hestiaI18N/Translate_Publish_Failed.sh.ps1" + + + + +hestiaCONSOLE_Log_Publish_Failed() { + #___subject="$1" + #___lang="$2" + + + # execute + ___lang="$(hestiaLOCALE_Get_Lang "$2")" + hestiaCONSOLE_Log error \ + "$(hestiaI18N_Translate_Publish_Failed "$___lang" "$1")\n" \ + "$___lang" + + + # report status + return 0 +} +################################################################################ +# Unix Main Codes # +################################################################################ +return 0 +#> diff --git a/automataCI/services/hestiaCONSOLE/Log_Publish_Simulate.sh.ps1 b/automataCI/services/hestiaCONSOLE/Log_Publish_Simulate.sh.ps1 new file mode 100644 index 0000000..9f61ebb --- /dev/null +++ b/automataCI/services/hestiaCONSOLE/Log_Publish_Simulate.sh.ps1 @@ -0,0 +1,98 @@ +echo \" <<'RUN_AS_BATCH' >/dev/null ">NUL "\" \`" <#" +@ECHO OFF +REM LICENSE CLAUSES HERE +REM ---------------------------------------------------------------------------- + + + + +REM ############################################################################ +REM # Windows BATCH Codes # +REM ############################################################################ +where /q powershell +if errorlevel 1 ( + echo "ERROR: missing powershell facility." + exit /b 1 +) + +copy /Y "%~nx0" "%~n0.ps1" >nul +timeout /t 1 /nobreak >nul +powershell -executionpolicy remotesigned -Command "& '.\%~n0.ps1' %*" +start /b "" cmd /c del "%~f0" & exit /b %errorcode% +REM ############################################################################ +REM # Windows BATCH Codes # +REM ############################################################################ +RUN_AS_BATCH +#> | Out-Null + + + + +echo \" <<'RUN_AS_POWERSHELL' >/dev/null # " | Out-Null +################################################################################ +# Windows POWERSHELL Codes # +################################################################################ +. "${env:LIBS_HESTIA}\hestiaCONSOLE\Log.sh.ps1" +. "${env:LIBS_HESTIA}\hestiaLOCALE\Get_Lang.sh.ps1" +. "${env:LIBS_HESTIA}\hestiaI18N\Translate_Publish_Simulate.sh.ps1" + + + + +function hestiaCONSOLE-Log-Publish-Simulate { + param( + [string]___subject, + [string]___lang + ) + + + # execute + $___lang = "$(hestiaLOCALE-Get-Lang "${___lang}")" + $null = hestiaCONSOLE-Log warning ` + "$(hestiaI18N-Translate-Publish-Simulate "${___lang}" "${___subject}")`n" ` + "${___lang}" + + + # report status + return 0 +} +################################################################################ +# Windows POWERSHELL Codes # +################################################################################ +return +<# +RUN_AS_POWERSHELL + + + + +################################################################################ +# Unix Main Codes # +################################################################################ +. "${LIBS_HESTIA}/hestiaCONSOLE/Log.sh.ps1" +. "${LIBS_HESTIA}/hestiaLOCALE/Get_Lang.sh.ps1" +. "${LIBS_HESTIA}/hestiaI18N/Translate_Publish_Simulate.sh.ps1" + + + + +hestiaCONSOLE_Log_Publish_Simulate() { + #___subject="$1" + #___lang="$2" + + + # execute + ___lang="$(hestiaLOCALE_Get_Lang "$2")" + hestiaCONSOLE_Log info \ + "$(hestiaI18N_Translate_Publish_Simulate "$___lang" "$1")\n" \ + "$___lang" + + + # report status + return 0 +} +################################################################################ +# Unix Main Codes # +################################################################################ +return 0 +#> diff --git a/automataCI/services/hestiaCONSOLE/Log_Recreate.sh.ps1 b/automataCI/services/hestiaCONSOLE/Log_Recreate.sh.ps1 new file mode 100644 index 0000000..e1747f8 --- /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..85106f9 --- /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..6171d6e --- /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 info \ + "$(hestiaI18N_Translate_Recreate_Simulate "$___lang")\n" \ + "$___lang" + + + # report status + return 0 +} +################################################################################ +# Unix Main Codes # +################################################################################ +return 0 +#> diff --git a/automataCI/services/hestiaCONSOLE/Vanilla.sh.ps1 b/automataCI/services/hestiaCONSOLE/Vanilla.sh.ps1 new file mode 100644 index 0000000..f9c4e18 --- /dev/null +++ b/automataCI/services/hestiaCONSOLE/Vanilla.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}\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" +################################################################################ +# 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" +################################################################################ +# 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..2f74171 --- /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}") -ne ${env:hestiaKERNEL_ERROR_OK}) { + return ${env:hestiaKERNEL_ERROR_ENTITY_EXISTS} + } + + if ($(hestiaFS-Is-Directory "$(hestiaFS-Get-Directory "${___destination}")") -ne $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..c9b3bb8 --- /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 "${___target}")" +} +################################################################################ +# 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..8c84b61 --- /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..1ef48e1 --- /dev/null +++ b/automataCI/services/hestiaFS/Recreate_Directory.sh.ps1 @@ -0,0 +1,132 @@ +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_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 + $___process = FS-Remove "${___filepath}" + if ($___process -ne ${env:hestiaKERNEL_ERROR_OK}) { + return ${env:hestiaKERNEL_ERROR_BAD_EXEC} + } + + $___process = FS-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_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" + if [ $? -ne $hestiaKERNEL_ERROR_OK ]; then + return $hestiaKERNEL_ERROR_BAD_EXEC + fi + + 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..3811786 --- /dev/null +++ b/automataCI/services/hestiaFS/Remove.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" +. "${env:LIBS_HESTIA}\hestiaSTRING\Is_Empty.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} + } + + + # 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" + + + + +hestiaFS_Remove() { + #___filepath="$1" + + + # validate input + if [ $(hestiaSTRING_Is_Empty "$1") -eq $hestiaKERNEL_ERROR_OK ]; then + return $hestiaKERNEL_ERROR_DATA_EMPTY + 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/hestiaGZ/Compress.sh.ps1 b/automataCI/services/hestiaGZ/Compress.sh.ps1 new file mode 100644 index 0000000..ff6266c --- /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}") -eq ${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..934cc84 --- /dev/null +++ b/automataCI/services/hestiaGZ/Is_Available.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}\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 + return $hestiaKERNEL_ERROR_OK + elif [ $(hestiaOS_Is_Command_Available "gunzip") -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/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..2ac1b27 --- /dev/null +++ b/automataCI/services/hestiaI18N/Translate_Publish_Simulate.sh.ps1 @@ -0,0 +1,93 @@ +echo \" <<'RUN_AS_BATCH' >/dev/null ">NUL "\" \`" <#" +@ECHO OFF +REM LICENSE CLAUSES HERE +REM ---------------------------------------------------------------------------- + + + + +REM ############################################################################ +REM # Windows BATCH Codes # +REM ############################################################################ +where /q powershell +if errorlevel 1 ( + echo "ERROR: missing powershell facility." + exit /b 1 +) + +copy /Y "%~nx0" "%~n0.ps1" >nul +timeout /t 1 /nobreak >nul +powershell -executionpolicy remotesigned -Command "& '.\%~n0.ps1' %*" +start /b "" cmd /c del "%~f0" & exit /b %errorcode% +REM ############################################################################ +REM # Windows BATCH Codes # +REM ############################################################################ +RUN_AS_BATCH +#> | Out-Null + + + + +echo \" <<'RUN_AS_POWERSHELL' >/dev/null # " | Out-Null +################################################################################ +# Windows POWERSHELL Codes # +################################################################################ +function hestiaI18N-Translate-Publish_Simulate { + param ( + [string]$___locale, + [string]$___subject + ) + + + # execute + switch (${___locale}) { + "zh-hans" { + # 简体中文 + return "正在仿真着发布‘${___subject}’。。。" + } default { + # fallback to default english + return "Simulate Publishing '${___subject}'..." + }} + + + # report status + return 0 +} +################################################################################ +# Windows POWERSHELL Codes # +################################################################################ +return +<# +RUN_AS_POWERSHELL + + + + +################################################################################ +# Unix Main Codes # +################################################################################ +hestiaI18N_Translate_Publish_Simulate() { + #___locale="$1" + #___subject="$2" + + + # execute + case "$1" in + zh-hans) + # 简体中文 + printf -- "%s" "正在仿真着发布‘${___subject}’。。。" + ;; + *) + # fallback to default english + printf -- "%s" "Simulate Publishing '${___subject}'..." + 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-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..a5b5a66 --- a/automataCI/services/hestiaI18N/Vanilla.sh.ps1 +++ b/automataCI/services/hestiaI18N/Vanilla.sh.ps1 @@ -33,20 +33,46 @@ 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_Success.sh.ps1" +. "${env:LIBS_HESTIA}\hestiaI18N\Translate_Warning.sh.ps1" ################################################################################ # Windows POWERSHELL Codes # ################################################################################ @@ -61,20 +87,46 @@ 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_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/Vanilla.sh.ps1 b/automataCI/services/hestiaKERNEL/Vanilla.sh.ps1 new file mode 100644 index 0000000..b49da23 --- /dev/null +++ b/automataCI/services/hestiaKERNEL/Vanilla.sh.ps1 @@ -0,0 +1,54 @@ +echo \" <<'RUN_AS_BATCH' >/dev/null ">NUL "\" \`" <#" +@ECHO OFF +REM LICENSE CLAUSES HERE +REM ---------------------------------------------------------------------------- + + + + +REM ############################################################################ +REM # Windows BATCH Codes # +REM ############################################################################ +where /q powershell +if errorlevel 1 ( + echo "ERROR: missing powershell facility." + exit /b 1 +) + +copy /Y "%~nx0" "%~n0.ps1" >nul +timeout /t 1 /nobreak >nul +powershell -executionpolicy remotesigned -Command "& '.\%~n0.ps1' %*" +start /b "" cmd /c del "%~f0" & exit /b %errorcode% +REM ############################################################################ +REM # Windows BATCH Codes # +REM ############################################################################ +RUN_AS_BATCH +#> | Out-Null + + + + +echo \" <<'RUN_AS_POWERSHELL' >/dev/null # " | Out-Null +################################################################################ +# Windows POWERSHELL Codes # +################################################################################ +. "${env:LIBS_HESTIA}\hestiaKERNEL\Error_Codes.sh.ps1" +################################################################################ +# Windows POWERSHELL Codes # +################################################################################ +return +<# +RUN_AS_POWERSHELL + + + + +################################################################################ +# Unix Main Codes # +################################################################################ +. "${LIBS_HESTIA}/hestiaKERNEL/Error_Codes.sh.ps1" +################################################################################ +# Unix Main Codes # +################################################################################ +return 0 +#> diff --git a/automataCI/services/hestiaLOCALE/Get-LCID.sh.ps1 b/automataCI/services/hestiaLOCALE/Get_LCID.sh.ps1 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..6c6d996 --- /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.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..344e042 --- /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 (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..8dfd20f --- /dev/null +++ b/automataCI/services/hestiaOS/Is_Command_Available.sh.ps1 @@ -0,0 +1,111 @@ +echo \" <<'RUN_AS_BATCH' >/dev/null ">NUL "\" \`" <#" +@ECHO OFF +REM LICENSE CLAUSES HERE +REM ---------------------------------------------------------------------------- + + + + +REM ############################################################################ +REM # Windows BATCH Codes # +REM ############################################################################ +where /q powershell +if errorlevel 1 ( + echo "ERROR: missing powershell facility." + exit /b 1 +) + +copy /Y "%~nx0" "%~n0.ps1" >nul +timeout /t 1 /nobreak >nul +powershell -executionpolicy remotesigned -Command "& '.\%~n0.ps1' %*" +start /b "" cmd /c del "%~f0" & exit /b %errorcode% +REM ############################################################################ +REM # Windows BATCH Codes # +REM ############################################################################ +RUN_AS_BATCH +#> | Out-Null + + + + +echo \" <<'RUN_AS_POWERSHELL' >/dev/null # " | Out-Null +################################################################################ +# Windows POWERSHELL Codes # +################################################################################ +. "${env:LIBS_HESTIA}\hestiaKERNEL\Vanilla.sh.ps1" +. "${env:LIBS_HESTIA}\hestiaSTRING\Vanilla.sh.ps1" + + + + +function hestiaOS-Is-Command-Available { + param ( + [string]$___command + ) + + + # validate input + if ($(hestiaSTRING-Is-Empty "${___command}") -eq ${env:hestiaERROR_OK}) { + return ${env:hestiaKERNEL_ERROR_DATA_MISSING} + } + + + # execute + if (-not (Test-Path -Path "${___command}" -ErrorAction SilentlyContinue)) { + return ${env:hestiaKERNEL_ERROR_DATA_MISSING} + } + + if (-not (Get-Command $___command -ErrorAction SilentlyContinue)) { + return ${env:hestiaKERNEL_ERROR_DATA_MISSING} + } + + + # report status + return ${env:hestiaKERNEL_ERROR_OK} +} +################################################################################ +# Windows POWERSHELL Codes # +################################################################################ +return +<# +RUN_AS_POWERSHELL + + + + +################################################################################ +# Unix Main Codes # +################################################################################ +. "${LIBS_HESTIA}/hestiaKERNEL/Vanilla.sh.ps1" +. "${LIBS_HESTIA}/hestiaSTRING/Vanilla.sh.ps1" + + + + +hestiaOS_Is_Command_Available() { + #___command="$1" + + + # validate input + if [ $(hestiaSTRING_Is_Empty "$1") -eq $hestiaKERNEL_ERROR_OK ]; then + printf -- "%d" $hestiaKERNEL_ERROR_DATA_MISSING + return $hestiaKERNEL_ERROR_DATA_MISSING + fi + + + # execute + if [ $(hestiaSTRING_Is_Empty "$(type -t "$1")") -eq $hestiaKERNEL_ERROR_OK ]; then + printf -- "%d" $hestiaKERNEL_ERROR_DATA_MISSING + return $hestiaKERNEL_ERROR_DATA_MISSING + fi + + + # report status + printf -- "%d" $hestiaKERNEL_ERROR_OK + return $hestiaKERNEL_ERROR_OK +} +################################################################################ +# Unix Main Codes # +################################################################################ +return 0 +#> diff --git a/automataCI/services/hestiaOS/Is_Simulation_Mode.sh.ps1 b/automataCI/services/hestiaOS/Is_Simulation_Mode.sh.ps1 new file mode 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..506602e --- /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="$(FS_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..93c429a --- /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 $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/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/src/.ci/_package-archive_unix-any.sh b/src/.ci/_package-archive_unix-any.sh index 066772c..1ccec39 100644 --- a/src/.ci/_package-archive_unix-any.sh +++ b/src/.ci/_package-archive_unix-any.sh @@ -20,8 +20,11 @@ if [ "$PROJECT_PATH_ROOT" = "" ]; then return 1 fi -. "${LIBS_AUTOMATACI}/services/io/fs.sh" -. "${LIBS_AUTOMATACI}/services/i18n/translations.sh" +. "${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" @@ -34,111 +37,91 @@ PACKAGE_Assemble_ARCHIVE_Content() { _target_arch="$5" - # package based on target's nature - if [ $(FS_Is_Target_A_Source "$_target") -eq 0 ]; then + # 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 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 + 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 + # 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 + # copy user guide files for all languages for __source in "${PROJECT_PATH_ROOT}/${PROJECT_PATH_SOURCE}/docs/USER-GUIDES"*.pdf; do - FS_Is_Target_Exist "$__source" - if [ $? -ne 0 ]; then + if [ $(hestiaFS_Is_Exist "$__source") -ne $hestiaKERNEL_ERROR_OK ]; 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 + __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 file + # copy license files for all languages for __source in "${PROJECT_PATH_ROOT}/${PROJECT_PATH_SOURCE}/licenses/LICENSE"*.pdf; do - FS_Is_Target_Exist "$__source" - if [ $? -ne 0 ]; then + if [ $(hestiaFS_Is_Exist "$__source") -ne $hestiaKERNEL_ERROR_OK ]; 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 + 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 0 + return $hestiaKERNEL_ERROR_OK } diff --git a/src/.ci/_package-archive_windows-any.ps1 b/src/.ci/_package-archive_windows-any.ps1 index 0d28260..882b754 100644 --- a/src/.ci/_package-archive_windows-any.ps1 +++ b/src/.ci/_package-archive_windows-any.ps1 @@ -1,139 +1,135 @@ +#!/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. +# 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 + 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" +. "${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 - ) - - - # 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 + 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 10 # 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}\$(FS-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 -Path "${env:PROJECT_PATH_ROOT}\${env:PROJECT_PATH_SOURCE}\licenses") ` + | Where-Object { $_.Name -like "LICENSE*.pdf" } + ) { $__source = $__source.FullName + if ($(hestiaFS-Is-Exist "${__source}") -ne ${env:hestiaKERNEL_ERROR_OK}) { + continue + } + + $__dest = "${_directory}\$(FS-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-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-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_unix-any.sh b/src/.ci/package_unix-any.sh index e81727d..e95cfe1 100644 --- a/src/.ci/package_unix-any.sh +++ b/src/.ci/package_unix-any.sh @@ -21,17 +21,13 @@ if [ "$PROJECT_PATH_ROOT" == "" ]; then 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..276b4ea 100644 --- a/src/.ci/package_windows-any.ps1 +++ b/src/.ci/package_windows-any.ps1 @@ -15,22 +15,18 @@ # 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