Unable to update on Windows
I'm unable to update git-extras using the command "git extras update" on Windows 10:
>>> sudo git extras update
Setting up 'git-extras'....
'C:\Users\Rafael' is not recognized as an internal or external command,
operable program or batch file.
My home folder is: "C:\Users\Rafael Dominiquini" My git is installed on: "C:\Program Files\Git"
- In the git-extras file, I debug this variables:
local bin="$(command -v git-extras)"
local prefix=${bin%/*/*}
- Value:
BIN: /mingw64/bin/git-extras
PREFIX: /mingw64
I was able to update the program using the installation method:
- Cloning the repository
- Running "sudo install.cmd"
Thanks
Interesting. I am not familiar with mingw environment. Maybe you can add set -x in the script, and run the displayed command manually to see which part is broken?
It looks like an issue with word splitting.
Interesting. I am not familiar with mingw environment. Maybe you can add
set -xin the script, and run the displayed command manually to see which part is broken?
This is the output:
>>>git extras update
+ unset -v GREP_OPTIONS
+ VERSION=7.0.0
+ INSTALL_SCRIPT=https://raw.githubusercontent.com/tj/git-extras/master/install.sh
+ case "$1" in
++ uname -s
+ platform=MINGW64_NT-10.0-19045
+ '[' MINGW64_N = CYGWIN_NT ']'
+ '[' MINGW = MINGW ']'
+ updateForWindows
++ command -v git-extras
+ local bin=/mingw64/bin/git-extras
+ local prefix=/mingw64
+ local 'orig=/f/Videos/ZZZ - Others'
+ cd /tmp
+ rm -rf ./git-extras
+ echo 'Setting up '\''git-extras'\''....'
Setting up 'git-extras'....
+ git clone https://github.com/tj/git-extras.git
+ cd git-extras
+++ git rev-list --tags --max-count=1
++ git describe --tags d7f0fcc5460af875dd919a06c170503f83bf57d3
+ git checkout 7.0.0
+ ./install.cmd /mingw64
'C:\Users\Rafael' is not recognized as an internal or external command,
operable program or batch file.
+ rm -rf /tmp/git-extras
If I remove the "$prefix" from the "./install.cmd" command line (I don't need specify anything when I manually installed git-extras), this is the output:
>>>git extras update
+ unset -v GREP_OPTIONS
+ VERSION=7.0.0
+ INSTALL_SCRIPT=https://raw.githubusercontent.com/tj/git-extras/master/install.sh
+ case "$1" in
++ uname -s
+ platform=MINGW64_NT-10.0-19045
+ '[' MINGW64_N = CYGWIN_NT ']'
+ '[' MINGW = MINGW ']'
+ updateForWindows
++ command -v git-extras
+ local bin=/mingw64/bin/git-extras
+ local prefix=/mingw64
+ local 'orig=/f/Videos/ZZZ - Others'
+ cd /tmp
+ rm -rf ./git-extras
+ echo 'Setting up '\''git-extras'\''....'
Setting up 'git-extras'....
+ git clone https://github.com/tj/git-extras.git
+ cd git-extras
+++ git rev-list --tags --max-count=1
++ git describe --tags d7f0fcc5460af875dd919a06c170503f83bf57d3
+ git checkout 7.0.0
+ ./install.cmd
No mingw64 folder found in C:\Program Files\Git\mingw64\libexec.
Please supply a proper "Git for Windows 2.x" install path:
"install.cmd c:\[git-install-path]"
+ cd '/f/Videos/ZZZ - Others'
++ git extras --version
+ unset -v GREP_OPTIONS
+ VERSION=7.0.0
+ INSTALL_SCRIPT=https://raw.githubusercontent.com/tj/git-extras/master/install.sh
+ case "$1" in
+ echo 7.0.0
+ exit 0
+ echo '... updated git-extras 7.0.0 -> 7.0.0'
... updated git-extras 7.0.0 -> 7.0.0
+ rm -rf /tmp/git-extras
This is the directory that the script needed to copy the files: "C:\Program Files\Git\mingw64\bin"!
Running the "install.cmd" on the powershell, it works fine! But running using "git extras update" not!
Thanks.
I noticed another thing:
Running the install script manually, it try to copy the files on the path "C:\Program Files\Git\mingw64\bin" But using the update method, it try to copy the files on the path "C:\Program Files\Git\mingw64\libexec"
Thanks
So the problem is inside the cmd script.
I am not familiar with the cmd syntax. As @hyperupcall suggested, maybe there is a space after 'C:\Users\Rafael'? And the powershell environment can handle word splitting smartly.
So the problem is inside the cmd script. I am not familiar with the cmd syntax. As @hyperupcall suggested, maybe there is a space after
'C:\Users\Rafael'?
Yes, my username is "Rafael Dominiquini"
And the powershell environment can handle word splitting smartly.
Probably! Running this script (install.cmd) on Powershell installs the application correctly!
Thanks
I was able to reproduce it, but after fiddling trying to fix it, I get a different error:
C:\Program Files\Git\mingw64\bin\git-extras: line 23: ::::::::::::::: command not found
C:\Program Files\Git\mingw64\bin\git-extras: line 24: C:cygwin64tmpgit-extras\bingit-extras: No such file or directory
C:\Program Files\Git\mingw64\bin\git-extras: line 25: ::::::::::::::: command not found
Setting up 'git-extras'....
Using git install path "C:/Program Files/Git/mingw64" as PREFIX, please make sure it's really a
path to the mingw64 directory...
Installing to C:/Program Files/Git/mingw64
Directory for binaries ["C:/Program Files/Git/mingw64\bin"] is not writeable by install.cmd.
You probably need to run install.cmd from an admin prompt.
C:\Program Files\Git\mingw64\bin\git-extras: line 23: ::::::::::::::: command not found
C:\Program Files\Git\mingw64\bin\git-extras: line 24: C:cygwin64tmpgit-extras\bingit-extras: No such file or directory
C:\Program Files\Git\mingw64\bin\git-extras: line 25: ::::::::::::::: command not found
... updated git-extras 7.1.0 -> 7.1.0
I ran this in Windows with both PowerShell and cmd, and both worked. But, the issue only popped up when I was using Cygwin. So I think the issue might be Cygwin-related