File tree 1 file changed +20
-13
lines changed 1 file changed +20
-13
lines changed Original file line number Diff line number Diff line change 1
1
/**
2
- * Created by henrik on 29.02.16.
2
+ * Created by henrikrudstrom on 29.02.16.
3
3
*/
4
- var exec = require ( "child_process" ) . execFileSync
5
- var glob = require ( "glob" )
4
+ var fs = require ( 'fs' ) ;
5
+ var exec = require ( "child_process" ) . execFileSync ;
6
+ var glob = require ( "glob" ) ;
6
7
7
- var devPath = __dirname . split ( "/" ) . pop ( )
8
+ var devPath = __dirname . split ( "/" ) . pop ( ) ;
8
9
9
10
var paths = [
10
11
"tests/Render/Simple/*.qml"
11
- ]
12
+ ] ;
12
13
13
- paths . forEach ( function ( path ) {
14
- glob ( path , function ( er , files ) {
15
- files . forEach ( render )
16
- } )
17
- } )
14
+ paths . forEach ( function ( path ) {
15
+ glob ( path , function ( er , files ) {
16
+ files . forEach ( render ) ;
17
+ } ) ;
18
+ } ) ;
19
+
20
+ function render ( path ) {
21
+ console . log ( path ) ;
22
+ var png = path . replace ( ".qml" , ".png" ) ;
23
+ try {
24
+ fs . accessSync ( png , fs . F_OK ) ;
25
+ } catch ( e ) {
26
+ exec ( devPath + "/bin/shorty" , [ devPath + "/simple_screenshot.qml" , path ] ) ;
27
+ }
18
28
19
- function render ( path ) {
20
- console . log ( path )
21
- exec ( devPath + "/bin/shorty" , [ devPath + "/simple_screenshot.qml" , path ] )
22
29
}
You can’t perform that action at this time.
0 commit comments