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

Commit bacf0f2

Browse files
author
Simon Hofmann
committed
Re-added bundle and dirs
1 parent 49964d8 commit bacf0f2

File tree

2 files changed

+31
-0
lines changed

2 files changed

+31
-0
lines changed

lib/bundle.js

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,8 @@
1+
const { opencvLibDir } = require("./dirs");
2+
const { readdirSync } = require("fs");
3+
const { resolvePath } = require('./commons');
4+
const { join } = require("path");
5+
6+
for (const file of readdirSync(opencvLibDir)) {
7+
console.log(resolvePath(join(opencvLibDir, file)));
8+
}

lib/dirs.js

Lines changed: 23 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,23 @@
1+
const { join } = require("path");
2+
3+
const isWin = () => process.platform == 'win32'
4+
5+
const isOSX = () => process.platform == 'darwin'
6+
7+
const isUnix = () => !isWin() && !isOSX();
8+
9+
const rootDir = `node_modules/@nut-tree/opencv-build-${process.platform}`
10+
const opencvRoot = join(rootDir, 'opencv');
11+
const opencvBuild = join(opencvRoot, 'build');
12+
const opencvInclude = join(opencvBuild, 'include');
13+
const opencvLibDir = isWin() ? join(opencvBuild, 'lib/Release') : join(opencvBuild, 'lib');
14+
const opencvBinDir = isWin() ? join(opencvBuild, 'bin/Release') : join(opencvBuild, 'bin');
15+
16+
module.exports = {
17+
rootDir,
18+
opencvRoot,
19+
opencvBuild,
20+
opencvInclude,
21+
opencvLibDir,
22+
opencvBinDir
23+
}

0 commit comments

Comments
 (0)