igorklopov / enclose

Compile your Node.js project into an executable
http://enclosejs.com
Other
936 stars 43 forks source link

Bundling executables in the package #148

Closed brunobg closed 7 years ago

brunobg commented 7 years ago

Is it possible to bundle external executables in the package? Pure external .exe to be processed with child_process.exec. something like this:

var exec = require('child_process').exec;
console.log()
exec(__dirname + '/foo', function callback(error, stdout, stderr){
        console.log("got it!", error, stdout);
});

I tried to add foo to the assets, but it still fails with a /bin/sh: /thebox/[path]/foo: No such file or directory.

igorklopov commented 7 years ago

The only way known to me is read from __dirname-relative (internal) path and write to cwd-relative (external) path. And then execute it.

igorklopov commented 7 years ago

Dear users of EncloseJS. I highly encourage you to switch to https://github.com/zeit/pkg It is rewritten successor of EncloseJS. It is open source, and all improvements will go there. Please check if pkg has your issue unresolved, and if it is true, reopen your issue there: https://github.com/zeit/pkg/issues