Skip to content
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.

Commit c392674

Browse files
committedMar 5, 2016
only render files that need screenshot
1 parent 122d09e commit c392674

File tree

1 file changed

+20
-13
lines changed

1 file changed

+20
-13
lines changed
 

‎render.js

Lines changed: 20 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -1,22 +1,29 @@
11
/**
2-
* Created by henrik on 29.02.16.
2+
* Created by henrikrudstrom on 29.02.16.
33
*/
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");
67

7-
var devPath = __dirname.split("/").pop()
8+
var devPath = __dirname.split("/").pop();
89

910
var paths = [
1011
"tests/Render/Simple/*.qml"
11-
]
12+
];
1213

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+
}
1828

19-
function render(path){
20-
console.log(path)
21-
exec(devPath + "/bin/shorty", [devPath + "/simple_screenshot.qml", path])
2229
}

0 commit comments

Comments
 (0)
Please sign in to comment.