浏览代码

fix param and application file profile

张泳健 5 年前
父节点
当前提交
ebb81ac0f5
共有 1 个文件被更改,包括 4 次插入4 次删除
  1. 4 4
      configuration-loader/src/main/java/me/yuxiaoyao/config/loader/ConfigLoader.java

+ 4 - 4
configuration-loader/src/main/java/me/yuxiaoyao/config/loader/ConfigLoader.java 查看文件

@@ -151,9 +151,9 @@ public class ConfigLoader {
151 151
 
152 152
         if (profile == null || profile.length() == 0) {
153 153
             profile = getActiveProfile(defaultProperties);
154
-            if (configListener != null) {
155
-                configListener.activeProfile(profile);
156
-            }
154
+        }
155
+        if (configListener != null) {
156
+            configListener.activeProfile(profile);
157 157
         }
158 158
         LinkedHashMap map = selectConfig(matchProtocol, DEFAULT_APPLICATION + "-" + profile);
159 159
         if (map != null) {
@@ -359,7 +359,7 @@ public class ConfigLoader {
359 359
             for (String arg : args) {
360 360
                 arg = arg.trim();
361 361
                 if (arg.startsWith("--profile=")) {
362
-                    return arg.substring(10);
362
+                    return arg.substring("--profile=".length());
363 363
                 }
364 364
             }
365 365
         }