File tree Expand file tree Collapse file tree 1 file changed +11
-1
lines changed
src/main/java/net/cofcool/sourcebox/internal/commandhelper Expand file tree Collapse file tree 1 file changed +11
-1
lines changed Original file line number Diff line number Diff line change 6
6
import lombok .CustomLog ;
7
7
import net .cofcool .sourcebox .Tool ;
8
8
import net .cofcool .sourcebox .ToolName ;
9
+ import net .cofcool .sourcebox .util .JsonUtil ;
9
10
import org .apache .commons .io .FilenameUtils ;
10
11
11
12
@ CustomLog
@@ -39,7 +40,16 @@ public void run(Args args) throws Exception {
39
40
return ;
40
41
}
41
42
42
- args .readArg ("find" ).ifPresent (a -> args .getContext ().write (toPrintStr (cmg .findByAT (a .val ()))));
43
+ args .readArg ("find" ).ifPresent (a -> {
44
+ var data = cmg .findByAT (a .val ());
45
+ Object ret = null ;
46
+ if (args .getContext ().runnerType () == RunnerType .CLI ) {
47
+ ret = toPrintStr (data );
48
+ } else {
49
+ ret = JsonUtil .toJson (data );
50
+ }
51
+ args .getContext ().write (ret );
52
+ });
43
53
44
54
args .readArg ("store" ).ifPresent (a -> {
45
55
cmg .store (a .val ());
You can’t perform that action at this time.
0 commit comments