From f90d2766573dc0b2fdc5fbdbd74c80f07267128d Mon Sep 17 00:00:00 2001 From: "copilot-swe-agent[bot]" <198982749+Copilot@users.noreply.github.com> Date: Sun, 9 Nov 2025 01:32:10 +0000 Subject: [PATCH] Add shellcheck compliance and shebang to scripts Co-authored-by: DRSDavidSoft <4673812+DRSDavidSoft@users.noreply.github.com> --- config/Readme.md | 16 ---------------- config/profile.d/README.md | 3 --- vendor/cmder.sh | 11 +++++++++-- vendor/cmder_exinit | 7 +++++++ 4 files changed, 16 insertions(+), 21 deletions(-) delete mode 100644 config/Readme.md delete mode 100644 config/profile.d/README.md diff --git a/config/Readme.md b/config/Readme.md deleted file mode 100644 index c8befd2..0000000 --- a/config/Readme.md +++ /dev/null @@ -1,16 +0,0 @@ -## Config - -All config files must be in this folder. If there is no option to set this folder -directly, it has to be hardlinked. - -* `user_aliases.cmd`: aliases in cmd; called from vendor\init.bat; autocreated from - `vendor\user_aliases.cmd.default`. -* `*.lua`: clink completions and prompt filters; autoloaded after all - prompt filter and clink completions are initialized; add your own. -* `user_profile.{sh|cmd|ps1}`: startup files for bash|cmd|powershell tasks; called from their - respective startup scripts in `vendor\`; autocreated from - `vendor\user_profile.{sh|cmd|ps1}.default` on first start of such a task. -* `.history`: the current commandline history; autoupdated on close. -* `settings`: settings for readline; overwritten on update. -* `user-ConEmu.xml`: settings from ConEmu the UI of Cmder. ; - Do not edit this file directly it is overwritten on each cmder.exe launch. diff --git a/config/profile.d/README.md b/config/profile.d/README.md deleted file mode 100644 index 4883147..0000000 --- a/config/profile.d/README.md +++ /dev/null @@ -1,3 +0,0 @@ -## Profile.d Folder - -* Files in this folder named `*.{sh|cmd|ps1}`: Will be executed by the appropriate shell when starting the shell. diff --git a/vendor/cmder.sh b/vendor/cmder.sh index f4030d6..06b9262 100644 --- a/vendor/cmder.sh +++ b/vendor/cmder.sh @@ -1,3 +1,4 @@ +#!/usr/bin/env bash # DO NOT EDIT THIS FILE IT WILL BE OVERWRITTEN ON UPDATE # # Add portable user customizations ${CMDER_ROOT}/config/user_profile.sh, @@ -12,11 +13,13 @@ run_profile_d() { local profile_d_scripts pushd "${1}" >/dev/null || return + # shellcheck disable=SC2035 profile_d_scripts=$(ls *.sh 2>/dev/null) if [ -n "${profile_d_scripts}" ]; then for script in ${profile_d_scripts}; do # echo Sourcing "${1}/${script}"... + # shellcheck disable=SC1090 . "${1}/${script}" done fi @@ -25,6 +28,7 @@ run_profile_d() { # Detect and set CMDER_ROOT for bash admin sessions # Converts Windows paths to Unix paths if needed +# ConEmuDir is set by ConEmu/Cmder environment if [ -z "$CMDER_ROOT" ]; then case "$ConEmuDir" in *\\*) CMDER_ROOT=$( cd "$(cygpath -u "$ConEmuDir")/../.." && pwd );; @@ -41,6 +45,7 @@ CMDER_ROOT="${CMDER_ROOT%/}" # Exit early if CMDER_ROOT is not set if [ -z "$CMDER_ROOT" ]; then echo "Warning: CMDER_ROOT is not set. Cmder integration skipped." + # shellcheck disable=SC2317 return 2>/dev/null || exit 0 fi @@ -56,7 +61,7 @@ elif [ -f "${CMDER_ROOT}/vendor/git-for-windows/cmd/git.exe" ]; then fi # Add Git to PATH if not already present -if [[ -n "${GIT_INSTALL_ROOT}" && ! "$PATH" =~ "${GIT_INSTALL_ROOT}/bin:" ]]; then +if [[ -n "${GIT_INSTALL_ROOT}" && ! "$PATH" =~ ${GIT_INSTALL_ROOT}/bin: ]]; then PATH="${GIT_INSTALL_ROOT}/bin:$PATH" fi @@ -101,6 +106,7 @@ if [ -n "${CMDER_USER_CONFIG}" ]; then # Source user profile from CMDER_USER_CONFIG if [ -f "${CMDER_USER_CONFIG}/user_profile.sh" ]; then + # shellcheck disable=SC1091 . "${CMDER_USER_CONFIG}/user_profile.sh" fi fi @@ -119,6 +125,7 @@ if [ ! -f "${cmder_user_profile_path}" ] && [ -f "${CMDER_ROOT}/vendor/user_prof fi # Source the users .bashrc file if it exists -if [ -f "${HOME}/.bashrc" ] ; then +if [ -f "${HOME}/.bashrc" ]; then + # shellcheck disable=SC1091 . "${HOME}/.bashrc" fi diff --git a/vendor/cmder_exinit b/vendor/cmder_exinit index d2b49c7..823a791 100644 --- a/vendor/cmder_exinit +++ b/vendor/cmder_exinit @@ -1,3 +1,4 @@ +#!/usr/bin/env bash # Copy this file to your non integrated *nix-like environment, # Cygwin/MSys2/Git for Windows SDK, installs '/etc/profile.d/' # folder to integrate the externally installed Unix like environment @@ -29,14 +30,17 @@ run_profile_d() { pushd "${1}" >/dev/null || return if [ -n "${ZSH_VERSION}" ]; then + # shellcheck disable=SC2035 profile_d_scripts=$(ls *.zsh 2>/dev/null) elif [ -n "${BASH_VERSION}" ]; then + # shellcheck disable=SC2035 profile_d_scripts=$(ls *.sh 2>/dev/null) fi if [ -n "${profile_d_scripts}" ]; then for script in ${profile_d_scripts}; do echo "Sourcing ${1}/${script}..." + # shellcheck disable=SC1090 . "${1}/${script}" done fi @@ -48,6 +52,7 @@ run_profile_d() { # Detect and set CMDER_ROOT for bash admin sessions # Converts Windows paths to Unix paths if needed +# ConEmuDir is set by ConEmu/Cmder environment if [ -z "$CMDER_ROOT" ] && [ -n "$ConEmuDir" ]; then if [ -d "${ConEmuDir}../../vendor" ]; then case "$ConEmuDir" in @@ -97,6 +102,7 @@ if [ -n "$CMDER_ROOT" ]; then # Source user profile from CMDER_ROOT config if [ -f "${CMDER_ROOT}/config/user_profile.sh" ]; then + # shellcheck disable=SC1091 . "${CMDER_ROOT}/config/user_profile.sh" fi @@ -111,6 +117,7 @@ if [ -n "$CMDER_ROOT" ]; then # Source user profile from CMDER_USER_CONFIG if [ -f "${CMDER_USER_CONFIG}/user_profile.sh" ]; then + # shellcheck disable=SC1091 . "${CMDER_USER_CONFIG}/user_profile.sh" fi fi