From 1ae55c9a16ce275fcca9fd9f13f9d40b564770d2 Mon Sep 17 00:00:00 2001 From: Laura Hausmann Date: Thu, 10 Oct 2019 14:19:05 +0200 Subject: [PATCH] quickfix --- Program.cs | 7 +++---- 1 file changed, 3 insertions(+), 4 deletions(-) diff --git a/Program.cs b/Program.cs index 94d39b2..d0de94d 100644 --- a/Program.cs +++ b/Program.cs @@ -18,7 +18,7 @@ namespace repomgr { if (File.Exists("/tmp/repomgr.lock") && args[1] != "daemon") { - Console.WriteLine("/tmp/repomgr.lock exists, delete if you are sure that this is the only instance"); + Console.WriteLine("/tmp/repomgr.lock exists, delete it if you are sure no other process is running"); Environment.Exit(1); } else if (args[1] != "daemon") @@ -129,8 +129,8 @@ namespace repomgr PrintHelp(); break; } - - File.Delete("/tmp/repomgr.lock"); + if (File.Exists("/tmp/repomgr.lock")) + File.Delete("/tmp/repomgr.lock"); } private static void PrintHelp() @@ -144,7 +144,6 @@ namespace repomgr Console.WriteLine("repomgr update [-f]"); Console.WriteLine("repomgr update-all"); Console.WriteLine("repomgr daemon"); - Environment.Exit(0); } private static IWebHostBuilder CreateWebHostBuilder(string[] args) =>