Skip to content

Commit f127b31

Browse files
committed
Added --version, bumped version to 1.3
1 parent a33adf1 commit f127b31

20 files changed

+74
-95
lines changed

app/app.ts

Lines changed: 17 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -8,6 +8,7 @@ const console_stamp = require('console-stamp');
88

99
const options_definitions = [
1010
{name: 'help', alias: 'h', type: Boolean},
11+
{name: 'version', alias: 'v', type: Boolean},
1112
{name: 'project-id', type: Number},
1213
{name: 'user', type: String},
1314
{name: 'api-key', type: String},
@@ -21,15 +22,22 @@ const options_definitions = [
2122
{name: 'overwrite'},
2223
];
2324

24-
console_stamp(console, 'HH:MM:ss.l');
25-
2625
class SessionsTool {
2726
async run() {
2827
const options = new Options(options_definitions);
2928
if (options.containsHelp()) {
3029
this.help();
30+
return;
31+
}
32+
33+
if (options.containsVersion()) {
34+
this.version();
35+
return;
3136
}
3237

38+
console_stamp(console, 'HH:MM:ss.l');
39+
40+
console.log("Fetching new sessions...");
3341
const predicates = makeProjectPredicates(options);
3442
const sessions = await fetchSessions(predicates, options);
3543
if (sessions.length === 0) {
@@ -38,10 +46,12 @@ class SessionsTool {
3846
}
3947

4048
if (options.contains('logs')) {
49+
console.log("Fetching logs");
4150
await logs(sessions, options);
4251
}
4352

4453
if (options.contains('screenshots') || options.contains('video')) {
54+
console.log("Fetching session screenshots");
4555
await screenshots(sessions, options);
4656
}
4757
}
@@ -51,9 +61,13 @@ class SessionsTool {
5161
console.log("");
5262
console.log("This tool downloads screenshots and/or logs from recorded TestFairy sessions. Use this to download data to analyze");
5363
console.log("sessions with your own toolchain or to import to your own analytics systems.");
54-
process.exit(1);
64+
}
65+
66+
version() {
67+
console.log("fetch-sessions-tool version 1.3.0");
5568
}
5669
}
5770

5871
const tool = new SessionsTool();
5972
tool.run().catch((error: Error) => { console.error(error.message); tool.help(); })
73+

app/models.ts

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -115,6 +115,10 @@ export class Options {
115115
return isEmpty(this.options) || this.options.help;
116116
}
117117

118+
containsVersion() {
119+
return this.options.version;
120+
}
121+
118122
contains(key: string) {
119123
return this.options[key] !== undefined
120124
}

app/screenshotCallback.ts

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -62,7 +62,8 @@ export class Video implements ScreenshotCallbackCommand {
6262
return;
6363
}
6464

65-
console.log(`All ${downloads.length} images for ${session} have been downloaded. Creating video ${filename}`);
65+
console.log(`All ${downloads.length} images for ${session} have been downloaded.`);
66+
console.log(`Creating video ${filename}`);
6667

6768
const command = `${ffmpeg.path} -r 1 -pattern_type glob -i '${filesPath}/*.jpg' -c:v libx264 ${filename}`;
6869
exec.exec(command, (err, stdout, stderr) => {

js/aes-encryption.js

Lines changed: 0 additions & 1 deletion
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

js/aes-encryption.js.map

Lines changed: 1 addition & 1 deletion
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

js/app.js

Lines changed: 13 additions & 2 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

js/app.js.map

Lines changed: 1 addition & 1 deletion
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

js/helpers.js

Lines changed: 7 additions & 20 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

0 commit comments

Comments
 (0)