Skip to content

Commit

Permalink
Browse files Browse the repository at this point in the history
update pwd references
  • Loading branch information
Mike Glenn committed Oct 25, 2017
1 parent 708eb8f commit 7cd8b47
Show file tree
Hide file tree
Showing 3 changed files with 11 additions and 29 deletions.
6 changes: 3 additions & 3 deletions Modules.psm1
Expand Up @@ -10,10 +10,10 @@ function Reload-Module($ModuleName) {
remove-module $ModuleName
Write-Verbose "Module $ModuleName Unloaded"

$pwd = Get-ScriptDirectory
$current_directory = Get-ScriptDirectory
$file_path = $ModuleName;
if(Test-Path (join-Path $pwd "$ModuleName.psm1")) {
$file_path = (join-Path $pwd "$ModuleName.psm1")
if(Test-Path (join-Path $current_directory "$ModuleName.psm1")) {
$file_path = (join-Path $current_directory "$ModuleName.psm1")
}

import-module "$file_path" -DisableNameChecking -verbose:$false
Expand Down
2 changes: 1 addition & 1 deletion Setup-Unix.psm1
Expand Up @@ -29,7 +29,7 @@ function grep {
[switch]$l # List filenames
)

$path = $pwd
$path = $(pwd)

# need to add filter for files only, no directories
$files = Get-ChildItem $path -include "$filefilter" -recurse:$r
Expand Down
32 changes: 7 additions & 25 deletions profile.ps1
@@ -1,33 +1,17 @@
# Directory where this file is located
$script:pwd = Split-Path $MyInvocation.MyCommand.Path

# $paths = Join-Path $pwd paths.txt
# if(Test-Path $paths) {
# Get-Content $paths | foreach {
# if(Test-Path $_) {
# $env:Path += ";" + $_
# }
# }
# }

$script:powershell_path = "C:\Windows\System32\WindowsPowerShell\v1.0".ToLower()
if((-Not $env:path.ToLower().contains($script:powershell_path)) -And (Test-Path $script:powershell_path)) {
$env:path = "$env:path;$script:powershell_path"
}

$script:rsync_path = Join-Path $pwd 'rsync'
$script:rsync_path = Join-Path $script:pwd 'rsync'
if(Test-Path $script:rsync_path) {
$env:path = "$env:path;$script:rsync_path"
}


# $devkit = "C:\opscode\chefdk\embedded\"
# if(Test-Path $devkit) {
# $env:RI_DEVKIT = "$devkit"
# $env:path = "$devkit\bin;$devkit\mingw\bin;$env:path"
# }

$env:SSL_CERT_FILE = Join-Path $pwd cacert.pem
$env:SSL_CERT_FILE = Join-Path $script:pwd cacert.pem

# set vagrant default provider
# https://www.vagrantup.com/docs/providers/default.html
Expand All @@ -39,7 +23,7 @@ $env:VAGRANT_DEFAULT_PROVIDER = "hyperv"
#
###########################

Get-ChildItem $pwd *.psm1 | foreach {
Get-ChildItem $script:pwd *.psm1 | foreach {
Import-Module $_.VersionInfo.FileName -DisableNameChecking -verbose:$false
}

Expand Down Expand Up @@ -79,13 +63,13 @@ function prompt {
Write-Host $branch -nonewline -foregroundcolor Cyan
Write-Host ']' -nonewline -foregroundcolor Yellow

$host.UI.RawUi.WindowTitle = "Git:$userLocation - $pwd"
$host.UI.RawUi.WindowTitle = "Git:$userLocation - $script:pwd"
}
elseif ($userLocation -eq $pwd) {
$host.UI.RawUi.WindowTitle = "$pwd"
elseif ($userLocation -eq $script:pwd) {
$host.UI.RawUi.WindowTitle = "$script:pwd"
}
else {
$host.UI.RawUi.WindowTitle = "$userLocation - $pwd"
$host.UI.RawUi.WindowTitle = "$userLocation - $script:pwd"
}

$LASTEXITCODE = $realLASTEXITCODE
Expand Down Expand Up @@ -115,5 +99,3 @@ function TabExpansion($line, $lastWord) {

# https://github.com/samneirinck/posh-docker
Import-Module posh-docker

#Check-RemoteRepository $pwd -verbose

0 comments on commit 7cd8b47

Please sign in to comment.