Skip to content

Commit

Permalink
Addressed PR comments
Browse files Browse the repository at this point in the history
  • Loading branch information
gerardog committed Jul 9, 2023
1 parent 76c4431 commit f517145
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 5 deletions.
3 changes: 1 addition & 2 deletions scripts/fuck.bat
Original file line number Diff line number Diff line change
@@ -1,3 +1,2 @@
@set PYTHONIOENCODING=utf-8
@powershell -noprofile -c "cmd /c \"$(thefuck $(doskey /history)[-2])\""
@powershell -noprofile -c "[Console]::ResetColor()"
@powershell -noprofile -c "cmd /c \"$(thefuck %* $(doskey /history)[-2])\"; [Console]::ResetColor();"
8 changes: 5 additions & 3 deletions scripts/fuck.ps1
Original file line number Diff line number Diff line change
@@ -1,13 +1,14 @@
if ((Get-Command "fuck").CommandType -eq "Function") {
fuck;
fuck @args;
[Console]::ResetColor()
exit
}

"First time use of thefuck detected. "

if ((Get-Content $PROFILE -Raw -ErrorAction Ignore) -like "*thefuck*") {
} else {
" - Adding thefuck initialization to user `$PROFILE"
" - Adding thefuck intialization to user `$PROFILE"
$script = "`n`$env:PYTHONIOENCODING='utf-8' `niex `"`$(thefuck --alias)`"";
Write-Output $script | Add-Content $PROFILE
}
Expand All @@ -17,4 +18,5 @@ $env:PYTHONIOENCODING='utf-8'
iex "$($(thefuck --alias).Replace("function fuck", "function global:fuck"))"

" - Invoking fuck()`n"
fuck;
fuck @args;
[Console]::ResetColor()

0 comments on commit f517145

Please sign in to comment.