synced with upstream/development

This commit is contained in:
Dax T. Games 2016-03-20 08:30:20 -05:00
commit b86f3fbaff
5 changed files with 46 additions and 36 deletions

View File

@ -156,6 +156,12 @@ Uncomment and edit the below line in the script to use Cmder config even when la
1. Check for clink and git before injecting them (Sort of done) 1. Check for clink and git before injecting them (Sort of done)
## Current development branch
You can download builds of the current development branch by going to Appveyor via the following link:
[![AppVeyor](https://ci.appveyor.com/api/projects/status/github/cmderdev/cmder?svg=True)](https://ci.appveyor.com/project/MartiUK/cmder/branch/development/artifacts)
## License ## License
All software included is bundled with own license All software included is bundled with own license

View File

@ -3,7 +3,6 @@
#include <Shlwapi.h> #include <Shlwapi.h>
#include "resource.h" #include "resource.h"
#include <vector> #include <vector>
#include <Shlobj.h>
#pragma comment(lib, "Shlwapi.lib") #pragma comment(lib, "Shlwapi.lib")
@ -156,16 +155,7 @@ void StartCmder(std::wstring path, bool is_single_mode)
} }
SetEnvironmentVariable(L"CMDER_ROOT", exeDir); SetEnvironmentVariable(L"CMDER_ROOT", exeDir);
if (streqi(path.c_str(), L"")) if (!streqi(path.c_str(), L""))
{
wchar_t* homeProfile = 0;
SHGetKnownFolderPath(FOLDERID_Profile, 0, NULL, &homeProfile);
if (!SetEnvironmentVariable(L"CMDER_START", homeProfile)) {
MessageBox(NULL, _T("Error trying to set CMDER_START to given path!"), _T("Error"), MB_OK);
}
CoTaskMemFree(static_cast<void*>(homeProfile));
}
else
{ {
if (!SetEnvironmentVariable(L"CMDER_START", path.c_str())) { if (!SetEnvironmentVariable(L"CMDER_START", path.c_str())) {
MessageBox(NULL, _T("Error trying to set CMDER_START to given path!"), _T("Error"), MB_OK); MessageBox(NULL, _T("Error trying to set CMDER_START to given path!"), _T("Error"), MB_OK);

56
vendor/init.bat vendored
View File

@ -61,21 +61,43 @@ if defined GIT_INSTALL_ROOT (
:: Enhance Path :: Enhance Path
set "PATH=%CMDER_ROOT%\bin;%PATH%;%CMDER_ROOT%\" set "PATH=%CMDER_ROOT%\bin;%PATH%;%CMDER_ROOT%\"
:: make sure we have an example file :: Drop *.bat and *.cmd files into "%CMDER_ROOT%\config\profile.d"
set aliases=%CMDER_ROOT%\config\user-aliases.cmd :: to run them at startup.
if not exist "%aliases%" ( if not exist "%CMDER_ROOT%\config\profile.d" (
echo Creating intial aliases in "%aliases%"... mkdir "%CMDER_ROOT%\config\profile.d"
copy "%CMDER_ROOT%\vendor\user-aliases.cmd.example" "%aliases%"
) )
:: Update old 'aliases' to new self executing 'user-aliases.cmd' pushd "%CMDER_ROOT%\config\profile.d"
if exist "%CMDER_ROOT%\config\aliases" ( for /f "usebackq" %%x in ( `dir /b *.bat *.cmd 2^>nul` ) do (
echo Updating old "%CMDER_ROOT%\config\aliases" to new format... REM echo Calling %CMDER_ROOT%\config\profile.d\%%x...
type "%CMDER_ROOT%\config\aliases" >> "%aliases%" && del "%CMDER_ROOT%\config\aliases" call "%CMDER_ROOT%\config\profile.d\%%x"
) )
popd
:: Allows user to override default aliases store using profile.d
:: scripts run above. Note: If overriding default aliases file
:: in profile.d the aliases must also be loaded in profile.d.
if not defined aliases (
set aliases=%CMDER_ROOT%\config\user-aliases.cmd
)
:: Using default cmder user-aliases.cmd store.
if "%aliases%" == "%CMDER_ROOT%\config\user-aliases.cmd" (
:: make sure we have an example file
if not exist "%aliases%" (
echo Creating intial aliases in "%aliases%"...
copy "%CMDER_ROOT%\vendor\user-aliases.cmd.example" "%aliases%"
)
:: Add aliases to the environment. :: Update old 'aliases' to new self executing 'user-aliases.cmd'
call "%aliases%" if exist "%CMDER_ROOT%\config\aliases" (
echo Updating old "%CMDER_ROOT%\config\aliases" to new format...
type "%CMDER_ROOT%\config\aliases" >> "%aliases%" && del "%CMDER_ROOT%\config\aliases"
)
:: Add aliases to the environment
call "%aliases%"
)
:: See vendor\git-for-windows\README.portable for why we do this :: See vendor\git-for-windows\README.portable for why we do this
:: Basically we need to execute this post-install.bat because we are :: Basically we need to execute this post-install.bat because we are
@ -96,18 +118,6 @@ if defined CMDER_START (
cd /d "%CMDER_START%" cd /d "%CMDER_START%"
) )
:: Drop *.bat and *.cmd files into "%CMDER_ROOT%\config\profile.d"
:: to run them at startup.
if not exist "%CMDER_ROOT%\config\profile.d" (
mkdir "%CMDER_ROOT%\config\profile.d"
)
pushd "%CMDER_ROOT%\config\profile.d"
for /f "usebackq" %%x in ( `dir /b *.bat *.cmd 2^>nul` ) do (
REM echo Calling %CMDER_ROOT%\config\profile.d\%%x...
call "%CMDER_ROOT%\config\profile.d\%%x"
)
popd
if exist "%CMDER_ROOT%\config\user-profile.cmd" ( if exist "%CMDER_ROOT%\config\user-profile.cmd" (
rem create this file and place your own command in there rem create this file and place your own command in there

4
vendor/profile.ps1 vendored
View File

@ -88,6 +88,10 @@ if ( $ENV:CMDER_START ) {
Set-Location -Path "$ENV:CMDER_START" Set-Location -Path "$ENV:CMDER_START"
} }
if (Get-Module PSReadline -ErrorAction "SilentlyContinue") {
Set-PSReadlineOption -ExtraPromptLineCount 1
}
# Enhance Path # Enhance Path
$env:Path = "$Env:CMDER_ROOT\bin;$env:Path;$Env:CMDER_ROOT" $env:Path = "$Env:CMDER_ROOT\bin;$env:Path;$Env:CMDER_ROOT"

4
vendor/sources.json vendored
View File

@ -1,8 +1,8 @@
[ [
{ {
"name": "git-for-windows", "name": "git-for-windows",
"version": "v2.7.2.windows.1", "version": "v2.7.4.windows.1",
"url": "https://github.com/git-for-windows/git/releases/download/v2.7.2.windows.1/PortableGit-2.7.2-32-bit.7z.exe" "url": "https://github.com/git-for-windows/git/releases/download/v2.7.4.windows.1/PortableGit-2.7.4-32-bit.7z.exe"
}, },
{ {
"name": "clink", "name": "clink",