Skip to content

Commit 1cdabc7

Browse files
author
Galen.Yuan
committed
add a new config suffix so that user can have a custom name suffix.
1 parent 220633c commit 1cdabc7

File tree

1 file changed

+4
-2
lines changed

1 file changed

+4
-2
lines changed

Diff for: index.js

+4-2
Original file line numberDiff line numberDiff line change
@@ -28,8 +28,9 @@ var browser = function (file, opts, cb) {
2828

2929
page.open(url, function() {
3030
var dest;
31-
32-
if ( opts.zoom > 1 ) {
31+
if ( opts.suffix ){
32+
dest = filename.replace('.html', '') + '-' + opts.suffix + '.' + opts.type;
33+
}else if ( opts.zoom > 1 ) {
3334
dest = filename.replace('.html', '') + '-' + w + '-zoom-' + opts.zoom + '.' + opts.type;
3435
} else {
3536
dest = filename.replace('.html', '') + '-' + w + '.' + opts.type;
@@ -72,6 +73,7 @@ module.exports = function (options) {
7273
opts.timeout = options.timeout || 200;
7374
opts.protocol = options.protocol || 'http';
7475
opts.host = options.host || 'localhost';
76+
opts.suffix = options.suffix || false;
7577
opts.server = typeof options.server === 'undefined' ? true : options.server;
7678

7779
//start local webserver

0 commit comments

Comments
 (0)