Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add CI #1

Merged
merged 13 commits into from
May 8, 2017
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
22 changes: 22 additions & 0 deletions .travis.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,22 @@
os:
- linux
- osx
dist: trusty
sudo: false

addons:
apt:
packages:
- google-chrome-beta
before_install:
- |
if [ "$TRAVIS_OS_NAME" = "osx" ]; then
brew tap caskroom/versions > /dev/null
brew update > /dev/null
brew cask install google-chrome-beta
fi

language: node_js
node_js:
- "6"
- "7"
24 changes: 24 additions & 0 deletions .vscode/launch.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,24 @@
{
// Use IntelliSense to learn about possible Node.js debug attributes.
// Hover to view descriptions of existing attributes.
// For more information, visit: https://go.microsoft.com/fwlink/?linkid=830387
"version": "0.2.0",
"configurations": [
{
"type": "node",
"request": "launch",
"name": "Launch Program",
"program": "${workspaceRoot}/src/index.ts",
"outFiles": ["${workspaceRoot}/lib/**/*.js"],
"smartStep": true
},
{
"type": "node",
"request": "attach",
"name": "Attach to Port",
"address": "localhost",
"port": 5858,
"outFiles": []
}
]
}
3 changes: 3 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
@@ -1,2 +1,5 @@
# html-pdf-chrome

[![Travis CI](https://travis-ci.org/westy92/html-pdf-chrome.svg)](https://travis-ci.org/westy92/html-pdf-chrome/)

HTML to PDF converter via Chrome/Chromium
8 changes: 6 additions & 2 deletions lib/src/index.js

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

2 changes: 1 addition & 1 deletion lib/src/index.js.map

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

2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,7 @@
"license": "MIT",
"typings": "lib/src/index.d.ts",
"engines": {
"node": ">= 4.5.0"
"node": ">= 6"
},
"os": [
"darwin",
Expand Down
8 changes: 6 additions & 2 deletions src/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -33,10 +33,14 @@ export async function create(html: string, options?: Options): Promise<CreateRes
reject(err);
});
}).then(async (createResult) => {
await chrome.kill();
if (chrome) {
await chrome.kill();
}
return createResult;
}).catch(async (err) => {
await chrome.kill();
if (chrome) {
await chrome.kill();
}
return Promise.reject(err);
});
}
Expand Down