@@ -17,17 +17,27 @@ Future<void> main(List<String> args) async {
17
17
18
18
final reportDir = Directory (args[2 ]);
19
19
await reportDir.create (recursive: true );
20
- await _CompareTool (beforeFiles, afterFiles, reportDir)._compare ();
20
+ await _CompareTool (
21
+ args[0 ],
22
+ beforeFiles,
23
+ args[1 ],
24
+ afterFiles,
25
+ reportDir,
26
+ )._compare ();
21
27
}
22
28
23
29
class _CompareTool {
30
+ final String _beforeDir;
31
+ final String _afterDir;
24
32
final Directory _reportDir;
25
33
final Map <String , File > _beforeFiles;
26
34
final Map <String , File > _afterFiles;
27
35
final _report = StringBuffer ();
28
36
29
37
_CompareTool (
38
+ this ._beforeDir,
30
39
this ._beforeFiles,
40
+ this ._afterDir,
31
41
this ._afterFiles,
32
42
this ._reportDir,
33
43
);
@@ -77,10 +87,19 @@ class _CompareTool {
77
87
p.join (_reportDir.path, relativeDir, '$basename -diff.png' );
78
88
await File (diffPath).parent.create (recursive: true );
79
89
80
- final pr = await Process .run ('compare' , [
81
- before.path,
82
- after.path,
83
- diffPath,
90
+ final pr = await Process .run ('docker' , [
91
+ 'run' ,
92
+ '--rm' ,
93
+ '-v' ,
94
+ '$_beforeDir :/root/before' ,
95
+ '-v' ,
96
+ '$_afterDir :/root/after' ,
97
+ '-v' ,
98
+ '${_reportDir .path }:/root/diff' ,
99
+ 'odiff' ,
100
+ p.join ('/root/before' , relativeDir, '$basename .png' ),
101
+ p.join ('/root/after' , relativeDir, '$basename .png' ),
102
+ p.join ('/root/diff' , relativeDir, '$basename -diff.png' ),
84
103
]);
85
104
if (pr.exitCode == 0 ) continue ;
86
105
0 commit comments