File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree Original file line number Diff line number Diff line change 2626 "scripts" : {
2727 "configure" : " node-gyp configure" ,
2828 "build" : " node-gyp configure build --jobs max" ,
29- "postinstall" : " install_name_tool -change @rpath/libDynamsoftBarcodeReader.dylib @loader_path/libDynamsoftBarcodeReader.dylib build/Release/dbr.node " ,
29+ "postinstall" : " node ./scripts/postinstall.js " ,
3030 "clean" : " node-gyp clean"
3131 },
3232 "gypfile" : true
Original file line number Diff line number Diff line change 1+ var exec = require ( 'child_process' ) . exec ;
2+ var os = require ( 'os' ) ;
3+
4+ function puts ( error , stdout , stderr ) { console . error ( error ) }
5+
6+ const commands_linux = [ ]
7+
8+ const commands_darwin = [
9+ "install_name_tool -change @rpath/libDynamsoftBarcodeReader.dylib @loader_path/libDynamsoftBarcodeReader.dylib build/Release/dbr.node"
10+ ]
11+
12+ const commands_windows = [ ]
13+
14+ // Run command depending on the OS
15+ if ( os . type ( ) === 'Linux' ) {
16+ if ( commands_linux . length > 0 ) exec ( commands_linux . join ( '&&' ) , puts ) ;
17+ } else if ( os . type ( ) === 'Darwin' ) {
18+ if ( commands_darwin . length > 0 ) exec ( commands_darwin . join ( '&&' ) , puts ) ;
19+ } else if ( os . type ( ) === 'Windows_NT' ) {
20+ if ( commands_windows . length > 0 ) exec ( commands_windows . join ( '&&' ) , puts ) ;
21+ }
22+
You can’t perform that action at this time.
0 commit comments