Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Faster dot source #1255

Closed
wants to merge 57 commits into from
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
57 commits
Select commit Hold shift + click to select a range
160fbad
Add changelog
MartiUK Mar 20, 2016
6978bb7
Fix missing "\" when building dirpath to psmodules
liftir Apr 9, 2016
b47d04f
Merge pull request #916 from liftir/patch-1
Stanzilla Apr 10, 2016
1dddbcf
Revert "Fix missing "\" when building dirpath to psmodules"
Stanzilla Jun 30, 2016
0379dc1
Merge pull request #1037 from cmderdev/development
Stanzilla Jul 14, 2016
4e90303
:arrow_up: Update ConEmu to 160710 (stable)
Stanzilla Jul 14, 2016
3178343
add hashes.txt to artifacts
Stanzilla Jul 14, 2016
04c7bb7
update changelog
Stanzilla Jul 14, 2016
6a0ea28
add .github_changelog_generator to .gitignore
Stanzilla Jul 14, 2016
f2641e4
:arrow_up: Update Git to v2.9.2
Stanzilla Jul 16, 2016
13c474b
added kill ssh-agent to build.ps1
daxgames Jul 17, 2016
07fb26c
Merge pull request #1042 from daxgames/kill_ssh_agent
Stanzilla Jul 17, 2016
13fd41e
change how we ask hg for the status
Stanzilla Jul 29, 2016
6b10771
Parse the original prompt for cwd and env names
jankatins Aug 9, 2016
19672aa
:arrow_up: Update Git to v2.9.2
Stanzilla Aug 14, 2016
832c199
Merge pull request #1070 from janschulz/unicode_path_prompt
Stanzilla Aug 15, 2016
d095d6a
Fix bash login when ${CMDER_ROOT} has spaces.
orionlee Aug 20, 2016
5354b5f
Further fix bash login when ${CMDER_ROOT} has spaces.
orionlee Aug 20, 2016
355df7a
Merge pull request #1078 from orionlee/fix_bash_login_when_cmder_root…
Stanzilla Aug 21, 2016
a8450eb
Update Readme.md
nverno Aug 25, 2016
a6817fa
Merge pull request #1082 from nverno/patch-1
Stanzilla Aug 25, 2016
490fae7
:arrow_up: Update Git to v2.9.3 (2)
Stanzilla Aug 25, 2016
b7bfe72
:arrow_up: Update Git to v2.10.0
Stanzilla Sep 3, 2016
df7beff
:arrow_up: Update ConEmu to 160828 (stable)
Stanzilla Sep 3, 2016
bb312ad
try --no-lock-index for Git
Stanzilla Sep 17, 2016
d144cd0
:arrow_up: Update ConEmu to 160914 (stable)
Stanzilla Sep 17, 2016
c8adf42
Added closing process in get_git_status (#1)
alexandr-san4ez Sep 27, 2016
af586d5
add use-ConEmu.xml
daxgames Oct 2, 2016
66c6d5b
added ability to have a user-ConEmu.xml file in addition to the compu…
Oct 3, 2016
abd7db9
added backup of ConEmu.xml to ./config folder at cmder launch if it e…
Oct 3, 2016
5feccb3
added backup of ConEmu.xml to ./config/user-ConEmu.xml at cmder launc…
Oct 3, 2016
44e0a04
:arrow_up: Update Git to v2.10.1
Stanzilla Oct 5, 2016
eb73f6f
fix error when path has a space
gucong3000 Oct 11, 2016
7750216
Merge pull request #1126 from gucong3000/patch-1
Stanzilla Oct 11, 2016
60aa0ce
Merge pull request #1127 from cmderdev/development
Stanzilla Oct 11, 2016
a78186f
Fix for slow startup under certain conditions (#1122)
lamarqua Oct 14, 2016
425dc85
Merge pull request #1131 from lamarqua/master
Stanzilla Oct 17, 2016
0b43758
Fixed 3 typos
panzer-planet Oct 30, 2016
2b292f9
Merge pull request #1143 from panzer-planet/patch-1
MartiUK Oct 30, 2016
d64f0e6
Merge branch 'master' of github.com:cmderdev/cmder into user_conemu_cfg
Oct 30, 2016
4c522aa
trigger push
Oct 30, 2016
104033e
Merge pull request #1109 from daxgames/user_conemu_cfg
daxgames Nov 2, 2016
a0e0ada
Bump clink-completions to 0.3.2
Nov 6, 2016
ba99f5b
Fix typo in init.bat
winks Nov 10, 2016
d7f0407
Merge pull request #1157 from winks/winks-patch-1
Stanzilla Nov 10, 2016
14f3361
:arrow_up: Update ConEmu to 161022 (stable)
Stanzilla Oct 23, 2016
70b0666
:arrow_up: Update Git to v2.10.2
Stanzilla Nov 3, 2016
8420272
Merge pull request #1169 from cmderdev/development
Stanzilla Nov 19, 2016
7447e00
:arrow_up: Update Git to v2.11.0
Stanzilla Dec 1, 2016
02f1ff1
update changelog
Stanzilla Dec 1, 2016
4195b5b
Documented some undocumented tab related shorcuts
Dec 6, 2016
9f2c0e4
Merge pull request #1189 from knaos/master
Stanzilla Dec 6, 2016
61849dc
:arrow_up: Update ConEmu to 161206 (stable)
Stanzilla Dec 8, 2016
81d83d4
:arrow_up: Update Git to v2.11.0.3
Stanzilla Jan 16, 2017
3b7a24b
Fix #1245: Allow alias value to contain '=' characters
glucas Feb 9, 2017
2bb5ce0
Merge pull request #1252 from glucas/issue-1245
Stanzilla Feb 10, 2017
9a14b9b
Faster dotSource implementation for parsing autoload tab-complete
Jackbennett Feb 15, 2017
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
705 changes: 705 additions & 0 deletions CHANGELOG.md

Large diffs are not rendered by default.

2 changes: 1 addition & 1 deletion Cmder.bat
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
@echo off
SET CMDER_ROOT=%~dp0

:: Remove trailing '\'
:: Remove Trailing '\'
@if "%CMDER_ROOT:~-1%" == "\" SET CMDER_ROOT=%CMDER_ROOT:~0,-1%

if exist "%~1" (
Expand Down
9 changes: 6 additions & 3 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -38,6 +38,9 @@ In a file explorer window right click in or on a directory to see "Cmder Here" i
* <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>Ctrl</kbd> + <kbd>Tab</kbd> : Switch to next tab
* <kbd>Ctrl</kbd> + <kbd>Shift</kbd> + <kbd>Tab</kbd> : Switch to previous tab
* <kbd>Ctrl</kbd> + <kbd>#Number</kbd> : Switch to tab #Number
* <kbd>Alt</kbd> + <kbd>Enter</kbd>: Fullscreen

### Shell
Expand All @@ -59,7 +62,7 @@ You can open multiple tabs each containing one of the following shells:
|Cmder|cmd.exe|Windows 'cmd.exe' shell enhanced with Git, Git aware prompt, Clink(GNU Readline), and Aliases.|
|Cmder as Admin|cmd.exe|Administrative Windows 'cmd.exe' Cmder shell.|
|PowerShell|powershell.exe|Windows PowerShell enhanced with Git and Git aware prompt .|
|PowerShell as Admin|powershell.exe|Administrative Windows 'powerhell.exe' Cmder shell.|
|PowerShell as Admin|powershell.exe|Administrative Windows 'powershell.exe' Cmder shell.|
|Bash|bash.exe|Unix/Linux like bash shell running on Windows.|
|Bash as Admin|bash.exe|Administrative Unix/Linux like bash shell running on Windows.|
|Mintty|bash.exe|Unix/Linux like bash shell running on Windows. See below for Mintty configuration differences|
Expand Down Expand Up @@ -91,7 +94,7 @@ User specific configuration is possible using the cmder specific shell config fi
|PowerShell|$ENV:CMDER_ROOT\config\user-profile.ps1|
|Bash/Mintty|$CMDER_ROOT/config/user-profile.sh|

Note: Bash and Mintty sessions will also source the '$HOME/.bashrc' file it it exists after it sources '$CMDER_ROOT/config/user-profile.sh'.
Note: Bash and Mintty sessions will also source the '$HOME/.bashrc' file if it exists after it sources '$CMDER_ROOT/config/user-profile.sh'.

### Linux like 'profile.d' support for all supported shell types.
You can write *.cmd|*.bat, *.ps1, and *.sh scripts and just drop them in the %CMDER_ROOT%\config\profile.d folder to add startup config to Cmder.
Expand All @@ -114,7 +117,7 @@ Aliases defined using the `alias.bat` command will automatically be saved in the
#### Bash.exe|Mintty.exe Aliases
Bash shells support simple and complex aliases with optional parameters natively so they work a little different. Typing `alias name=command` will create an alias only for the current running session. To make an alias permanent add it to either your `$CMDER_ROOT/config/user-profile.sh` or your `$HOME/.bashrc`.

If you add bash aliases to `$CMDER_ROOT/config/user-profile.sh` they will portable and follow your Cmder folder if you copy it to another machine. `$HOME/.bashrc` defined aliases are not portable.
If you add bash aliases to `$CMDER_ROOT/config/user-profile.sh` they will be portable and follow your Cmder folder if you copy it to another machine. `$HOME/.bashrc` defined aliases are not portable.

#### PowerShell.exe Aliases
PowerShell has native simple alias support, for example `[new-alias | set-alias] alias command`, so complex aliases with optional parameters are not supported in PowerShell sessions. Type `get-help [new-alias|set-alias] -full` for help on PowerShell aliases.
Expand Down
3 changes: 3 additions & 0 deletions appveyor.yml
Original file line number Diff line number Diff line change
Expand Up @@ -44,6 +44,9 @@ artifacts:
- path: build\cmder_mini.zip
name: cmdermini

- path: build\hashes.txt
name: hashes

#---------------------------------#
# notifications #
#---------------------------------#
Expand Down
2 changes: 1 addition & 1 deletion bin/alias.bat
Original file line number Diff line number Diff line change
Expand Up @@ -64,7 +64,7 @@ if "%aliases%" neq "%CMDER_ROOT%\config\user-aliases.cmd" (
)

:: validate alias
for /f "delims== tokens=1,2 usebackq" %%G in (`echo "%_x%"`) do (
for /f "delims== tokens=1,* usebackq" %%G in (`echo "%_x%"`) do (
set alias_name=%%G
set alias_value=%%H
)
Expand Down
4 changes: 2 additions & 2 deletions config/Readme.md
Original file line number Diff line number Diff line change
Expand Up @@ -5,8 +5,8 @@ directly, it has to be hardlinked.

* `aliases`: aliases in cmd; called form vendor\init.bat; autocreated from
`vendor\aliases.example`.
* `*.lua`: clink completitions and prompt filters; called from vendor\cmder.lua after all
other prompt filter and clink completitons are initialized; add your own.
* `*.lua`: clink completions and prompt filters; called from vendor\cmder.lua after all
other prompt filter and clink completions are initialized; add your own.
* `user_profile.{sh|bat|ps1}`: startup files for bash|cmd|powershell tasks; called from their
respective startup scripts in `vendor\`; autocreated on first start of such a task
* `.history`: the current commandline history; autoupdated on close
Expand Down
47 changes: 34 additions & 13 deletions launcher/src/CmderLauncher.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -103,6 +103,9 @@ 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 backupCfgPath[MAX_PATH] = { 0 };
wchar_t cpuCfgPath[MAX_PATH] = { 0 };
wchar_t userCfgPath[MAX_PATH] = { 0 };
wchar_t oldCfgPath[MAX_PATH] = { 0 };
wchar_t conEmuPath[MAX_PATH] = { 0 };
wchar_t args[MAX_PATH * 2 + 256] = { 0 };
Expand All @@ -117,19 +120,27 @@ void StartCmder(std::wstring path, bool is_single_mode)

PathCombine(icoPath, exeDir, L"icons\\cmder.ico");

// Check for machine-specific config file.
PathCombine(oldCfgPath, exeDir, L"config\\ConEmu-%COMPUTERNAME%.xml");
ExpandEnvironmentStrings(oldCfgPath, oldCfgPath, sizeof(oldCfgPath) / sizeof(oldCfgPath[0]));
if (!PathFileExists(oldCfgPath)) {
// Check for machine-specific then user config source file.
PathCombine(cpuCfgPath, exeDir, L"config\\ConEmu-%COMPUTERNAME%.xml");
ExpandEnvironmentStrings(cpuCfgPath, cpuCfgPath, sizeof(cpuCfgPath) / sizeof(cpuCfgPath[0]));

PathCombine(userCfgPath, exeDir, L"config\\user-ConEmu.xml");

if (PathFileExists(cpuCfgPath)) {
wcsncpy_s(oldCfgPath, cpuCfgPath, sizeof(cpuCfgPath));
wcsncpy_s(backupCfgPath, cpuCfgPath, sizeof(cpuCfgPath));
}
else if (PathFileExists(userCfgPath)) {
wcsncpy_s(oldCfgPath, userCfgPath,sizeof(userCfgPath));
wcsncpy_s(backupCfgPath, userCfgPath, sizeof(userCfgPath));
}
else {
PathCombine(oldCfgPath, exeDir, L"config\\ConEmu.xml");
wcsncpy_s(backupCfgPath, userCfgPath, sizeof(userCfgPath));
}

// Check for machine-specific config file.
PathCombine(cfgPath, exeDir, L"vendor\\conemu-maximus5\\ConEmu-%COMPUTERNAME%.xml");
ExpandEnvironmentStrings(cfgPath, cfgPath, sizeof(cfgPath) / sizeof(cfgPath[0]));
if (!PathFileExists(cfgPath)) {
PathCombine(cfgPath, exeDir, L"vendor\\conemu-maximus5\\ConEmu.xml");
}
// Set path to vendored ConEmu config file
PathCombine(cfgPath, exeDir, L"vendor\\conemu-maximus5\\ConEmu.xml");

SYSTEM_INFO sysInfo;
GetNativeSystemInfo(&sysInfo);
Expand All @@ -151,6 +162,14 @@ void StartCmder(std::wstring path, bool is_single_mode)
exit(1);
}
}
else if (!CopyFile(cfgPath, backupCfgPath, FALSE))
{
MessageBox(NULL,
(GetLastError() == ERROR_ACCESS_DENIED)
? L"Failed to backup ConEmu.xml file to ./config folder!"
: L"Failed to backup ConEmu.xml file to ./config folder!", MB_TITLE, MB_ICONSTOP);
exit(1);
}

if (is_single_mode)
{
Expand All @@ -169,21 +188,23 @@ void StartCmder(std::wstring path, bool is_single_mode)
}
}
// Ensure EnvironmentVariables are propagated.
SendMessageTimeout(HWND_BROADCAST, WM_SETTINGCHANGE, 0, (LPARAM)"Environment", SMTO_ABORTIFHUNG, 5000, NULL);
SendMessageTimeout(HWND_BROADCAST, WM_SETTINGCHANGE, 0, (LPARAM) L"Environment", SMTO_ABORTIFHUNG, 5000, NULL); // For Windows >= 8


STARTUPINFO si = { 0 };
si.cb = sizeof(STARTUPINFO);
#if USE_TASKBAR_API
si.lpTitle = appId;
si.dwFlags = STARTF_TITLEISAPPID;
#endif

PROCESS_INFORMATION pi;
if (!CreateProcess(conEmuPath, args, NULL, NULL, false, 0, NULL, NULL, &si, &pi)) {
MessageBox(NULL, _T("Unable to create the ConEmu Process!"), _T("Error"), MB_OK);
return;
}

LRESULT lr = SendMessageTimeout(HWND_BROADCAST, WM_SETTINGCHANGE, 0, (LPARAM)"Environment", SMTO_ABORTIFHUNG | SMTO_NOTIMEOUTIFNOTHUNG, 5000, NULL);
lr = SendMessageTimeout(HWND_BROADCAST, WM_SETTINGCHANGE, 0, (LPARAM) L"Environment", SMTO_ABORTIFHUNG | SMTO_NOTIMEOUTIFNOTHUNG, 5000, NULL); // For Windows >= 8

}

bool IsUserOnly(std::wstring opt)
Expand Down
12 changes: 12 additions & 0 deletions scripts/build.ps1
Original file line number Diff line number Diff line change
Expand Up @@ -53,6 +53,10 @@ Param(
[switch]$Compile
)

# Get the scripts and cmder root dirs we are building in.
$ScriptRoot = Split-Path -Parent -Path $MyInvocation.MyCommand.Definition
$cmder_root = $ScriptRoot.replace("\scripts","")

# Dot source util functions into this scope
. ".\utils.ps1"
$ErrorActionPreference = "Stop"
Expand All @@ -75,6 +79,14 @@ if ($config -ne "") {
} else { $ConEmuXml = "" }
} else { $ConEmuXml = "" }

# Kill ssh-agent.exe if it is running from the $env:cmder_root we are building
foreach ($ssh_agent in $(get-process ssh-agent -erroraction silentlycontinue)) {
if ([string]$($ssh_agent.path) -match [string]$cmder_root.replace('\','\\')) {
write-verbose $("Stopping " + $ssh_agent.path + "!")
stop-process $ssh_agent.id
}
}

$vend = $pwd
foreach ($s in $sources) {
Write-Verbose "Getting $($s.name) from URL $($s.url)"
Expand Down
1 change: 1 addition & 0 deletions scripts/utils.ps1
Original file line number Diff line number Diff line change
Expand Up @@ -28,6 +28,7 @@ function Delete-Existing ($path) {
}

function Extract-Archive ($source, $target) {
Write-Verbose $("Extracting Archive '$cmder_root\vendor\" + $source.replace('/','\') + " to '$cmder_root\vendor\$target'")
Invoke-Expression "7z x -y -o`"$($target)`" `"$source`" > `$null"
if ($lastexitcode -ne 0) {
Write-Error "Extracting of $source failied"
Expand Down
34 changes: 28 additions & 6 deletions vendor/clink.lua
Original file line number Diff line number Diff line change
Expand Up @@ -18,12 +18,34 @@ dofile(clink_lua_file)
-- which echo) don't get the ugly '{lamb}' shown.
---
function set_prompt_filter()
-- get_cwd() is differently encoded than the clink.prompt.value, so everything other than
-- pure ASCII will get garbled. So try to parse the current directory from the original prompt
-- and only if that doesn't work, use get_cwd() directly.
-- The matching relies on the default prompt which ends in X:\PATH\PATH>
-- (no network path possible here!)
local old_prompt = clink.prompt.value
local cwd = old_prompt:match('.*(.:[^>]*)>')
if cwd == nil then cwd = clink.get_cwd() end

-- environment systems like pythons virtualenv change the PROMPT and usually
-- set some variable. But the variables are differently named and we would never
-- get them all, so try to parse the env name out of the PROMPT.
-- envs are usually put in round or square parentheses and before the old prompt
local env = old_prompt:match('.*%(([^%)]+)%).+:')
-- also check for square brackets
if env == nil then env = old_prompt:match('.*%[([^%]]+)%].+:') end

-- build our own prompt
-- orig: $E[1;32;40m$P$S{git}{hg}$S$_$E[1;30;40m{lamb}$S$E[0m
-- color codes: "\x1b[1;37;40m"
cwd = clink.get_cwd()
prompt = "\x1b[1;32;40m{cwd} {git}{hg} \n\x1b[1;30;40m{lamb} \x1b[0m"
new_value = string.gsub(prompt, "{cwd}", cwd)
clink.prompt.value = string.gsub(new_value, "{lamb}", "λ")
local cmder_prompt = "\x1b[1;32;40m{cwd} {git}{hg} \n\x1b[1;30;40m{lamb} \x1b[0m"
cmder_prompt = string.gsub(cmder_prompt, "{cwd}", cwd)
if env == nil then
lambda = "λ"
else
lambda = "("..env..") λ"
end
clink.prompt.value = string.gsub(cmder_prompt, "{lamb}", lambda)
end

---
Expand Down Expand Up @@ -142,8 +164,8 @@ end
-- @return {bool}
---
function get_hg_status()
for line in io.popen("hg status"):lines() do
return false
for line in io.popen("hg status -0"):lines() do
return false
end
return true
end
Expand Down
14 changes: 7 additions & 7 deletions vendor/cmder.sh
Original file line number Diff line number Diff line change
Expand Up @@ -38,25 +38,25 @@ export PATH
# Drop *.sh or *.zsh files into "${CMDER_ROOT}\config\profile.d"
# to source them at startup.
if [ ! -d "${CMDER_ROOT}/config/profile.d" ] ; then
mkdir -p ${CMDER_ROOT}/config/profile.d
mkdir -p "${CMDER_ROOT}/config/profile.d"
fi

if [ -d "${CMDER_ROOT}/config/profile.d" ] ; then
unset profile_d_scripts
pushd ${CMDER_ROOT}/config/profile.d >/dev/null
profile_d_scripts=$(ls ${CMDER_ROOT}/config/profile.d/*.sh 2>/dev/null)
pushd "${CMDER_ROOT}/config/profile.d" >/dev/null
profile_d_scripts=$(ls *.sh 2>/dev/null)

if [ ! "x${profile_d_scripts}" = "x" ] ; then
for x in ${profile_d_scripts} ; do
# echo Sourcing "${x}"...
. $x
# echo Sourcing "${CMDER_ROOT}/config/profile.d/${x}"...
. "${CMDER_ROOT}/config/profile.d/${x}"
done
fi
popd >/dev/null
fi

if [ -f ${CMDER_ROOT}/config/user-profile.sh ] ; then
. ${CMDER_ROOT}/config/user-profile.sh
if [ -f "${CMDER_ROOT}/config/user-profile.sh" ] ; then
. "${CMDER_ROOT}/config/user-profile.sh"
else
echo Creating user startup file: "${CMDER_ROOT}/config/user-profile.sh"
cat <<-eof >"${CMDER_ROOT}/config/user-profile.sh"
Expand Down
16 changes: 8 additions & 8 deletions vendor/cmder_exinit
Original file line number Diff line number Diff line change
Expand Up @@ -51,29 +51,29 @@ if [ ! "$CMDER_ROOT" = "" ] ; then
# Drop *.sh or *.zsh files into "${CMDER_ROOT}\config\profile.d"
# to source them at startup.
if [ ! -d "${CMDER_ROOT}/config/profile.d" ] ; then
mkdir -p ${CMDER_ROOT}/config/profile.d
mkdir -p "${CMDER_ROOT}/config/profile.d"
fi

if [ -d "${CMDER_ROOT}/config/profile.d" ] ; then
unset profile_d_scripts
pushd ${CMDER_ROOT}/config/profile.d >/dev/null
pushd "${CMDER_ROOT}/config/profile.d" >/dev/null
if [ ! "x${ZSH_VERSION}" = "x" ]; then
profile_d_scripts=$(ls ${CMDER_ROOT}/config/profile.d/*.zsh 2>/dev/null)
profile_d_scripts=$(ls *.zsh 2>/dev/null)
elif [ ! "x${BASH_VERSION}" = "x" ]; then
profile_d_scripts=$(ls ${CMDER_ROOT}/config/profile.d/*.sh 2>/dev/null)
profile_d_scripts=$(ls *.sh 2>/dev/null)
fi

if [ ! "x${profile_d_scripts}" = "x" ] ; then
for x in ${profile_d_scripts} ; do
# echo Sourcing "${x}"...
. $x
# echo Sourcing "${CMDER_ROOT}/config/profile.d/${x}"...
. "${CMDER_ROOT}/config/profile.d/${x}"
done
fi
popd >/dev/null
fi

if [ -f ${CMDER_ROOT}/config/user-profile.sh ] ; then
. ${CMDER_ROOT}/config/user-profile.sh
if [ -f "${CMDER_ROOT}/config/user-profile.sh" ] ; then
. "${CMDER_ROOT}/config/user-profile.sh"
else
echo Creating user startup file: "${CMDER_ROOT}/config/user-profile.sh"
cat <<-eof >"${CMDER_ROOT}/config/user-profile.sh"
Expand Down
4 changes: 2 additions & 2 deletions vendor/init.bat
Original file line number Diff line number Diff line change
Expand Up @@ -121,12 +121,12 @@ if not defined aliases (
:: Make sure we have a self-extracting user-aliases.cmd file
setlocal enabledelayedexpansion
if not exist "%user-aliases%" (
echo Creating intial user-aliases store in "%user-aliases%"...
echo Creating initial user-aliases store in "%user-aliases%"...
copy "%CMDER_ROOT%\vendor\user-aliases.cmd.example" "%user-aliases%"
) else (
type "%user-aliases%" | findstr /i ";= Add aliases below here" >nul
if "!errorlevel!" == "1" (
echo Creating intial user-aliases store in "%user-aliases%"...
echo Creating initial user-aliases store in "%user-aliases%"...
copy "%CMDER_ROOT%\%user-aliases%" "%user-aliases%.old_format"
copy "%CMDER_ROOT%\vendor\user-aliases.cmd.example" "%user-aliases%"
)
Expand Down
13 changes: 8 additions & 5 deletions vendor/profile.ps1
Original file line number Diff line number Diff line change
Expand Up @@ -92,12 +92,15 @@ if (-not (test-path "$ENV:CMDER_ROOT\config\profile.d")) {
mkdir "$ENV:CMDER_ROOT\config\profile.d"
}

pushd $ENV:CMDER_ROOT\config\profile.d
foreach ($x in ls *.ps1) {
# write-host write-host Sourcing $x
. $x
foreach ($file in (Get-ChildItem "$($env:CMDER_ROOT)\config\profile.d" -Filter '*.ps1') ) {
# Grab the contents of files at once and parse that as a script block.
# faster script loading, see: https://becomelotr.wordpress.com/2017/02/13/expensive-dot-sourcing/
. (
[scriptblock]::Create(
[io.file]::ReadAllText($file.fullname)
)
)
}
popd

#
# Prompt Section
Expand Down
12 changes: 6 additions & 6 deletions vendor/sources.json
Original file line number Diff line number Diff line change
@@ -1,8 +1,8 @@
[
{
"name": "git-for-windows",
"version": "v2.10.2.windows.1",
"url": "https://github.com/git-for-windows/git/releases/download/v2.10.2.windows.1/PortableGit-2.10.2-32-bit.7z.exe"
"version": "v2.11.0.windows.3",
"url": "https://github.com/git-for-windows/git/releases/download/v2.11.0.windows.3/PortableGit-2.11.0.3-32-bit.7z.exe"
},
{
"name": "clink",
Expand All @@ -11,12 +11,12 @@
},
{
"name": "conemu-maximus5",
"version": "161022",
"url": "https://github.com/Maximus5/ConEmu/releases/download/v16.10.22/ConEmuPack.161022.7z"
"version": "161206",
"url": "https://github.com/Maximus5/ConEmu/releases/download/v16.12.06/ConEmuPack.161206.7z"
},
{
"name": "clink-completions",
"version": "0.3.1",
"url": "https://github.com/vladimir-kotikov/clink-completions/archive/0.3.1.zip"
"version": "0.3.2",
"url": "https://github.com/vladimir-kotikov/clink-completions/archive/0.3.2.zip"
}
]
2 changes: 1 addition & 1 deletion vendor/user-aliases.cmd.example
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@ gl=git log --oneline --all --graph --decorate $*
ls=ls --show-control-chars -F --color $*
pwd=cd
clear=cls
history=cat %CMDER_ROOT%\config\.history
history=cat "%CMDER_ROOT%\config\.history"
unalias=alias /d $1
vi=vim $*
cmderr=cd /d "%CMDER_ROOT%"