mirror of
				https://github.com/cmderdev/cmder.git
				synced 2025-11-04 11:22:13 +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:
		
							
								
								
									
										16
									
								
								vendor/profile.ps1
									
									
									
									
										vendored
									
									
								
							
							
						
						
									
										16
									
								
								vendor/profile.ps1
									
									
									
									
										vendored
									
									
								
							@@ -1,18 +1,10 @@
 | 
			
		||||
# Global modules directory
 | 
			
		||||
$global:PsGetDestinationModulePath = $PSScriptRoot + "\..\vendor\psmodules"
 | 
			
		||||
# Add Cmder modules directory to the autoload path.
 | 
			
		||||
$CmderModulePath = Join-path $PSScriptRoot "psmodules/"
 | 
			
		||||
 | 
			
		||||
# Push to modules location
 | 
			
		||||
Push-Location -Path ($PsGetDestinationModulePath)
 | 
			
		||||
 | 
			
		||||
# Load modules from current directory
 | 
			
		||||
Import-Module .\PsGet\PsGet
 | 
			
		||||
Get-ChildItem -Exclude "PsGet" -Directory -Name | Foreach-Object {
 | 
			
		||||
    Import-Module .\$_\$_
 | 
			
		||||
if( -not $env:PSModulePath.Contains($CmderModulePath) ){
 | 
			
		||||
    $env:PSModulePath = $env:PSModulePath.Insert(0, "$CmderModulePath;")
 | 
			
		||||
}
 | 
			
		||||
 | 
			
		||||
# Come back to PWD
 | 
			
		||||
Pop-Location
 | 
			
		||||
 | 
			
		||||
# Set up a Cmder prompt, adding the git prompt parts inside git repos
 | 
			
		||||
function global:prompt {
 | 
			
		||||
    $realLASTEXITCODE = $LASTEXITCODE
 | 
			
		||||
 
 | 
			
		||||
		Reference in New Issue
	
	Block a user