File tree 3 files changed +26
-17
lines changed
3 files changed +26
-17
lines changed Original file line number Diff line number Diff line change 15
15
16
16
@unlink ($ needsUpdateFile );
17
17
18
-
19
18
chdir (ROOT_DIR );
20
19
21
20
Shell::exec ('git fetch && git reset --hard origin/master ' );
22
21
23
- $ scss = new \Leafo \ScssPhp \Compiler ();
24
-
25
- $ scss ->setImportPaths ([ROOT_DIR .'/web/scss ' ]);
26
-
27
- $ compress = true ;
28
- if ($ compress )
29
- {
30
- $ scss ->setFormatter ('Leafo\ScssPhp\Formatter\Crunched ' );
31
- }
32
- else
33
- {
34
- $ scss ->setFormatter ('Leafo\ScssPhp\Formatter\Expanded ' );
35
- $ scss ->setLineNumberStyle (Leafo \ScssPhp \Compiler::LINE_COMMENTS );
36
- }
37
-
38
- file_put_contents (ROOT_DIR .'/web/css/all.css ' , $ scss ->compile (file_get_contents (ROOT_DIR .'/web/scss/all.scss ' )));
22
+ View::compileCss ();
Original file line number Diff line number Diff line change @@ -89,4 +89,25 @@ public static function getMetaImage()
89
89
{
90
90
return static ::$ metaImg ?: '//lbry.io/img/lbry-dark-1600x528.png ' ;
91
91
}
92
+
93
+ public static function compileCss ()
94
+ {
95
+ $ scssCompiler = new \Leafo \ScssPhp \Compiler ();
96
+
97
+ $ scssCompiler ->setImportPaths ([ROOT_DIR .'/web/scss ' ]);
98
+
99
+ $ compress = true ;
100
+ if ($ compress )
101
+ {
102
+ $ scssCompiler ->setFormatter ('Leafo\ScssPhp\Formatter\Crunched ' );
103
+ }
104
+ else
105
+ {
106
+ $ scssCompiler ->setFormatter ('Leafo\ScssPhp\Formatter\Expanded ' );
107
+ $ scssCompiler ->setLineNumberStyle (Leafo \ScssPhp \Compiler::LINE_COMMENTS );
108
+ }
109
+
110
+ $ css = $ scssCompiler ->compile (file_get_contents (ROOT_DIR .'/web/scss/all.scss ' ));
111
+ file_put_contents (ROOT_DIR .'/web/css/all.css ' , $ css );
112
+ }
92
113
}
Original file line number Diff line number Diff line change 9
9
{
10
10
i18n::register ();
11
11
Session::init ();
12
+ if (!IS_PRODUCTION )
13
+ {
14
+ View::compileCss ();
15
+ }
12
16
Controller::dispatch (strtok ($ _SERVER ['REQUEST_URI ' ], '? ' ));
13
17
}
14
18
catch (Exception $ e )
You can’t perform that action at this time.
0 commit comments