mirror of
https://github.com/cmderdev/cmder.git
synced 2024-11-10 17:59:11 +08:00
Merge pull request #431 from Jackbennett/ps-profile-modulePath
Leverage the Module Autoload path and save doing it ourselves.
This commit is contained in:
commit
6c074693a4
16
vendor/profile.ps1
vendored
16
vendor/profile.ps1
vendored
@ -1,18 +1,10 @@
|
|||||||
# Global modules directory
|
# Add Cmder modules directory to the autoload path.
|
||||||
$global:PsGetDestinationModulePath = $PSScriptRoot + "\..\vendor\psmodules"
|
$CmderModulePath = Join-path $PSScriptRoot "psmodules/"
|
||||||
|
|
||||||
# Push to modules location
|
if( -not $env:PSModulePath.Contains($CmderModulePath) ){
|
||||||
Push-Location -Path ($PsGetDestinationModulePath)
|
$env:PSModulePath = $env:PSModulePath.Insert(0, "$CmderModulePath;")
|
||||||
|
|
||||||
# Load modules from current directory
|
|
||||||
Import-Module .\PsGet\PsGet
|
|
||||||
Get-ChildItem -Exclude "PsGet" -Directory -Name | Foreach-Object {
|
|
||||||
Import-Module .\$_\$_
|
|
||||||
}
|
}
|
||||||
|
|
||||||
# Come back to PWD
|
|
||||||
Pop-Location
|
|
||||||
|
|
||||||
# Set up a Cmder prompt, adding the git prompt parts inside git repos
|
# Set up a Cmder prompt, adding the git prompt parts inside git repos
|
||||||
function global:prompt {
|
function global:prompt {
|
||||||
$realLASTEXITCODE = $LASTEXITCODE
|
$realLASTEXITCODE = $LASTEXITCODE
|
||||||
|
Loading…
Reference in New Issue
Block a user