Skip to content

Commit fdc7297

Browse files
committed
🐛 fix: fixed function write to gitconfig-local
1 parent 2e02351 commit fdc7297

File tree

2 files changed

+10
-10
lines changed

2 files changed

+10
-10
lines changed

Functions.ps1

Lines changed: 8 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -295,14 +295,14 @@ function Download-File {
295295
}
296296

297297
function Write-GitConfigLocal {
298-
$gitUserName = $(Write-Host "Input Git Name: " -ForegroundColor Magenta -NoNewline; Read-Host)
299-
$gitUserMail = $(Write-Host "Input Git Email: " -ForegroundColor Magenta -NoNewline; Read-Host)
300-
$file = "$Env:USERPROFILE\.gitconfig-local"
301-
302-
Write-Output "[user]" | Out-File "$file" -Append
303-
Write-Output " $gitUserName" | Out-File "$file" -Append
304-
Write-Output " $gitUserMail" | Out-File "$file" -Append
305-
Write-PrettyInfo -Message "Git Email and Name set successfully in" -Info "$Env:USERPROFILE\.gitconfig-local"
298+
param ([string]$Path)
299+
$gitUserName = (gum input --prompt="Input Git Name: " --placeholder="Your Name")
300+
$gitUserMail = (gum input --prompt="Input Git Email: " --placeholder="youremail@domain.com")
301+
302+
Write-Output "[user]" >> "$Path"
303+
Write-Output " $gitUserName" >> "$Path"
304+
Write-Output " $gitUserMail" >> "$Path"
305+
Write-PrettyInfo -Message "Git Email and Name set successfully in" -Info "$Path"
306306
}
307307

308308
###################################################################################################

Setup.ps1

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -185,15 +185,15 @@ function Install {
185185
Write-PrettyTitle "GIT SETUP"
186186
if (Test-Path -Path "$env:USERPROFILE\.gitconfig-local") {
187187
if ($(Get-Content -Path "$env:USERPROFILE\.gitconfig-local" -Raw).Contains("[user]") -eq $False) {
188-
Write-GitConfigLocal
188+
Write-GitConfigLocal -Path "$env:USERPROFILE\.gitconfig-local"
189189
}
190190
else {
191191
Write-PrettyInfo -Message "Git Email and Name already set in" -Info "$env:USERPROFILE\.gitconfig-local"
192192
}
193193
}
194194
else {
195195
New-Item -Path "$env:USERPROFILE\.gitconfig-local" -ItemType File | Out-Null
196-
Write-GitConfigLocal
196+
Write-GitConfigLocal -Path "$env:USERPROFILE\.gitconfig-local"
197197
}
198198
Set-Location "$PSScriptRoot"
199199
git submodule update --init --recursive

0 commit comments

Comments
 (0)