Skip to content

Commit

Permalink
MOD: shmixcloud.sh
Browse files Browse the repository at this point in the history
  • Loading branch information
pforret committed Nov 9, 2023
1 parent 1d85539 commit 2980b2d
Showing 1 changed file with 7 additions and 0 deletions.
7 changes: 7 additions & 0 deletions shmixcloud.sh
Original file line number Diff line number Diff line change
Expand Up @@ -767,15 +767,19 @@ recursive_readlink() {
}

lookup_script_data() {
# shellcheck disable=SC2155
readonly script_prefix=$(basename "${BASH_SOURCE[0]}" .sh)
# shellcheck disable=SC2155
readonly script_basename=$(basename "${BASH_SOURCE[0]}")
# shellcheck disable=SC2155
readonly execution_day=$(date "+%Y-%m-%d")
#readonly execution_year=$(date "+%Y")

script_install_path="${BASH_SOURCE[0]}"
debug "$info_icon Script path: $script_install_path"
script_install_path=$(recursive_readlink "$script_install_path")
debug "$info_icon Linked path: $script_install_path"
# shellcheck disable=SC2155
readonly script_install_folder="$( cd -P "$( dirname "$script_install_path" )" && pwd )"
debug "$info_icon In folder : $script_install_folder"
if [[ -f "$script_install_path" ]]; then
Expand All @@ -796,6 +800,7 @@ lookup_script_data() {
[[ -n "${KSH_VERSION:-}" ]] && shell_brand="ksh" && shell_version="$KSH_VERSION"
debug "$info_icon Shell type : $shell_brand - version $shell_version"

# shellcheck disable=SC2155
readonly os_kernel=$(uname -s)
os_version=$(uname -r)
os_machine=$(uname -m)
Expand Down Expand Up @@ -847,8 +852,10 @@ lookup_script_data() {

# if run inside a git repo, detect for which remote repo it is
if git status &>/dev/null; then
# shellcheck disable=SC2155
readonly git_repo_remote=$(git remote -v | awk '/(fetch)/ {print $2}')
debug "$info_icon git remote : $git_repo_remote"
# shellcheck disable=SC2155
readonly git_repo_root=$(git rev-parse --show-toplevel)
debug "$info_icon git folder : $git_repo_root"
else
Expand Down

0 comments on commit 2980b2d

Please sign in to comment.