Compare commits

...

56 Commits
v1.2 ... v1.2.9

Author SHA1 Message Date
d6b54eec24 Merge pull request #612 from JanSchulz/user-startup
Add a user startup file which can be modified
2015-10-13 18:12:27 +02:00
052ab118e2 Merge pull request #398 from mikesigs/development
Handle quoted paths
2015-10-13 17:52:12 +02:00
c46eb6a525 Merge remote-tracking branch 'upstream/development' into development
Conflicts:
	bin/alias.bat
2015-10-12 21:32:33 -06:00
48259b87ac Add a user startup file which can be modified
Up to now, init.bat would be overwritten when a user updated
Cmder. The new mechanism will create a new (mostly empty) file
for the user to enter commands which will then be executed on
each following startup.
2015-10-12 15:15:33 +02:00
2a26026749 Update README.md
Update Gitter badge
2015-10-12 14:30:04 +02:00
d68816bd11 Update readme 2015-10-12 13:29:47 +02:00
419c785db5 Merge pull request #575 from Bobo1239/enhance-path
Enhance Path in profile.ps1
2015-10-12 13:24:07 +02:00
c15e3f4ebd Merge pull request #585 from Stanzilla/revert_powershell
Revert "Run PowerShell as default"
2015-10-12 13:23:43 +02:00
1f75f85b7c Merge pull request #605 from Stanzilla/bumpgit
Converting msysgit support to git-for-windows support.
2015-10-12 13:23:06 +02:00
4203a8a4ea Merge pull request #653 from vladimir-kotikov/development
Upgrade clink-completions to 0.2.0
2015-10-12 13:11:44 +02:00
cf8a992e37 Merge pull request #601 from Stanzilla/bump_conemu
⬆️ ConEmu@150816
2015-10-12 13:10:23 +02:00
cec7fa3398 Merge eec3fd5578 2015-10-12 13:08:16 +02:00
83c685cdc7 ⬆️ ConEmu to v15.09.13 2015-10-12 13:06:50 +02:00
24fd027cda Update ConEmo project URL 2015-10-12 13:06:50 +02:00
df259195ab ⬆️ ConEmu@150816 2015-10-12 13:06:50 +02:00
20b8b09419 Add -ExecutionPolicy Bypass to the powershell tasks
Fix issue #483
2015-10-12 13:02:43 +02:00
7bc71010c2 Update .gitignore 2015-10-12 13:02:30 +02:00
6608e16c3b Merge pull request #634 from Stanzilla/revert_cleanupgit
Revert 8b8f98c
2015-10-12 12:52:39 +02:00
d979140bb5 Merge pull request #569 from eeree/issue_568
Fixed: 'Enable-GitColors is Obsolete...' warning
2015-10-12 12:52:08 +02:00
568e2cfcdd Merge pull request #600 from Maximus5/br-xml-location
Use standard path for ConEmu.xml
2015-10-12 12:50:28 +02:00
36291ab789 ⬆️ Git for Windows to v2.6.1.windows.1 2015-10-06 21:16:32 +02:00
73c8c0c233 Upgrade clink-completions 2015-10-06 21:45:32 +03:00
32cd7dcb58 ⬆️ Git to v2.6.0.windows.1 2015-09-30 20:35:13 +02:00
b40b0067c0 ⬆️ Git to v2.5.3.windows.1 2015-09-23 20:51:53 +02:00
4edec1675a update to 2.5.2 release 2 2015-09-16 06:18:29 +02:00
4ed35fe110 Revert 8b8f98c
Breaks Git: #503 #521, because git <command> actually uses git-<command>.
2015-09-11 23:51:10 +02:00
583109b695 update to 2.5.2 2015-09-11 22:53:21 +02:00
f783cd8add fix readme 2015-09-05 00:04:51 +02:00
6952d602d2 update to 2.5.1
https://github.com/git-for-windows/git/releases/tag/v2.5.1.windows.1
2015-09-02 19:50:44 +02:00
eec3fd5578 Backup and restore ConEmu.xml on ./build.ps1 2015-09-01 20:09:17 +03:00
7c907a5174 Use standard path for ConEmu.xml 2015-09-01 20:09:17 +03:00
30f7847852 Merge pull request #619 from Stanzilla/bump_clink
Update clink to 0.4.5
2015-09-01 13:10:54 +01:00
801a4ac901 update readme 2015-08-31 05:05:16 +02:00
143e659187 ⬆️ clink to 0.4.5 2015-08-31 04:48:46 +02:00
7fd43b939b delete our own, now obsolete agent launcher 2015-08-31 04:40:10 +02:00
5ce077a74a call git's own ssh-agent script instead of our own 2015-08-28 02:53:49 +02:00
fc85915b2c git 2.5 packages the unix commands in <git>/usr/bin instead of <git>/binso add that to the path, too. 2015-08-28 02:47:02 +02:00
373a58e1e6 forgot one 2015-08-23 20:21:45 +02:00
3e06fcbf07 First step at converting msysgit support to git-for-windows support. 2015-08-23 20:09:06 +02:00
ecbf7a01d1 Revert "Run PowerShell as default"
This reverts commit aaf70a4d9f.
2015-08-09 14:16:24 +02:00
dc9263a11c Merge pull request #578 from Stanzilla/development
update VS to 2015 release version and switch to /MT for static linking
2015-08-04 14:55:02 +01:00
8659b9c6ed update VS to 2015 release version and switch to /MT for static linking 2015-08-04 15:00:32 +02:00
316a42b8f9 Enhance Path in profile.ps1 2015-08-03 16:06:41 +02:00
676297c0d4 Fixed: 'Enable-GitColors is Obsolete...' warning 2015-07-31 21:45:32 +02:00
70b0615b34 Merge pull request #517 from bondz/patch-1
Remove depreciated Enable-GitColors in posh-git
2015-06-05 12:02:50 +01:00
2a1a736ceb Remove depreciated Enable-GitColors
The function Enable-GitColors is depreciated in dahlbyk/posh-git@4e778e2480 and should be removed here as well.
2015-06-04 23:25:09 +01:00
40fd96b135 Remove leftover history.
This is not needed and confuses users.
2015-05-20 10:55:17 +01:00
271b3ea876 Avoid commiting the wrong dlls 2015-05-19 18:37:34 +01:00
c4873c6e58 Revert "Update to VS2015."
This reverts commit 53efab127e.
2015-05-19 15:48:04 +01:00
29d1378d7a Add git to PATH (while in Cmder)
Add bundled git to PATH if we can't find git on PATH.
2015-05-19 15:47:06 +01:00
c15e29ecb3 $PSScriptRoot compatibility
$PSScriptRoot is not available on PS version 2 or below.

