mirror of
https://github.com/cmderdev/cmder.git
synced 2024-11-10 09:49:12 +08:00
Merge pull request #605 from Stanzilla/bumpgit
Converting msysgit support to git-for-windows support.
This commit is contained in:
commit
1f75f85b7c
@ -23,7 +23,7 @@ The main advantage of Cmder is portability. It is designed to be totally self-co
|
||||
|
||||
## Integration
|
||||
|
||||
So you've experimented with cmder a little and want to give it a shot in a more permanent home;
|
||||
So you've experimented with Cmder a little and want to give it a shot in a more permanent home;
|
||||
|
||||
### Shortcut to open Cmder in a chosen folder
|
||||
|
||||
@ -64,9 +64,9 @@ All aliases will be saved in `/config/aliases` file
|
||||
|
||||
### SSH Agent
|
||||
|
||||
To start SSH agent simply call `agent`, which is in the `bin` folder.
|
||||
To start SSH agent simply call `start-ssh-agent`, which is in the `vendor/git-for-windows/cmd` folder.
|
||||
|
||||
If you want to run SSH agent on startup, uncomment the line in `/vendor/init.bat`so it says `@call "%CMDER_ROOT%/bin/agent.cmd"`.
|
||||
If you want to run SSH agent on startup, uncomment the line in `/vendor/init.bat`so it says `@call "%GIT_INSTALL_ROOT%/cmd/start-ssh-agent.cmd"`.
|
||||
|
||||
## Todo
|
||||
|
||||
|
@ -1,46 +0,0 @@
|
||||
@ECHO OFF
|
||||
|
||||
REM Set default sock file
|
||||
SET SSH_AUTH_SOCK=/tmp/ssh-agent.sock
|
||||
|
||||
REM Check socket is available
|
||||
IF NOT EXIST "%TMP%\ssh-agent.sock" GOTO:RUNAGENT
|
||||
|
||||
REM Check if an ssh-agent is running
|
||||
FOR /f "tokens=*" %%I IN ('ps ^| grep ssh-agent ^| sed "s/^ *\([0-9]\+\) .*/\1/"') DO SET VAR=%%I
|
||||
IF "%VAR%" == "" GOTO:RUNAGENT
|
||||
|
||||
REM Check if socket file is valid
|
||||
ssh-add -l 1> NUL 2>&1
|
||||
IF ERRORLEVEL 1 GOTO:RUNAGENT
|
||||
GOTO:ADDKEYS
|
||||
|
||||
:RUNAGENT
|
||||
REM Remove old socket file
|
||||
rm -f /tmp/ssh-agent.sock
|
||||
|
||||
REM Run ssh-agent and save (last) PID in VAR
|
||||
SET VAR=
|
||||
FOR /f "tokens=*" %%J IN ('ssh-agent -a /tmp/ssh-agent.sock') DO FOR /f "tokens=*" %%K IN ('echo %%J ^| grep "SSH_AGENT_PID" ^| sed "s/^SSH_AGENT_PID=\([0-9]\+\); .*/\1/"') DO SET VAR=%%K
|
||||
|
||||
:ADDKEYS
|
||||
SET SSH_AUTH_PID=%VAR%
|
||||
|
||||
REM Check if ssh keys are known
|
||||
SET KEYS=
|
||||
FOR /f "tokens=*" %%I IN ('DIR /B "%HOME%\.ssh\*_rsa"') DO CALL:CHECKKEY %%I
|
||||
|
||||
REM Add missing ssh keys at once
|
||||
IF NOT "%KEYS%" == "" ssh-add %KEYS%
|
||||
GOTO:END
|
||||
|
||||
REM Functions
|
||||
REM Check if ssh key has to be added
|
||||
:CHECKKEY
|
||||
SET VAR=
|
||||
FOR /f "tokens=*" %%J IN ('ssh-add -l ^| grep "%1"') DO SET VAR=%%J
|
||||
IF "%VAR%" == "" SET KEYS='%HOME%\.ssh\%1' %KEYS%
|
||||
GOTO:EOF
|
||||
|
||||
:END
|
||||
@ECHO ON
|
@ -516,8 +516,8 @@
|
||||
<value name="Name" type="string" data="{git sh}"/>
|
||||
<value name="Hotkey" type="dword" data="00000000"/>
|
||||
<value name="GuiArgs" type="string" data=" /icon "%CMDER_ROOT%\cmder.exe""/>
|
||||
<value name="Cmd1" type="string" data="cmd /k "%ConEmuDir%\..\init.bat & %CMDER_ROOT%\vendor\msysgit\bin\bash --login -i" -new_console:d:%USERPROFILE%"/>
|
||||
<value name="Cmd2" type="string" data="%CMDER_ROOT%\vendor\msysgit\git-bash.bat"/>
|
||||
<value name="Cmd1" type="string" data="cmd /k "%ConEmuDir%\..\init.bat & %CMDER_ROOT%\vendor\git-for-windows\bin\bash --login -i" -new_console:d:%USERPROFILE%"/>
|
||||
<value name="Cmd2" type="string" data="%CMDER_ROOT%\vendor\git-for-windows\git-bash.exe"/>
|
||||
<value name="Active" type="dword" data="00000000"/>
|
||||
<value name="Count" type="dword" data="00000001"/>
|
||||
</key>
|
||||
|
@ -11,11 +11,11 @@
|
||||
.EXAMPLE
|
||||
.\build.ps1
|
||||
|
||||
Executes the default build for cmder; Conemu, clink. This is equivalent to the "minimum" style package in the releases
|
||||
Executes the default build for Cmder; Conemu, clink. This is equivalent to the "minimum" style package in the releases
|
||||
.EXAMPLE
|
||||
.\build.ps1 -Full
|
||||
|
||||
Executes a full build for cmder, including git. This is equivalent to the "full" style package in the releases
|
||||
Executes a full build for Cmder, including git. This is equivalent to the "full" style package in the releases
|
||||
.EXAMPLE
|
||||
.\build -verbose
|
||||
|
||||
@ -76,7 +76,7 @@ if ($config -ne "") {
|
||||
|
||||
|
||||
foreach ($s in $sources) {
|
||||
if($Full -eq $false -and $s.name -eq "msysgit"){
|
||||
if($Full -eq $false -and $s.name -eq "git-for-windows"){
|
||||
Continue
|
||||
}
|
||||
|
||||
|
@ -42,7 +42,7 @@ Ensure-Executable "7z"
|
||||
$targets = @{
|
||||
"cmder.zip" = $null;
|
||||
"cmder.7z" = $null;
|
||||
"cmder_mini.zip" = "-x!`"vendor\msysgit`"";
|
||||
"cmder_mini.zip" = "-x!`"vendor\git-for-windows`"";
|
||||
}
|
||||
|
||||
Delete-Existing "..\Version*"
|
||||
|
8
vendor/init.bat
vendored
8
vendor/init.bat
vendored
@ -21,7 +21,7 @@
|
||||
:: Run clink
|
||||
@"%CMDER_ROOT%\vendor\clink\clink_x%architecture%.exe" inject --quiet --profile "%CMDER_ROOT%\config"
|
||||
|
||||
:: Prepare for msysgit
|
||||
:: Prepare for git-for-windows
|
||||
|
||||
:: I do not even know, copypasted from their .bat
|
||||
@set PLINK_PROTOCOL=ssh
|
||||
@ -33,12 +33,12 @@
|
||||
) else if exist "%ProgramFiles(x86)%\Git" (
|
||||
set "GIT_INSTALL_ROOT=%ProgramFiles(x86)%\Git"
|
||||
) else if exist "%CMDER_ROOT%\vendor" (
|
||||
set "GIT_INSTALL_ROOT=%CMDER_ROOT%\vendor\msysgit"
|
||||
set "GIT_INSTALL_ROOT=%CMDER_ROOT%\vendor\git-for-windows"
|
||||
)
|
||||
|
||||
:: Add git to the path
|
||||
@if defined GIT_INSTALL_ROOT (
|
||||
set "PATH=%GIT_INSTALL_ROOT%\bin;%GIT_INSTALL_ROOT%\share\vim\vim74;%PATH%"
|
||||
set "PATH=%GIT_INSTALL_ROOT%\bin;%GIT_INSTALL_ROOT%\usr\bin;%GIT_INSTALL_ROOT%\share\vim\vim74;%PATH%"
|
||||
:: define SVN_SSH so we can use git svn with ssh svn repositories
|
||||
if not defined SVN_SSH set "SVN_SSH=%GIT_INSTALL_ROOT:\=\\%\\bin\\ssh.exe"
|
||||
)
|
||||
@ -60,4 +60,4 @@
|
||||
)
|
||||
)
|
||||
|
||||
:: @call "%CMDER_ROOT%/bin/agent.cmd"
|
||||
:: @call "%GIT_INSTALL_ROOT%/cmd/start-ssh-agent.cmd"
|
||||
|
2
vendor/profile.ps1
vendored
2
vendor/profile.ps1
vendored
@ -14,7 +14,7 @@ try {
|
||||
# Check if git is on PATH, i.e. Git already installed on system
|
||||
Get-command -Name "git" -ErrorAction Stop >$null
|
||||
} catch {
|
||||
$env:Path += ";$env:CMDER_ROOT\vendor\msysgit\bin"
|
||||
$env:Path += ";$env:CMDER_ROOT\vendor\git-for-windows\bin"
|
||||
}
|
||||
|
||||
try {
|
||||
|
6
vendor/sources.json
vendored
6
vendor/sources.json
vendored
@ -1,8 +1,8 @@
|
||||
[
|
||||
{
|
||||
"name": "msysgit",
|
||||
"version": "1.9.5-preview20150319",
|
||||
"url": "https://github.com/msysgit/msysgit/releases/download/Git-1.9.5-preview20150319/PortableGit-1.9.5-preview20150319.7z"
|
||||
"name": "git-for-windows",
|
||||
"version": "v2.6.1.windows.1",
|
||||
"url": "https://github.com/git-for-windows/git/releases/download/v2.6.1.windows.1/PortableGit-2.6.1-32-bit.7z.exe"
|
||||
},
|
||||
{
|
||||
"name": "clink",
|
||||
|
Loading…
Reference in New Issue
Block a user