Skip to content

Commit

Permalink
Browse files Browse the repository at this point in the history
  • Loading branch information
andy-portmen committed Jan 12, 2025
1 parent 8b9fbbc commit e9424d3
Show file tree
Hide file tree
Showing 5 changed files with 17 additions and 6 deletions.
2 changes: 1 addition & 1 deletion host.js
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,7 @@ let files = [];
const sprocess = [];

const config = {
version: '0.9.5'
version: '0.9.7'
};
// closing node when parent process is killed
process.stdin.resume();
Expand Down
6 changes: 5 additions & 1 deletion install.sh
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,11 @@ else
echo "Installer is using the embedded NodeJS"
echo
if [[ $OSTYPE == 'darwin'* ]]; then
../node/x64/node install.js --add_node $1
if [[ $MACHINE_TYPE == 'arm64' ]]; then
../node/arm64/node install.js --add_node $1
else
../node/x64/node install.js --add_node $1
fi
elif [ ${MACHINE_TYPE} == 'x86_64' ]; then
../node/x64/node install.js --add_node $1
else
Expand Down
8 changes: 6 additions & 2 deletions linux/app/install.js
Original file line number Diff line number Diff line change
Expand Up @@ -86,15 +86,19 @@ function application() {
return reject(e);
}
const isNode = process.argv.filter(a => a === '--add_node').length === 0;

const run = `#!/usr/bin/env bash\n${isNode ? process.argv[0] : './node'} $(dirname "$0")/host.js`;
fs.writeFile(path.join(dir, 'run.sh'), run, e => {
if (e) {
return reject(e);
}
fs.chmodSync(path.join(dir, 'run.sh'), '0755');
if (!isNode) {
fs.createReadStream(process.argv[0]).pipe(fs.createWriteStream(path.join(dir, 'node')));
fs.chmodSync(path.join(dir, 'node'), '0755');
const stream = fs.createReadStream(process.argv[0]);
stream.on('close', () => {
fs.chmodSync(path.join(dir, 'node'), '0755');
});
stream.pipe(fs.createWriteStream(path.join(dir, 'node')));
}
fs.createReadStream('host.js').pipe(fs.createWriteStream(path.join(dir, 'host.js')));
fs.createReadStream('messaging.js').pipe(fs.createWriteStream(path.join(dir, 'messaging.js')));
Expand Down
7 changes: 5 additions & 2 deletions mac/app/install.js
Original file line number Diff line number Diff line change
Expand Up @@ -97,8 +97,11 @@ function application(callback) {
}
fs.chmodSync(path.join(dir, 'run.sh'), '0755');
if (!isNode) {
fs.createReadStream(process.argv[0]).pipe(fs.createWriteStream(path.join(dir, 'node')));
fs.chmodSync(path.join(dir, 'node'), '0755');
const stream = fs.createReadStream(process.argv[0]);
stream.on('close', () => {
fs.chmodSync(path.join(dir, 'node'), '0755');
});
stream.pipe(fs.createWriteStream(path.join(dir, 'node')));
}
fs.createReadStream('host.js').pipe(fs.createWriteStream(path.join(dir, 'host.js')));
fs.createReadStream('messaging.js').pipe(fs.createWriteStream(path.join(dir, 'messaging.js')));
Expand Down
Binary file added mac/node/arm64/node
Binary file not shown.

0 comments on commit e9424d3

Please sign in to comment.