So we'll set it ourselves.
2015-05-19 15:44:32 +01:00
c38f6b3a89 Merge branch 'master' into development 2015-05-17 23:45:07 +01:00
99ea376713 v1.2 2015-05-17 23:44:51 +01:00
2051078cc6 Merge pull request #479 from bliker/development
Fix cleanup script.
2015-05-17 23:21:23 +01:00
6c5034164c Fix cleanup script. 2015-05-17 22:42:00 +01:00
0311e129ca Handle quoted paths
I was annoyed at having to use short paths all the time in my aliases. It wasn't until I found a command that actually refused to work with a shortpath (running iisexpress.exe) I was determined to find a solution. 

It appears that the reason the quoted paths weren't working was due to the ::validate alias stuff. The for command would stumble on a quoted path, arguing that /foo was unexpected...

The additions on lines 7-8 wrap the input in quotes and then strip the inner quotes. This variable is used in the for loop (instead of %*) for validating the alias. So long as the alias is valid (contains no spaces) then the existing method of appending the new alias to the aliases file works just fine because it still uses %*.
2015-02-22 23:48:33 -06:00
14 changed files with 143 additions and 119 deletions

2
.gitignore vendored
View File

@ -8,5 +8,7 @@ vendor/*/*
config/.history
Thumbs.db
*.exe
*.dll
build/
Version v*
*.bak

View File

@ -1,29 +1,25 @@
# Cmder
[![Join the chat at https://gitter.im/bliker/cmder](https://badges.gitter.im/Join%20Chat.svg)](https://gitter.im/bliker/cmder?utm_source=badge&utm_medium=badge&utm_campaign=pr-badge&utm_content=badge)
[![Join the chat at https://gitter.im/bliker/cmder](https://badges.gitter.im/Join%20Chat.svg)](https://gitter.im/cmderdev/cmder?utm_source=badge&utm_medium=badge&utm_campaign=pr-badge&utm_content=badge)
Latest release is **[v1.1.4.1](https://github.com/bliker/cmder/releases/tag/v1.1.4.1)**
Cmder is a **software package** created out of pure frustration over absence of usable console emulator on Windows. It is based on [ConEmu](https://code.google.com/p/conemu-maximus5/) with *major* config overhaul. Monokai color scheme, amazing [clink](https://github.com/mridgers/clink) and custom prompt layout.
Cmder is a **software package** created out of pure frustration over absence of usable console emulator on Windows. It is based on [ConEmu](https://conemu.github.io/) with *major* config overhaul, adds a Monokai color scheme, integrates amazing [clink](https://github.com/mridgers/clink) and a custom prompt layout.
![Cmder Screenshot](http://i.imgur.com/g1nNf0I.png)
## Why use it
The main advantage of Cmder is portability. It is designed to be totally self-contained with no external dependencies, that is makes it great for **USB Sticks** or **Dropbox**. So you can carry your console, aliases and binaries (like wget, curl and git) with you anywhere.
The main advantage of Cmder is portability. It is designed to be totally self-contained with no external dependencies, that is makes it great for **USB Sticks** or **cloud storage**. So you can carry your console, aliases and binaries (like wget, curl and git) with you anywhere.
## Installation
1. Download the latest release
1. Extract
1. (optional) Place your own executable files into the `bin` folder to be injected into your PATH.
1. Run cmder
*(There will be a version with installer)*
1. Download the [latest release](https://github.com/cmderdev/cmder/releases/)
2. Extract
3. (optional) Place your own executable files into the `bin` folder to be injected into your PATH.
4. Run Cmder
## 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
@ -38,18 +34,18 @@ In a file explorer window right click in or on a directory to see "Cmder Here" i
### Tab manipulation
* `Ctrl + t` : new tab dialog (maybe you want to open cmd as admin?)
* `Ctrl + w` : close tab
* `Ctrl + d` : close tab (if pressed on empty command)
* `Shift + alt + number` : fast new tab: `1` - CMD, `2` - Powershell `*` - More to come
* `Alt + enter`: Fullscreen
* <kbd>Ctrl</kbd> + <kbd>T</kbd> : New tab dialog (maybe you want to open cmd as admin?)
* <kbd>Ctrl</kbd> + <kbd>W</kbd> : Close tab
* <kbd>Ctrl</kbd> + <kbd>D</kbd> : Close tab (if pressed on empty command)
* <kbd>Shift</kbd> + <kbd>Alt</kbd> + <kbd>#Number</kbd> : Fast new tab: <kbd>1</kbd> - CMD, <kbd>2</kbd> - PowerShell
* <kbd>Alt</kbd> + <kbd>Enter</kbd>: Fullscreen
### Shell
* `Shift + Up` : Traverse up in directory structure (lovely feature!)
* `End, Home, Ctrl` : Traversing text with as usual on Windows
* `Ctrl + r` : History search
* `Shift + mouse` : Select and copy text from buffer
* <kbd>Shift</kbd> + <kbd>Up</kbd> : Traverse up in directory structure (lovely feature!)
* <kbd>End</kbd>, <kbd>Home</kbd>, <kbd>Ctrl</kbd> : Traversing text with as usual on Windows
* <kbd>Ctrl</kbd> + <kbd>R</kbd> : History search
* <kbd>Shift</kbd> + Mouse : Select and copy text from buffer
(Some shortcuts are not yet documented, thought they exist, please add them here)
@ -64,17 +60,14 @@ 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, include the line `@call "%GIT_INSTALL_ROOT%/cmd/start-ssh-agent.cmd"` in `/config/user-startup.bat` (usually just uncomment it).
## Todo
1. Complete PowerShell compatibility.
2. Workaround git.exe overload after msysgit download (Granted this is an upstream issue).
3. Redo Build/Pack scripts or remove them altogether.
4. Git Bash
5. Check for clink and git before injecting them
1. Git Bash
2. Check for clink and git before injecting them (Sort of done)
## License

View File

@ -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

View File

@ -1,8 +1,13 @@
@echo off
set ALIASES=%CMDER_ROOT%\config\aliases
setlocal
:: handle quotes within command definition, e.g. quoted long file names
set _x="%*"
set _x=%_x:"=%
if ["%*"] == [""] echo Use /? for help & echo. & goto :p_show
:: check command usage
if ["%_x%"] == [""] echo Use /? for help & echo. & goto :p_show
if ["%1"] == ["/?"] goto:p_help
if ["%1"] == ["/reload"] goto:p_reload
:: /d flag for delete existing alias
@ -13,20 +18,18 @@ if ["%2"] == [""] (
echo Insufficient parameters. & goto:p_help
)
::validate alias
setlocal
for /f "delims== tokens=1" %%G in ("%*") do set _temp2=%%G
:: validate alias
for /f "delims== tokens=1" %%G in ("%_x%") do set alias=%%G
set _temp=%alias: =%
set _temp=%_temp2: =%
if not ["%_temp%"] == ["%_temp2%"] (
if not ["%_temp%"] == ["%alias%"] (
echo Your alias name can not contain a space
endlocal
goto:eof
)
:: replace already defined alias
findstr /b /v /i "%_temp%=" "%ALIASES%" >> "%ALIASES%.tmp"
findstr /b /v /i "%alias%=" "%ALIASES%" >> "%ALIASES%.tmp"
echo %* >> "%ALIASES%.tmp" && type "%ALIASES%.tmp" > "%ALIASES%" & @del /f /q "%ALIASES%.tmp"
doskey /macrofile="%ALIASES%"
endlocal

View File

@ -72,12 +72,12 @@
<value name="StartType" type="hex" data="02"/>
<value name="CmdLine" type="string" data=""/>
<value name="StartTasksFile" type="string" data=""/>
<value name="StartTasksName" type="string" data="{PowerShell}"/>
<value name="StartTasksName" type="string" data="{cmd}"/>
<value name="StartFarFolders" type="hex" data="00"/>
<value name="StartFarEditors" type="hex" data="00"/>
<value name="StoreTaskbarkTasks" type="hex" data="00"/>
<value name="StoreTaskbarCommands" type="hex" data="00"/>
<value name="CmdLineHistory" type="multi"><line data=";C:\Windows\system32;C:\Windows;C:\Windows\System32\Wbem;C:\Windows\System32\WindowsPowerShell\v1.0\"/></value>
<value name="CmdLineHistory" type="multi"></value>
<value name="SingleInstance" type="hex" data="00"/>
<value name="ShowHelpTooltips" type="hex" data="01"/>
<value name="Multi" type="hex" data="01"/>
@ -497,7 +497,7 @@
<key name="Task2" modified="2015-05-17 22:10:27" build="150513">
<value name="Name" type="string" data="{PowerShell}"/>
<value name="GuiArgs" type="string" data="/icon &quot;%CMDER_ROOT%\cmder.exe&quot;"/>
<value name="Cmd1" type="string" data="PowerShell -NoLogo -NoProfile -NoExit -Command &quot;Invoke-Expression '. ''%ConEmuDir%\..\profile.ps1'''&quot; -new_console:d:&quot;%USERPROFILE%&quot;"/>
<value name="Cmd1" type="string" data="PowerShell -ExecutionPolicy Bypass -NoLogo -NoProfile -NoExit -Command &quot;Invoke-Expression '. ''%ConEmuDir%\..\profile.ps1'''&quot; -new_console:d:&quot;%USERPROFILE%&quot;"/>
<value name="Active" type="dword" data="00000000"/>
<value name="Count" type="dword" data="00000001"/>
<value name="Hotkey" type="dword" data="00000000"/>
@ -507,7 +507,7 @@
<value name="Name" type="string" data="{PowerShell as Admin}"/>
<value name="Hotkey" type="dword" data="00000000"/>
<value name="GuiArgs" type="string" data="/icon &quot;%CMDER_ROOT%\cmder.exe&quot;"/>
<value name="Cmd1" type="string" data="*PowerShell -NoLogo -NoProfile -NoExit -Command &quot;Invoke-Expression '. ''%ConEmuDir%\..\profile.ps1'''&quot; -new_console:d:&quot;%USERPROFILE%&quot;"/>
<value name="Cmd1" type="string" data="*PowerShell -ExecutionPolicy Bypass -NoLogo -NoProfile -NoExit -Command &quot;Invoke-Expression '. ''%ConEmuDir%\..\profile.ps1'''&quot; -new_console:d:&quot;%USERPROFILE%&quot;"/>
<value name="Active" type="dword" data="00000000"/>
<value name="Count" type="dword" data="00000001"/>
<value name="Flags" type="dword" data="00000000"/>
@ -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 &quot;%CMDER_ROOT%\cmder.exe&quot;"/>
<value name="Cmd1" type="string" data="cmd /k &quot;%ConEmuDir%\..\init.bat &amp; %CMDER_ROOT%\vendor\msysgit\bin\bash --login -i&quot; -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 &quot;%ConEmuDir%\..\init.bat &amp; %CMDER_ROOT%\vendor\git-for-windows\bin\bash --login -i&quot; -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>

View File

@ -1,7 +1,7 @@

Microsoft Visual Studio Solution File, Format Version 12.00
# Visual Studio 14
VisualStudioVersion = 14.0.22823.1
VisualStudioVersion = 14.0.23107.0
MinimumVisualStudioVersion = 10.0.40219.1
Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "CmderLauncher", "CmderLauncher.vcxproj", "{4A8485A5-B7DD-4C44-B7F6-3E2765DD0CD3}"
EndProject

View File

@ -14,7 +14,6 @@
<ProjectGuid>{4A8485A5-B7DD-4C44-B7F6-3E2765DD0CD3}</ProjectGuid>
<Keyword>Win32Proj</Keyword>
<RootNamespace>CmderLauncher</RootNamespace>
<TargetPlatformVersion>8.1</TargetPlatformVersion>
</PropertyGroup>
<Import Project="$(VCTargetsPath)\Microsoft.Cpp.Default.props" />
<PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'" Label="Configuration">
@ -73,6 +72,7 @@
<PreprocessorDefinitions>WIN32;NDEBUG;_WINDOWS;%(PreprocessorDefinitions)</PreprocessorDefinitions>
<SDLCheck>true</SDLCheck>
<FavorSizeOrSpeed>Size</FavorSizeOrSpeed>
<RuntimeLibrary>MultiThreaded</RuntimeLibrary>
</ClCompile>
<Link>
<SubSystem>Windows</SubSystem>
@ -85,7 +85,9 @@
</PostBuildEvent>
</ItemDefinitionGroup>
<ItemGroup>
<ResourceCompile Include="src\Resource.rc" />
<ResourceCompile Include="src\Resource.rc">
<FileType>RC</FileType>
</ResourceCompile>
</ItemGroup>
<ItemGroup>
<ClInclude Include="src\resource.h" />

View File

@ -79,6 +79,19 @@ optpair GetOption()
return pair;
}
bool FileExists(const wchar_t * filePath)
{
HANDLE hFile = CreateFile(filePath, GENERIC_READ, FILE_SHARE_READ, NULL, OPEN_EXISTING, 0, NULL);
if (hFile != INVALID_HANDLE_VALUE)
{
CloseHandle(hFile);
return true;
}
return false;
}
void StartCmder(std::wstring path, bool is_single_mode)
{
#if USE_TASKBAR_API
@ -87,6 +100,7 @@ void StartCmder(std::wstring path, bool is_single_mode)
wchar_t exeDir[MAX_PATH] = { 0 };
wchar_t icoPath[MAX_PATH] = { 0 };
wchar_t cfgPath[MAX_PATH] = { 0 };
wchar_t oldCfgPath[MAX_PATH] = { 0 };
wchar_t conEmuPath[MAX_PATH] = { 0 };
wchar_t args[MAX_PATH * 2 + 256] = { 0 };
@ -99,16 +113,29 @@ void StartCmder(std::wstring path, bool is_single_mode)
PathRemoveFileSpec(exeDir);
PathCombine(icoPath, exeDir, L"icons\\cmder.ico");
PathCombine(cfgPath, exeDir, L"config\\ConEmu.xml");
PathCombine(oldCfgPath, exeDir, L"config\\ConEmu.xml");
PathCombine(cfgPath, exeDir, L"vendor\\conemu-maximus5\\ConEmu.xml");
PathCombine(conEmuPath, exeDir, L"vendor\\conemu-maximus5\\ConEmu.exe");
if (FileExists(oldCfgPath) && !FileExists(cfgPath))
{
if (!CopyFile(oldCfgPath, cfgPath, FALSE))
{
MessageBox(NULL,
(GetLastError() == ERROR_ACCESS_DENIED)
? L"Failed to copy ConEmu.xml file to new location! Restart cmder as administrator."
: L"Failed to copy ConEmu.xml file to new location!", MB_TITLE, MB_ICONSTOP);
exit(1);
}
}
if (is_single_mode)
{
swprintf_s(args, L"/single /Icon \"%s\" /Title Cmder /LoadCfgFile \"%s\"", icoPath, cfgPath);
swprintf_s(args, L"/single /Icon \"%s\" /Title Cmder", icoPath);
}
else
{
swprintf_s(args, L"/Icon \"%s\" /Title Cmder /LoadCfgFile \"%s\"", icoPath, cfgPath);
swprintf_s(args, L"/Icon \"%s\" /Title Cmder", icoPath);
}
SetEnvironmentVariable(L"CMDER_ROOT", exeDir);

View File

@ -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
@ -46,6 +46,9 @@ Param(
# Launcher folder location
[string]$launcher = "..\launcher",
# Config folder location
[string]$config = "..\config",
# Include git with the package build
[switch]$Full
)
@ -61,8 +64,19 @@ Ensure-Exists $sourcesPath
Ensure-Executable "7z"
New-Item -Type Directory -Path (Join-Path $saveTo "/tmp/") -ErrorAction SilentlyContinue >$null
# Preserve modified (by user) ConEmu setting file
if ($config -ne "") {
$ConEmuXml = Join-Path $saveTo "conemu-maximus5\ConEmu.xml"
if (Test-Path $ConEmuXml -pathType leaf) {
$ConEmuXmlSave = Join-Path $config "ConEmu.xml"
Write-Verbose "Backup '$ConEmuXml' to '$ConEmuXmlSave'"
Copy-Item $ConEmuXml $ConEmuXmlSave
} else { $ConEmuXml = "" }
} else { $ConEmuXml = "" }
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
}
@ -83,6 +97,12 @@ foreach ($s in $sources) {
"$($s.version)" | Out-File "$($s.name)/.cmderver"
}
# Restore user configuration
if ($ConEmuXml -ne "") {
Write-Verbose "Restore '$ConEmuXmlSave' to '$ConEmuXml'"
Copy-Item $ConEmuXmlSave $ConEmuXml
}
Pop-Location
Push-Location -Path $launcher

View File

@ -42,11 +42,10 @@ 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*"
Cleanup-Git
$version = Invoke-Expression "git describe --abbrev=0 --tags"
(New-Item -ItemType file "$cmderRoot\Version $version") | Out-Null

View File

@ -61,11 +61,6 @@ function Digest-MD5 ($path) {
return Invoke-Expression "md5sum $path"
}
function Cleanup-Git () {
$gitdir = '/vendor/msysgit/libexec/git-core/'
Get-Childitem $gitdir -Exclude git.exe | Where-Object{!($_.PSIsContainer)} | Foreach-Object { Remove-Item $_.FullName }
}
function Register-Cmder(){
[CmdletBinding()]
Param

24
vendor/init.bat vendored
View File

@ -2,6 +2,9 @@
:: Sets some nice defaults
:: Created as part of cmder project
:: !!! THIS FILE IS OVERWRITTEN WHEN CMDER IS UPDATED
:: !!! Use "%CMDER_ROOT%\config\user-startup.cmd" to add your own startup commands
:: Find root dir
@if not defined CMDER_ROOT (
for /f "delims=" %%i in ("%ConEmuDir%\..\..") do @set CMDER_ROOT=%%~fi
@ -21,7 +24,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 +36,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 +63,17 @@
)
)
:: @call "%CMDER_ROOT%/bin/agent.cmd"
@if exist "%CMDER_ROOT%\config\user-startup.cmd" (
@rem create this file and place your own command in there
call "%CMDER_ROOT%\config\user-startup.cmd"
) else (
@echo Creating user startup file: "%CMDER_ROOT%\config\user-startup.cmd"
(
@echo :: use this file to run your own startup commands
@echo :: use @ in front of the command to prevent printing the command
@echo.
@echo :: @call "%GIT_INSTALL_ROOT%/cmd/start-ssh-agent.cmd
@echo :: @set PATH=%%CMDER_ROOT%%\vendor\whatever;%%PATH%%
@echo.
) > "%CMDER_ROOT%\config\user-startup.cmd"
)

17
vendor/profile.ps1 vendored
View File

@ -1,4 +1,9 @@
# Add Cmder modules directory to the autoload path.
# Compatibility with PS major versions <= 2
if(!$PSScriptRoot) {
$PSScriptRoot = Split-Path $Script:MyInvocation.MyCommand.Path
}
# Add Cmder modules directory to the autoload path.
$CmderModulePath = Join-path $PSScriptRoot "psmodules/"
if( -not $env:PSModulePath.Contains($CmderModulePath) ){
@ -6,7 +11,13 @@ if( -not $env:PSModulePath.Contains($CmderModulePath) ){
}
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\git-for-windows\bin"
}
try {
Import-Module -Name "posh-git" -ErrorAction Stop >$null
$gitStatus = $true
} catch {
@ -40,7 +51,6 @@ function global:prompt {
# Load special features come from posh-git
if ($gitStatus) {
Enable-GitColors
Start-SshAgent -Quiet
}
@ -50,3 +60,6 @@ if (Test-Path Env:\CMDER_START) {
} elseif ($Env:CMDER_ROOT -and $Env:CMDER_ROOT.StartsWith($pwd)) {
Set-Location -Path $Env:USERPROFILE
}
# Enhance Path
$env:Path = "$Env:CMDER_ROOT\bin;$env:Path;$Env:CMDER_ROOT"

18
vendor/sources.json vendored
View File

@ -1,22 +1,22 @@
[
{
"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",
"version": "0.4.4",
"url": "https://github.com/mridgers/clink/releases/download/0.4.4/clink_0.4.4.zip"
"version": "0.4.5",
"url": "https://github.com/mridgers/clink/releases/download/0.4.5/clink_0.4.5.zip"
},
{
"name": "conemu-maximus5",
"version": "150513",
"url": "https://github.com/Maximus5/ConEmu/releases/download/v15.05.13/ConEmuPack.150513.7z"
"version": "150913",
"url": "https://github.com/Maximus5/ConEmu/releases/download/v15.09.13/ConEmuPack.150913.7z"
},
{
"name": "clink-completions",
"version": "0.1.0",
"url": "https://github.com/vladimir-kotikov/clink-completions/archive/0.1.0.zip"
"version": "0.2.0",
"url": "https://github.com/vladimir-kotikov/clink-completions/archive/0.2.0.zip"
}
]