Skip to content

Commit

Permalink
Fix reg query potentially getting truncated
Browse files Browse the repository at this point in the history
Signed-off-by: Moritz Bender <[email protected]>
  • Loading branch information
Morilli committed Jun 6, 2024
1 parent 5fd7f09 commit 74044e5
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion git-extra/getgit
Original file line number Diff line number Diff line change
Expand Up @@ -248,7 +248,7 @@ echo "be removed from the context menu is available as $rm_ctxmenu "
echo ""
# Setting ENV
echo -n "Setting env ..."
userpath=$(reg query "HKEY_CURRENT_USER\Environment" //v Path 2>/dev/null | awk 'NR==3 {print $NF}')
userpath=$(reg query "HKEY_CURRENT_USER\Environment" //v Path 2>/dev/null | tail -n +3 | awk '{$1=$2=""; print substr($0,3)}')
if [[ "$userpath" == "" ]]; then
setx PATH "$(cygpath -m /cmd)" > /dev/null 2>&1
elif [[ "$userpath" != *"$(cygpath -m /cmd)"* ]]; then
Expand Down

0 comments on commit 74044e5

Please sign in to comment.