diff --git a/foo.txt b/foo.txt new file mode 100644 index 0000000..8c97921 --- /dev/null +++ b/foo.txt @@ -0,0 +1 @@ +asasd \ No newline at end of file diff --git a/posh-gitdir.Format.ps1xml b/posh-gitdir.Format.ps1xml new file mode 100644 index 0000000..82e5bb7 --- /dev/null +++ b/posh-gitdir.Format.ps1xml @@ -0,0 +1,60 @@ + + + + + Dir-Git + + Dir-Git + + + + + + 5 + left + + + + 4 + left + + + + 20 + right + + + + 10 + right + + + + + + + + + Mode + + + Git + + + + [String]::Format("{0,10} {1,8}", $_.LastWriteTime.ToString("d"), $_.LastWriteTime.ToString("t")) + + + + Length + + + Name + + + + + + + + diff --git a/posh-gitdir.Types.ps1xml b/posh-gitdir.Types.ps1xml new file mode 100644 index 0000000..a4e2575 --- /dev/null +++ b/posh-gitdir.Types.ps1xml @@ -0,0 +1,38 @@ + + + + System.IO.FileInfo + + + Git + + $retVal = "" + if ($GitStatus.Index.Added -contains $this.Name) { $retVal += "+" } ` + elseif ($GitStatus.Index.Modified -contains $this.Name) { $retVal += "~" } ` + elseif ($GitStatus.Index.Deleted -contains $this.Name) { $retVal += "-" } ` + elseif ($GitStatus.Index.Unmerged -contains $this.Name) { $retVal += "!" } ` + else { $retVal += " " } + + if ($GitStatus.Working.Added -contains $this.Name) { $retVal += "+" } ` + elseif ($GitStatus.Working.Modified -contains $this.Name) { $retVal += "~" } ` + elseif ($GitStatus.Working.Deleted -contains $this.Name) { $retVal += "-" } ` + elseif ($GitStatus.Working.Unmerged -contains $this.Name) { $retVal += "!" } ` + else { $retVal += " " } + + $retVal + + + + + + System.IO.DirectoryInfo + + + Git + + "" + + + + + \ No newline at end of file diff --git a/posh-gitdir.psd1 b/posh-gitdir.psd1 new file mode 100644 index 0000000..29a2714 --- /dev/null +++ b/posh-gitdir.psd1 @@ -0,0 +1,11 @@ +@{ + ModuleVersion="1.0.0.0" + Author="Scott Hanselman" + Description="Posh-GitDir" + CompanyName="Hanselman and Friends" + RequiredModules="Posh-Git" + ScriptsToProcess="prompt.ps1" + TypesToProcess="posh-gitdir.Types.ps1xml" + FormatsToProcess="posh-gitdir.Format.ps1xml" + ModuleToProcess="posh-gitdir.psm1" +} \ No newline at end of file diff --git a/posh-gitdir.psm1 b/posh-gitdir.psm1 new file mode 100644 index 0000000..51723ed --- /dev/null +++ b/posh-gitdir.psm1 @@ -0,0 +1,16 @@ +. ([ScriptBlock]::Create(" +function Get-ChildItem { + $([Management.Automation.ProxyCommand]::GetCmdletBindingAttribute((Get-Command Get-ChildItem -CommandType Cmdlet))) + param( + $([Management.Automation.ProxyCommand]::GetParamBlock((Get-Command Get-ChildItem -CommandType Cmdlet))) + ) + + process { + Microsoft.PowerShell.Management\Get-ChildItem @psBoundParameters | + ForEach-Object { + `$null = `$_.pstypenames.Insert(0, 'Dir-Git') + `$_ + } + } +} +")) diff --git a/prompt.ps1 b/prompt.ps1 new file mode 100644 index 0000000..a05764b --- /dev/null +++ b/prompt.ps1 @@ -0,0 +1,26 @@ + +$defaultPromptHash = "HEYStcKFSSj9jrfqnb9f+A==" + +$md5 = [Security.Cryptography.MD5]::Create() +$thePrompt = [Text.Encoding]::Unicode.GetBytes((Get-Command prompt | Select-Object -ExpandProperty Definition)) +$thePromptHash = [Convert]::ToBase64String($md5.ComputeHash($thePrompt)) + +if ($thePromptHash -eq $defaultPromptHash) #using the default prompt? +{ + #recommend our own + function prompt(){ + # Reset color, which can be messed up by Enable-GitColors + $Host.UI.RawUI.ForegroundColor = $GitPromptSettings.DefaultForegroundColor + + Write-Host($pwd) -nonewline -foregroundcolor white + + Write-VcsStatus + + Write-Host "" + return "$ " + } +} +else { + Write-Debug "Make sure your prompt includes a called to Write-VcsStatus!" +} + diff --git a/readme b/readme index 6990215..4279de5 100644 --- a/readme +++ b/readme @@ -1,2 +1,4 @@ -Hey, it's a readme \ No newline at end of file +Hey, it's a readme. + +poo. \ No newline at end of file