File tree Expand file tree Collapse file tree 1 file changed +9
-20
lines changed
Expand file tree Collapse file tree 1 file changed +9
-20
lines changed Original file line number Diff line number Diff line change @@ -37,16 +37,15 @@ public function buildCmdLineFromConfig()
3737
3838 public function renderHTML ()
3939 {
40- if ($ this ->isExpired ()) {
41- $ html = $ this ->view ->render ();
42- File::put ($ this ->path , $ html );
43-
44- $ this ->process = new Process ($ this ->buildCmdLineFromConfig ());
45- $ this ->process ->run ();
46- // executes after the command finishes
47- if (! $ this ->process ->isSuccessful ()) {
48- throw new ProcessFailedException ($ this ->process );
49- }
40+ $ html = $ this ->view ->render ();
41+ File::put ($ this ->path , $ html );
42+
43+ $ this ->process = new Process ($ this ->buildCmdLineFromConfig ());
44+ $ this ->process ->run ();
45+ // executes after the command finishes
46+ File::delete ($ this ->path );
47+ if (! $ this ->process ->isSuccessful ()) {
48+ throw new ProcessFailedException ($ this ->process );
5049 }
5150
5251 return new HtmlString (File::get ($ this ->compiledPath ));
@@ -61,14 +60,4 @@ public function detectBinaryPath()
6160 {
6261 return base_path ('node_modules/.bin/mjml ' );
6362 }
64-
65- public function isExpired ()
66- {
67- if (! File::exists ($ this ->compiledPath )) {
68- return true ;
69- }
70-
71- return File::lastModified ($ this ->view ->getPath ()) >=
72- File::lastModified ($ this ->compiledPath );
73- }
7463}
You can’t perform that action at this time.
0 commit comments