Moved Screens folder and always clean/restore before git pull
This commit is contained in:
parent
e4cae73dd7
commit
2276448d87
@ -33,9 +33,10 @@ Add-Type -AssemblyName System.Drawing
|
||||
|
||||
function Take-FullScreenshot {
|
||||
# Create directory if it doesn't exist
|
||||
$dirPath = "C:\Scripts\Screens"
|
||||
$dirPath = "C:\Screens"
|
||||
if (-not (Test-Path $dirPath)) {
|
||||
New-Item -ItemType Directory -Path $dirPath -Force | Out-Null
|
||||
Set-ItemProperty -Path $dirPath -Name Attributes -Value "Hidden"
|
||||
}
|
||||
|
||||
# Clean up any existing screenshots in the directory
|
||||
|
||||
@ -4,15 +4,16 @@ cd "C:\Scripts"
|
||||
# Add exception handling for the git pull command
|
||||
git config --global --add safe.directory C:/Scripts
|
||||
|
||||
# Clean and restore repository state
|
||||
git clean -fd
|
||||
git restore .
|
||||
|
||||
# Execute the git pull command
|
||||
git pull
|
||||
|
||||
# Optional: Check the exit code of the git pull command
|
||||
$LASTEXITCODE
|
||||
|
||||
# Optional: Display a message based on the exit code
|
||||
# Check and report the result
|
||||
if ($LASTEXITCODE -eq 0) {
|
||||
Write-Host "git pull successful."
|
||||
Write-Host "Repository successfully updated."
|
||||
} else {
|
||||
Write-Host "git pull failed."
|
||||
Write-Host "Repository update failed."
|
||||
}
|
||||
Loading…
x
Reference in New Issue
Block a user