Skip to content
This repository has been archived by the owner on Oct 25, 2023. It is now read-only.

Commit

Permalink
Add windows to travis build
Browse files Browse the repository at this point in the history
  • Loading branch information
imurchie committed Mar 1, 2019
1 parent 107cc78 commit c29cd59
Show file tree
Hide file tree
Showing 2 changed files with 9 additions and 1 deletion.
3 changes: 3 additions & 0 deletions .travis.yml
Original file line number Diff line number Diff line change
@@ -1,4 +1,7 @@
language: node_js
os:
- linux
- windows
node_js:
- "8"
- "10"
Expand Down
7 changes: 6 additions & 1 deletion lib/image-util.js
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,7 @@ import { hasValue } from './util';
import { exec } from 'teen_process';
import path from 'path';
import fs from './fs';
import log from './logger';


const { MIME_JPEG, MIME_PNG, MIME_BMP } = Jimp;
Expand Down Expand Up @@ -96,6 +97,7 @@ async function getJimpImage (data) {
* modules that are installed globally
*
* @param {string} packageName - the name of the package to be required
* @returns {object} - the package object
*/
async function requirePackage (packageName) {
// see if we can get it locally
Expand All @@ -109,6 +111,7 @@ async function requirePackage (packageName) {

// get the global package root
const packageDir = path.join(globalNPMRoot, packageName);
log.debug(`Loading package '${packageName}' from '${packageDir}'`);
if (!await fs.exists(packageDir)) {
// not installed
throw new Error(`Unable to find global '${packageName}' module`);
Expand All @@ -124,7 +127,9 @@ async function initOpenCV () {
if (!cv) {
try {
cv = await requirePackage('opencv4nodejs');
} catch (ign) {}
} catch (err) {
log.debug(`Unable to load 'opencv4nodejs': ${err.message}`);
}
}
if (!cv) {
throw new Error(`'opencv4nodejs' module is required to use OpenCV features. ` +
Expand Down

0 comments on commit c29cd59

Please sign in to comment.