Преглед изворни кода

fix param and application file profile

张泳健 пре 5 година
родитељ
комит
ebb81ac0f5

+ 4 - 4
configuration-loader/src/main/java/me/yuxiaoyao/config/loader/ConfigLoader.java Прегледај датотеку

151
 
151
 
152
         if (profile == null || profile.length() == 0) {
152
         if (profile == null || profile.length() == 0) {
153
             profile = getActiveProfile(defaultProperties);
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
         LinkedHashMap map = selectConfig(matchProtocol, DEFAULT_APPLICATION + "-" + profile);
158
         LinkedHashMap map = selectConfig(matchProtocol, DEFAULT_APPLICATION + "-" + profile);
159
         if (map != null) {
159
         if (map != null) {
359
             for (String arg : args) {
359
             for (String arg : args) {
360
                 arg = arg.trim();
360
                 arg = arg.trim();
361
                 if (arg.startsWith("--profile=")) {
361
                 if (arg.startsWith("--profile=")) {
362
-                    return arg.substring(10);
362
+                    return arg.substring("--profile=".length());
363
                 }
363
                 }
364
             }
364
             }
365
         }
365
         }