Skip to content

Commit

Permalink
Use inherit options
Browse files Browse the repository at this point in the history
  • Loading branch information
jcs090218 committed Mar 26, 2022
1 parent a2bb801 commit aaf4ace
Showing 1 changed file with 1 addition and 12 deletions.
13 changes: 1 addition & 12 deletions src/util.js
Original file line number Diff line number Diff line change
Expand Up @@ -59,14 +59,6 @@ function _global_options(argv) {
return flags;
}

/* Print data from process. */
function _print_data(data, prefix = '') {
// After using `spawn` method, it will print two newline at the end of
// message (Emacs + console.log). We simply remove 1 newline at the end
// to prevent printing 2 newlines from one data.
console.log(prefix + data.toString().replace(/\n$/, ''));
}

/**
* Call emacs process
* @param { string } script - name of the script from `../lisp`
Expand All @@ -85,10 +77,7 @@ async function e_call(argv, script, ...args) {
console.log('~');
console.log('~ $ ' + cmd.join(' '));
console.log('~');
let process = child_process.spawn('emacs', cmd);

process.stdout.on('data', function (data) { _print_data(data); });
process.stderr.on('data', function (data) { _print_data(data); });
let process = child_process.spawn('emacs', cmd, { stdio: 'inherit' });

process.on('exit', function (code) {
if (code == 0) return;
Expand Down

0 comments on commit aaf4ace

Please sign in to comment.