Skip to content

Commit

Permalink
Merge branch 'master' into core
Browse files Browse the repository at this point in the history
Conflicts:
	package-lock.json
	package.json
  • Loading branch information
tungs committed Jun 14, 2021
2 parents 90de409 + 923de85 commit 45535cc
Show file tree
Hide file tree
Showing 4 changed files with 28 additions and 32 deletions.
2 changes: 1 addition & 1 deletion .eslintrc.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"env": {
"es6": true,
"es2017": true,
"node": true,
"browser": true
},
Expand Down
46 changes: 21 additions & 25 deletions index.js
Original file line number Diff line number Diff line change
Expand Up @@ -62,7 +62,7 @@ const argumentArrayContains = function (args, item) {
}, false);
};

module.exports = function (config) {
module.exports = async function (config) {
config = Object.assign({
roundToEvenWidth: true,
roundToEvenHeight: true,
Expand Down Expand Up @@ -195,28 +195,24 @@ module.exports = function (config) {
}

var overallError;
return timesnap(timesnapConfig)
.then(function () {
if (convertProcess) {
convertProcess.stdin.end();
}
})
.then(function () {
// wait for ffmpeg to finish
if (processPromise) {
return processPromise;
} else {
return makeProcessPromise();
}
}).catch(function (err) {
overallError = err;
log(err);
}).then(function () {
if (frameMode && !config.keepFrames) {
deleteFolder(frameDirectory);
}
if (overallError) {
throw overallError;
}
});
try {
await timesnap(timesnapConfig);
if (convertProcess) {
convertProcess.stdin.end();
}
if (processPromise) {
await processPromise;
} else {
await makeProcessPromise();
}
} catch (err) {
overallError = err;
log(err);
}
if (frameMode && !config.keepFrames) {
deleteFolder(frameDirectory);
}
if (overallError) {
throw overallError;
}
};
8 changes: 4 additions & 4 deletions package-lock.json

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

4 changes: 2 additions & 2 deletions package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "timecut-core",
"version": "0.2.2-prerelease",
"version": "0.3.0-prerelease",
"description": "Record smooth movies of web pages",
"repository": {
"type": "git",
Expand All @@ -18,7 +18,7 @@
},
"license": "BSD-3-Clause",
"dependencies": {
"timesnap-core": "0.2.1"
"timesnap-core": "0.3.0"
},
"devDependencies": {
"eslint": "^6.8.0"
Expand Down

0 comments on commit 45535cc

Please sign in to comment.