浏览代码

auto commit 3.0.10

lith 3 年之前
父节点
当前提交
8b60211283

+ 1 - 1
Publish/ReleaseFile/docker-image/制作镜像.md

@@ -38,7 +38,7 @@ cd /root/image
 
 #构建镜像并推送到 Docker Hub 
 cd sqler
-docker buildx build . -t serset/sqler:3.0.9 -t serset/sqler --platform=linux/amd64,linux/arm64,linux/arm/v7 --push
+docker buildx build . -t serset/sqler:3.0.10 -t serset/sqler --platform=linux/amd64,linux/arm64,linux/arm/v7 --push
  
 
 

+ 5 - 0
Publish/UpgradeLog.md

@@ -1,2 +1,7 @@
+
+# 3.0.10
+修复启动命令行参数--set不生效的bug
+
+
 # 
  Sql Server可导入导出 Geometry类型

+ 29 - 4
Sqler/Module/Sqler/Logical/SqlerHelp.cs

@@ -134,7 +134,7 @@ namespace App.Module.Sqler.Logical
 
         #region InitEnvironment      
 
-        public static void InitEnvironment(string dataDirectoryPath = null)
+        public static void InitEnvironment(string dataDirectoryPath ,string[]args)
         {
             Logger.Info("[Sqler]init ...");
 
@@ -163,15 +163,40 @@ namespace App.Module.Sqler.Logical
                 throw new Exception("[Sqler]Data Directory(" + dataDirectoryPath + ") does not exist");
             }
             #endregion
-                                           
 
-            #region init member        
-            sqlerConfig = new JsonFile(GetDataFilePath("sqler.json"));        
 
+            // (x.2)init sqlerConfig        
+            sqlerConfig = new JsonFile(GetDataFilePath("sqler.json"));
+
+
+            #region (x.3)--set path=value
+            {
+                for (var i = 1; i < args.Length; i++)
+                {
+                    if (args[i - 1] == "--set")
+                    {
+                        try
+                        {
+                            var str = args[i];
+                            var ei = str?.IndexOf('=') ?? -1;
+                            if (ei < 1) continue;
+
+                            var path = str.Substring(0, ei);
+                            var value = str.Substring(ei + 1);
+
+                            sqlerConfig.root.ValueSetByPath(value, path.Split('.'));
+                        }
+                        catch { }
+                    }
+                }
+            }
             #endregion
 
+
+            //(x.4)
             SqlVersion.SqlVersionHelp.InitEnvironment();
 
+
             Logger.Info("[Sqler]inited!");
         }
         #endregion

+ 4 - 29
Sqler/Program.cs

@@ -23,8 +23,7 @@ namespace App
             //    ,"--format","Values"
             //    ,"--set","SqlRun.Config.type=mysql"
             //    ,"--set","SqlRun.Config.ConnectionString=Data Source=lanxing.cloud;Port=11052;User Id=root;Password=123456;CharSet=utf8;allowPublicKeyRetrieval=true;"
-            //};
-
+            //};       
 
             if (args == null) args = new string[] { };
 
@@ -42,15 +41,13 @@ namespace App
 
 
 
-
-
             //(x.3) 初始化Sqler
             try
             { 
                 Logger.Info("[Sqler] version: "+ System.Diagnostics.FileVersionInfo.GetVersionInfo(System.Reflection.Assembly.GetEntryAssembly().Location).FileVersion );
 
                 string dataDirectoryPath = ConsoleHelp.GetArg(args, "--DataPath");
-                App.Module.Sqler.Logical.SqlerHelp.InitEnvironment(dataDirectoryPath);              
+                App.Module.Sqler.Logical.SqlerHelp.InitEnvironment(dataDirectoryPath,args);              
             }
             catch (System.Exception ex)
             {
@@ -61,31 +58,9 @@ namespace App
 
 
 
-            #region (x.4)--set path=value
-            {
-                for (var i = 1; i < args.Length; i++)
-                {
-                    if (args[i - 1] == "--set")
-                    {
-                        try
-                        {
-                            var str = args[i];
-                            var ei = str?.IndexOf('=') ?? -1;
-                            if (ei < 1) continue;
-
-                            var path = str.Substring(0, ei);
-                            var value = str.Substring(ei + 1);
-
-                            SqlerHelp.sqlerConfig.root.ValueSetByPath(value, path.Split('.'));
-                        }
-                        catch { }
-                    }
-                }
-            }
-            #endregion
 
 
-            //(x.5)
+            //(x.4)
             var runAsCmd = (args.Length >= 1 && false == args[0]?.StartsWith("-"));
             if (runAsCmd)
             {
@@ -107,7 +82,7 @@ namespace App
 
 
 
-            //(x.6)启动http服务
+            //(x.5)启动http服务
             try
             {
                 CreateWebHostBuilder(args).Build().Run();

+ 1 - 1
Sqler/Sqler.csproj

@@ -7,7 +7,7 @@
 
 	<PropertyGroup>
 		<TargetFramework>netcoreapp2.1</TargetFramework>
-		<Version>3.0.9</Version>
+		<Version>3.0.10</Version>
 		<Description>https://github.com/serset/Sqler</Description>
 		<CopyLocalLockFileAssemblies>true</CopyLocalLockFileAssemblies>
 		<PreserveCompilationContext>true</PreserveCompilationContext>