Skip to content
GitLab
Explore
Sign in
Primary navigation
Search or go to…
Project
A
auto-tx
Manage
Activity
Members
Labels
Plan
Issues
Issue boards
Milestones
Code
Merge requests
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Help
Help
Support
GitLab documentation
Compare GitLab plans
Community forum
Contribute to GitLab
Provide feedback
Keyboard shortcuts
?
Snippets
Groups
Projects
Show more breadcrumbs
vamp
auto-tx
Commits
c2445423
Commit
c2445423
authored
7 years ago
by
Niko Ehrenfeuchter
Committed by
Niko Ehrenfeuchter (adm)
7 years ago
Browse files
Options
Downloads
Patches
Plain Diff
Minor logging changes.
Refers to
#13
parent
01ac3f7a
No related branches found
Branches containing commit
No related tags found
Tags containing commit
No related merge requests found
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
AutoTx/Resources/Update-AutoTxService.ps1
+4
-3
4 additions, 3 deletions
AutoTx/Resources/Update-AutoTxService.ps1
with
4 additions
and
3 deletions
AutoTx/Resources/Update-AutoTxService.ps1
+
4
−
3
View file @
c2445423
...
...
@@ -90,7 +90,7 @@ function Update-FileIfNewer([string]$SourcePath, [string]$Destination) {
$SrcFileSuffix
=
[
io.path
]::
GetExtension
(
$SrcFile
)
$DstPath
=
"
$(
$Destination
)
\
$(
$SrcFile
)
"
if
(
-Not
(
Test-Path
"
$DstPath
"
))
{
Write-Host
"File not existing in destination, NOT UPDATING:
$DstPath
"
Log-Info
"File not existing in destination, NOT UPDATING:
$(
$DstPath
)
"
Return
}
...
...
@@ -104,14 +104,15 @@ function Update-FileIfNewer([string]$SourcePath, [string]$Destination) {
$BakTimeStamp
=
Get-Date
-Format
s
|
foreach
{
$_
-replace
":"
,
"."
}
$BakName
=
"
$(
$SrcFileNoSuffix
)
_pre-
$BakTimeStamp$SrcFileSuffix
"
Write-Host
"Creating backup:
$(
$BakName
)
"
Rename-Item
"
$DstPath
"
"
$Destination
\
$BakName
"
Log-Info
"Creating backup of '
$(
$DstPath
)
' to '
$(
$BakName
)
'."
try
{
Copy-Item
-Path
$SourcePath
-Destination
$Destination
-ErrorAction
Stop
Log-Info
"Updated config file '
$(
$DstPath
)
'."
}
catch
{
$ex
=
$_
.
Exception
.
Message
Log-Error
-Message
"Copying
$(
$SourcePath
)
FAILED!
`n
$(
$ex
)
"
Log-Error
"Copying
$(
$SourcePath
)
FAILED!
`n
$(
$ex
)
"
Exit
}
}
...
...
This diff is collapsed.
Click to expand it.
Preview
0%
Loading
Try again
or
attach a new file
.
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Save comment
Cancel
Please
register
or
sign in
to comment