From a857d8419cf94190f74ba86acb4840c05427a9e9 Mon Sep 17 00:00:00 2001 From: "Dax T. Games" Date: Wed, 4 Dec 2019 16:04:16 -0500 Subject: [PATCH 1/9] fixes for cmd:cmder init script --- vendor/init.bat | 16 +++++++----- vendor/lib/lib_path.cmd | 58 +++++++++++++++++++++-------------------- 2 files changed, 39 insertions(+), 35 deletions(-) diff --git a/vendor/init.bat b/vendor/init.bat index 2882480..8b0a885 100644 --- a/vendor/init.bat +++ b/vendor/init.bat @@ -232,15 +232,17 @@ if not defined SVN_SSH set "SVN_SSH=%GIT_INSTALL_ROOT:\=\\%\\bin\\ssh.exe" :: Find locale.exe: From the git install root, from the path, using the git installed env, or fallback using the env from the path. if not defined git_locale if exist "%GIT_INSTALL_ROOT%\usr\bin\locale.exe" set git_locale="%GIT_INSTALL_ROOT%\usr\bin\locale.exe" -if not defined git_locale for /F "delims=" %%F in ('where locale.exe 2^>nul') do (if not defined git_locale set git_locale="%%F") +if not defined git_locale for /F "tokens=* delims=" %%F in ('where locale.exe 2^>nul') do ( if not defined git_locale set git_locale="%%F" ) if not defined git_locale if exist "%GIT_INSTALL_ROOT%\usr\bin\env.exe" set git_locale="%GIT_INSTALL_ROOT%\usr\bin\env.exe" /usr/bin/locale -if not defined git_locale set git_locale=env /usr/bin/locale +if not defined git_locale for /F "tokens=* delims=" %%F in ('where env.exe 2^>nul') do ( if not defined git_locale set git_locale="%%F" /usr/bin/locale ) -%lib_console% debug_output init.bat "Env Var - git_locale=%git_locale%" -if not defined LANG ( - for /F "delims=" %%F in ('%git_locale% -uU 2') do ( - set "LANG=%%F" - ) +if defined git_locale ( + %lib_console% debug_output init.bat "Env Var - git_locale=%git_locale%" + if not defined LANG ( + for /F "delims=" %%F in ('%git_locale% -uU 2') do ( + set "LANG=%%F" + ) + ) ) %lib_console% debug_output init.bat "Env Var - GIT_INSTALL_ROOT=%GIT_INSTALL_ROOT%" diff --git a/vendor/lib/lib_path.cmd b/vendor/lib/lib_path.cmd index 8f7188c..a1a8fbe 100644 --- a/vendor/lib/lib_path.cmd +++ b/vendor/lib/lib_path.cmd @@ -57,39 +57,38 @@ exit /b ) else ( set "PATH=%add_path%;%PATH%" ) + goto :end_enhance_path ) - set "PATH=%PATH:;;=;%" - if "%fast_init%" == "1" ( - exit /b - ) - - rem setlocal enabledelayedexpansion - set found=0 set "find_query=%add_path%" set "find_query=%find_query:\=\\%" set "find_query=%find_query: =\ %" + set OLD_PATH=%PATH% - if "%CMDER_CONFIGURED%" == "1" ( - %lib_console% debug_output :enhance_path "Env Var - find_query=%find_query%" - echo "%path%"|%WINDIR%\System32\findstr >nul /I /R ";%find_query%\"$" - REM if "!ERRORLEVEL!" == "0" set found=1 + setlocal enabledelayedexpansion + if "%found%" == "0" ( + echo "%path%"|%WINDIR%\System32\findstr >nul /I /R /C:";%find_query%;" call :set_found ) - %lib_console% debug_output :enhance_path "Env Var 1 - found=%found%" + %lib_console% debug_output :enhance_path "Env Var INSIDE PATH %find_query% - found=%found%" - if "%found%" == "0" ( - if "%CMDER_CONFIGURED%" == "1" ( - echo "%path%"|%WINDIR%\System32\findstr >nul /i /r ";%find_query%;" - REM if "!ERRORLEVEL!" == "0" set found=1 - call :set_found - ) - %lib_console% debug_output :enhance_path "Env Var 2 - found=%found%" + if /i "%position%" == "append" ( + if "!found!" == "0" ( + echo "%path%"|%WINDIR%\System32\findstr >nul /I /R /C:";%find_query%\"$" + call :set_found + ) + %lib_console% debug_output :enhance_path "Env Var END PATH %find_query% - found=!found!" + ) else ( + if "!found!" == "0" ( + echo "%path%"|%WINDIR%\System32\findstr >nul /I /R /C:"^\"%find_query%;" + call :set_found + ) + %lib_console% debug_output :enhance_path "Env Var BEGIN PATH %find_query% - found=!found!" ) + endlocal & set found=%found% if "%found%" == "0" ( - %lib_console% debug_output :enhance_path "BEFORE Env Var - PATH=%path%" if /i "%position%" == "append" ( %lib_console% debug_output :enhance_path "Appending '%add_path%'" set "PATH=%PATH%;%add_path%" @@ -98,16 +97,23 @@ exit /b set "PATH=%add_path%;%PATH%" ) - %lib_console% debug_output :enhance_path "AFTER Env Var - PATH=%path%" + set found=1 ) - rem :end_enhance_path - rem endlocal & set "PATH=%PATH:;;=;%" + :end_enhance_path set "PATH=%PATH:;;=;%" + if NOT "%OLD_PATH%" == "%PATH%" ( + %lib_console% debug_output :enhance_path "END Env Var - PATH=%path%" + %lib_console% debug_output :enhance_path "Env Var %find_query% - found=%found%" + ) + set "position=" exit /b :set_found - if "!ERRORLEVEL!" == "0" set found=1 + if "%ERRORLEVEL%" == "0" ( + set found=1 + ) + exit /b :enhance_path_recursive @@ -165,7 +171,6 @@ exit /b exit /b ) - rem setlocal enabledelayedexpansion if "%depth%" == "" set depth=0 %lib_console% debug_output :enhance_path_recursive "Env Var - add_path=%add_path%" @@ -175,13 +180,10 @@ exit /b if %max_depth% gtr %depth% ( %lib_console% debug_output :enhance_path_recursive "Adding parent directory - '%add_path%'" call :enhance_path "%add_path%" %position% - REM set /a "depth=!depth!+1" call :set_depth call :loop_depth ) - rem :end_enhance_path_recursive - rem endlocal & set "PATH=%PATH%" set "PATH=%PATH%" exit /b From 9b29668250a4e4dd311d6ca25278bb9288734806 Mon Sep 17 00:00:00 2001 From: "Dax T. Games" Date: Wed, 4 Dec 2019 16:09:38 -0500 Subject: [PATCH 2/9] fixes for cmd:cmder init script --- CHANGELOG.md | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index a9a4842..a475827 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -2,7 +2,12 @@ ## [Unreleased] -## [1.3.13](https://github.com/cmderdev/cmder/tree/v1.3.12) (2019-11-03) +### Fixes + +* #2218 Cmder v1.3.13 init script fails. [#2218](https://github.com/cmderdev/cmder/issues/2218) +* #2220 Git & env related error messages. [#2220](https://github.com/cmderdev/cmder/issues/2220) + +## [1.3.13](https://github.com/cmderdev/cmder/tree/v1.3.13) (2019-11-03) ### Changes From 750560851f6d165a158a6c6e6b0e9a5aaf6697dd Mon Sep 17 00:00:00 2001 From: "Dax T. Games" Date: Wed, 4 Dec 2019 16:13:08 -0500 Subject: [PATCH 3/9] fixes for cmd:cmder init script --- CHANGELOG.md | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index a475827..a474010 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -4,8 +4,8 @@ ### Fixes -* #2218 Cmder v1.3.13 init script fails. [#2218](https://github.com/cmderdev/cmder/issues/2218) -* #2220 Git & env related error messages. [#2220](https://github.com/cmderdev/cmder/issues/2220) +* Cmder v1.3.13 init script fails. [#2218](https://github.com/cmderdev/cmder/issues/2218) +* Git & env related error messages. [#2220](https://github.com/cmderdev/cmder/issues/2220) ## [1.3.13](https://github.com/cmderdev/cmder/tree/v1.3.13) (2019-11-03) From 84917159ec61f80044733e88918745cb10f5bd97 Mon Sep 17 00:00:00 2001 From: "Dax T. Games" Date: Wed, 4 Dec 2019 16:14:36 -0500 Subject: [PATCH 4/9] fixes for cmd:cmder init script --- CHANGELOG.md | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index a474010..7e495b6 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -4,8 +4,9 @@ ### Fixes -* Cmder v1.3.13 init script fails. [#2218](https://github.com/cmderdev/cmder/issues/2218) -* Git & env related error messages. [#2220](https://github.com/cmderdev/cmder/issues/2220) +* Pull Request: [#2222](https://github.com/cmderdev/cmder/pull/2222) + * Cmder v1.3.13 init script fails. [#2218](https://github.com/cmderdev/cmder/issues/2218) + * Git & env related error messages. [#2220](https://github.com/cmderdev/cmder/issues/2220) ## [1.3.13](https://github.com/cmderdev/cmder/tree/v1.3.13) (2019-11-03) From 93cf865071149c5334ab2cbb7b3d6cdb2d62bc3f Mon Sep 17 00:00:00 2001 From: "Dax T. Games" Date: Sun, 5 Jan 2020 16:41:02 -0500 Subject: [PATCH 5/9] post-install fixes --- vendor/init.bat | 8 +++++++- 1 file changed, 7 insertions(+), 1 deletion(-) diff --git a/vendor/init.bat b/vendor/init.bat index 8b0a885..cdac288 100644 --- a/vendor/init.bat +++ b/vendor/init.bat @@ -316,8 +316,14 @@ call "%user_aliases%" :: Basically we need to execute this post-install.bat because we are :: manually extracting the archive rather than executing the 7z sfx if exist "%GIT_INSTALL_ROOT%\post-install.bat" ( - echo Running Git for Windows one time Post Install.... + echo Running Git for Windows one time post install - %GIT_INSTALL_ROOT%\post-install.bat".... pushd "%GIT_INSTALL_ROOT%\" + copy post-install.bat post-install.cmder-bak.bat + if not exist "etc\post-install-cmder.bak" ( + md etc\post-install-cmder.bak + ) + xcopy etc\post-install\* etc\post-install-cmder.bak + copy post-install.bat post-install.cmder-bak.bat "%GIT_INSTALL_ROOT%\git-cmd.exe" --no-needs-console --no-cd --command=post-install.bat popd ) From 180e72a6aa0a9e5affaf8d2cf3e1fd272e2127fd Mon Sep 17 00:00:00 2001 From: "Dax T. Games" Date: Sun, 5 Jan 2020 13:52:23 -0800 Subject: [PATCH 6/9] revert --no-log to fix windows 7 clink prompt --- vendor/init.bat | 18 +++++++----------- 1 file changed, 7 insertions(+), 11 deletions(-) diff --git a/vendor/init.bat b/vendor/init.bat index cdac288..3c97cb5 100644 --- a/vendor/init.bat +++ b/vendor/init.bat @@ -141,14 +141,14 @@ if "%CMDER_CLINK%" == "1" ( copy "%CMDER_ROOT%\vendor\clink_settings.default" "%CMDER_USER_CONFIG%\settings" echo Additional *.lua files in "%CMDER_USER_CONFIG%" are loaded on startup.\ ) - "%CMDER_ROOT%\vendor\clink\clink_x%architecture%.exe" inject --quiet --profile "%CMDER_USER_CONFIG%" --scripts "%CMDER_ROOT%\vendor" --nolog + "%CMDER_ROOT%\vendor\clink\clink_x%architecture%.exe" inject --quiet --profile "%CMDER_USER_CONFIG%" --scripts "%CMDER_ROOT%\vendor" ) else ( if not exist "%CMDER_ROOT%\config\settings" ( echo Generating clink initial settings in "%CMDER_ROOT%\config\settings" copy "%CMDER_ROOT%\vendor\clink_settings.default" "%CMDER_ROOT%\config\settings" echo Additional *.lua files in "%CMDER_ROOT%\config" are loaded on startup. ) - "%CMDER_ROOT%\vendor\clink\clink_x%architecture%.exe" inject --quiet --profile "%CMDER_ROOT%\config" --scripts "%CMDER_ROOT%\vendor" --nolog + "%CMDER_ROOT%\vendor\clink\clink_x%architecture%.exe" inject --quiet --profile "%CMDER_ROOT%\config" --scripts "%CMDER_ROOT%\vendor" ) ) else ( %lib_console% verbose_output "WARNING: Incompatible 'ComSpec/Shell' Detetected Skipping Clink Injection!" @@ -192,13 +192,14 @@ for /F "delims=" %%F in ('where git.exe 2^>nul') do ( :VENDORED_GIT if exist "%CMDER_ROOT%\vendor\git-for-windows" ( set "GIT_INSTALL_ROOT=%CMDER_ROOT%\vendor\git-for-windows" + %lib_console% debug_output "Using vendored Git '%GIT_VERSION_VENDORED%'..." goto :CONFIGURE_GIT ) else ( goto :NO_GIT ) :SPECIFIED_GIT -%lib_console% debug_output "Using /GIT_INSTALL_ROOT from '%GIT_INSTALL_ROOT%..." +%lib_console% debug_output "Using /GIT_INSTALL_ROOT..." goto :CONFIGURE_GIT :FOUND_GIT @@ -206,6 +207,7 @@ goto :CONFIGURE_GIT goto :CONFIGURE_GIT :CONFIGURE_GIT +%lib_console% debug_output "Using Git from '%GIT_INSTALL_ROOT%..." :: Add git to the path rem add the unix commands at the end to not shadow windows commands like more if %nix_tools% equ 1 ( @@ -316,14 +318,8 @@ call "%user_aliases%" :: Basically we need to execute this post-install.bat because we are :: manually extracting the archive rather than executing the 7z sfx if exist "%GIT_INSTALL_ROOT%\post-install.bat" ( - echo Running Git for Windows one time post install - %GIT_INSTALL_ROOT%\post-install.bat".... + echo Running Git for Windows one time Post Install.... pushd "%GIT_INSTALL_ROOT%\" - copy post-install.bat post-install.cmder-bak.bat - if not exist "etc\post-install-cmder.bak" ( - md etc\post-install-cmder.bak - ) - xcopy etc\post-install\* etc\post-install-cmder.bak - copy post-install.bat post-install.cmder-bak.bat "%GIT_INSTALL_ROOT%\git-cmd.exe" --no-needs-console --no-cd --command=post-install.bat popd ) @@ -413,6 +409,7 @@ exit /b set test_dir= ) ) else ( + :: compare the user git version against the vendored version :: if the user provided git executable is not found if %errorlevel% equ -255 ( call :verbose_output No git at "%git_executable%" found. @@ -422,7 +419,6 @@ exit /b exit /b :get_user_git_version - :: get the version information for the user provided git binary %lib_git% read_version USER "%test_dir%" %lib_git% validate_version USER %GIT_VERSION_USER% From ec06f3e39b5e0b1186a4914ac0a192cf4d1dcc21 Mon Sep 17 00:00:00 2001 From: "Dax T. Games" Date: Mon, 6 Jan 2020 22:50:03 -0500 Subject: [PATCH 7/9] changelog --- CHANGELOG.md | 8 +++++++- 1 file changed, 7 insertions(+), 1 deletion(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index 7e495b6..c30fdc3 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -1,12 +1,18 @@ # Change Log -## [Unreleased] +## [1.3.14-pre](https://github.com/cmderdev/cmder) [Unreleased] ### Fixes * Pull Request: [#2222](https://github.com/cmderdev/cmder/pull/2222) * Cmder v1.3.13 init script fails. [#2218](https://github.com/cmderdev/cmder/issues/2218) * Git & env related error messages. [#2220](https://github.com/cmderdev/cmder/issues/2220) + * Latest addition of "--nolog" clink breaks cmd prompts. [#2166](https://github.com/cmderdev/cmder/issues/2166) + +### Changes + +* Update Git for Windows to 2.24.1.windows.2 + * Pull Request: [#2237](https://github.com/cmderdev/cmder/pull/2237) ## [1.3.13](https://github.com/cmderdev/cmder/tree/v1.3.13) (2019-11-03) From 492fc284f28edfed5b0caa0ad3b1c408b6175349 Mon Sep 17 00:00:00 2001 From: "Dax T. Games" Date: Mon, 6 Jan 2020 22:57:29 -0500 Subject: [PATCH 8/9] Fix issue #2214 --- CHANGELOG.md | 1 + vendor/init.bat | 12 ++++++------ 2 files changed, 7 insertions(+), 6 deletions(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index c30fdc3..0cbce87 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -8,6 +8,7 @@ * Cmder v1.3.13 init script fails. [#2218](https://github.com/cmderdev/cmder/issues/2218) * Git & env related error messages. [#2220](https://github.com/cmderdev/cmder/issues/2220) * Latest addition of "--nolog" clink breaks cmd prompts. [#2166](https://github.com/cmderdev/cmder/issues/2166) + * `/nix_tools 0` should prevent adding `%GIT_INSTALL_ROOT%\mingw64\bin` to PATH. [#2214](https://github.com/cmderdev/cmder/issues/2214) ### Changes diff --git a/vendor/init.bat b/vendor/init.bat index 3c97cb5..c6f519d 100644 --- a/vendor/init.bat +++ b/vendor/init.bat @@ -219,13 +219,13 @@ if %nix_tools% equ 1 ( ) if exist "%GIT_INSTALL_ROOT%\cmd\git.exe" %lib_path% enhance_path "%GIT_INSTALL_ROOT%\cmd" %path_position% -if exist "%GIT_INSTALL_ROOT%\mingw32" ( - %lib_path% enhance_path "%GIT_INSTALL_ROOT%\mingw32\bin" %path_position% -) else if exist "%GIT_INSTALL_ROOT%\mingw64" ( - %lib_path% enhance_path "%GIT_INSTALL_ROOT%\mingw64\bin" %path_position% -) - if %nix_tools% geq 1 ( + if exist "%GIT_INSTALL_ROOT%\mingw32" ( + %lib_path% enhance_path "%GIT_INSTALL_ROOT%\mingw32\bin" %path_position% + ) else if exist "%GIT_INSTALL_ROOT%\mingw64" ( + %lib_path% enhance_path "%GIT_INSTALL_ROOT%\mingw64\bin" %path_position% + ) + %lib_path% enhance_path "%GIT_INSTALL_ROOT%\usr\bin" %path_position% ) From ca2550b70e7dee68325333500b7eee639cfdbaa4 Mon Sep 17 00:00:00 2001 From: "Dax T. Games" Date: Mon, 6 Jan 2020 23:03:11 -0500 Subject: [PATCH 9/9] Fix issue #2214 --- CHANGELOG.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index 0cbce87..9783110 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -1,6 +1,6 @@ # Change Log -## [1.3.14-pre](https://github.com/cmderdev/cmder) [Unreleased] +## 1.3.14-pre [Unreleased] ### Fixes