Skip to content

Commit 95a4371

Browse files
committed
Merge branch 'hotfix-1.0.1'
2 parents f2ac07c + 78cafce commit 95a4371

File tree

4 files changed

+15
-10
lines changed

4 files changed

+15
-10
lines changed

src/ServicePulse.Host/Commands/AbstractCommand.cs

Lines changed: 0 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -13,11 +13,6 @@ public static void UpdateConfig(string directoryPath, string serviceControlUrl)
1313
var appJsPath = Path.Combine(directoryPath, "config.js");
1414
var appJsCode = File.ReadAllText(appJsPath);
1515

16-
if (File.Exists(appJsPath))
17-
{
18-
File.Delete(appJsPath);
19-
}
20-
2116
File.WriteAllText(appJsPath,
2217
Regex.Replace(appJsCode, @"(service_control_url: ')([\w:/]*)(')", "$1" + serviceControlUrl + "$3"));
2318
}

src/ServicePulse.Host/Commands/ExtractCommand.cs

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -34,6 +34,11 @@ static void ExtractResources(string directoryPath)
3434

3535
Directory.CreateDirectory(Path.GetDirectoryName(destinationPath));
3636

37+
if (File.Exists(destinationPath))
38+
{
39+
File.Delete(destinationPath);
40+
}
41+
3742
using (Stream file = File.OpenWrite(destinationPath))
3843
{
3944
resourceStream.CopyTo(file);

src/ServicePulse.Host/Commands/UpdateConfigCommand.cs

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -29,6 +29,11 @@ static void ExtractConfig(string directoryPath)
2929

3030
Directory.CreateDirectory(Path.GetDirectoryName(destinationPath));
3131

32+
if (File.Exists(destinationPath))
33+
{
34+
File.Delete(destinationPath);
35+
}
36+
3237
using (Stream file = File.OpenWrite(destinationPath))
3338
{
3439
resourceStream.CopyTo(file);

src/ServicePulse.Host/Commands/UpdateVersionCommand.cs

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -23,6 +23,11 @@ static void ExtractApp(string directoryPath)
2323

2424
Directory.CreateDirectory(Path.GetDirectoryName(destinationPath));
2525

26+
if (File.Exists(destinationPath))
27+
{
28+
File.Delete(destinationPath);
29+
}
30+
2631
using (Stream file = File.OpenWrite(destinationPath))
2732
{
2833
resourceStream.CopyTo(file);
@@ -36,11 +41,6 @@ static void UpdateVersion(string directoryPath)
3641
var appJsPath = Path.Combine(directoryPath, "js/app.js");
3742
var appJsCode = File.ReadAllText(appJsPath);
3843

39-
if (File.Exists(appJsPath))
40-
{
41-
File.Delete(appJsPath);
42-
}
43-
4444
var updatedContent = Regex.Replace(appJsCode, @"(constant\('version', ')([\w:/.-]*)(')", "${1}" + GetFileVersion() + "$3");
4545

4646
File.WriteAllText(appJsPath, updatedContent);

0 commit comments

Comments
 (0)