Skip to content

Commit

Permalink
Fix git alias
Browse files Browse the repository at this point in the history
  • Loading branch information
Matt Keranen committed Jul 11, 2024
1 parent 030a3f5 commit 01664ca
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 7 deletions.
9 changes: 3 additions & 6 deletions commands/inits/data/git_wrapper.ps1
Original file line number Diff line number Diff line change
@@ -1,18 +1,15 @@
Remove-Item alias:\git
Remove-Item function:\git

$SCMPUFF_GIT_CMD = Get-Command git | Select-Object -ExpandProperty Definition

function git {
switch -regex -casesensitive($args[0]) {
"^(commit|blame|log|rebase|merge)$" {
& scmpuff expand -- $SCMPUFF_GIT_CMD $args
& scmpuff exec -- $SCMPUFF_GIT_CMD $args
}
"^(checkout|diff|rm|reset)$" {
& scmpuff expand --relative -- $SCMPUFF_GIT_CMD $args
& scmpuff exec --relative -- $SCMPUFF_GIT_CMD $args
}
"^add$" {
& scmpuff expand -- $SCMPUFF_GIT_CMD $args
& scmpuff exec -- $SCMPUFF_GIT_CMD $args
scmpuff_status
}
default {
Expand Down
5 changes: 4 additions & 1 deletion commands/inits/scripts.go
Original file line number Diff line number Diff line change
Expand Up @@ -17,6 +17,9 @@ var scriptStatusShortcutsPwsh string
//go:embed data/aliases.sh
var scriptAliases string

//go:embed data/aliases.ps1
var scriptAliasesPwsh string

//go:embed data/git_wrapper.sh
var scriptGitWrapper string

Expand Down Expand Up @@ -47,7 +50,7 @@ var fishCollection = scriptCollection{
var pwshCollection = scriptCollection{
statusShortcuts: scriptStatusShortcutsPwsh,
gitWrapper: scriptGitWrapperPwsh,
aliases: scriptAliases,
aliases: scriptAliasesPwsh,
}

func (sc scriptCollection) Output(wrapGit, aliases bool) string {
Expand Down

0 comments on commit 01664ca

Please sign in to comment.