Skip to content

Commit 81cb627

Browse files
committed
fix(node): Print with stdio
1 parent eb7c1f2 commit 81cb627

File tree

7 files changed

+21
-22
lines changed

7 files changed

+21
-22
lines changed

cmds/core/docker.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -34,7 +34,7 @@ exports.builder = async (yargs) => {
3434

3535
exports.handler = async (argv) => {
3636
if (!UTIL.which('docker')) {
37-
console.log("Docker is not installed (cannot find `docker' executable)");
37+
console.warn("Docker is not installed (cannot find `docker' executable)");
3838
return;
3939
}
4040

cmds/core/exec.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -26,7 +26,7 @@ exports.builder = async (yargs) => {
2626
yargs.help(false);
2727
yargs.version(false);
2828
yargs.getOptions().narg = [];
29-
//console.log(yargs.getOptions());
29+
//console.warn(yargs.getOptions());
3030
};
3131

3232
exports.handler = async (argv) => {

cmds/core/init.js

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -50,7 +50,7 @@ exports.handler = async (argv) => {
5050
, argv.files);
5151
break;
5252
default:
53-
console.log(`Invalid argument, from: ${argv.from}`);
53+
console.warn(`Invalid argument, from: ${argv.from}`);
5454
break;
5555
}
5656
} else {
@@ -180,7 +180,6 @@ function ask(question, callback) {
180180
*/
181181
function check_eask_filename(name) {
182182
let base = path.basename(name);
183-
console.log(base);
184183
let prefix;
185184
if (base.startsWith('Easkfile')) prefix = 'Easkfile';
186185
else if (base.startsWith('Eask')) prefix = 'Eask';

cmds/create/elpa.js

Lines changed: 7 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -44,23 +44,23 @@ exports.handler = async (argv) => {
4444

4545
proc.on('close', function (code) {
4646
if (code == 0) {
47-
console.log('✓ Done cloning the ELPA template');
48-
console.log('');
47+
console.warn('✓ Done cloning the ELPA template');
48+
console.warn('');
4949
process.chdir(project_name);
5050
_cloned(argv);
5151
return;
5252
}
5353
// Help instruction here!
54-
console.log('✗ Error while cloning template project');
55-
console.log('');
56-
console.log(' [1] Make sure you have git installed and has the right permission');
57-
process.stdout.write(` [2] Failed because of the target directory isn't empty`);
54+
console.warn('✗ Error while cloning template project');
55+
console.warn('');
56+
console.warn(' [1] Make sure you have git installed and has the right permission');
57+
process.stderr.write(` [2] Failed because of the target directory isn't empty`);
5858
});
5959
}
6060

6161
/* Operations after _cloned */
6262
async function _cloned(argv) {
63-
console.log('Initialize the Eask-file for your project...');
63+
console.warn('Initialize the Eask-file for your project...');
6464
await init.create_eask_file();
6565
UTIL.e_call(argv, 'create/elpa');
6666
}

cmds/create/package.js

Lines changed: 7 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -44,23 +44,23 @@ exports.handler = async (argv) => {
4444

4545
proc.on('close', function (code) {
4646
if (code == 0) {
47-
console.log('✓ Done cloning the elisp package template');
48-
console.log('');
47+
console.warn('✓ Done cloning the elisp package template');
48+
console.warn('');
4949
process.chdir(project_name);
5050
_cloned(argv);
5151
return;
5252
}
5353
// Help instruction here!
54-
console.log('✗ Error while cloning template project');
55-
console.log('');
56-
console.log(' [1] Make sure you have git installed and has the right permission');
57-
process.stdout.write(` [2] Failed because of the target directory isn't empty`);
54+
console.warn('✗ Error while cloning template project');
55+
console.warn('');
56+
console.warn(' [1] Make sure you have git installed and has the right permission');
57+
process.stderr.write(` [2] Failed because of the target directory isn't empty`);
5858
});
5959
};
6060

6161
/* Operations after _cloned */
6262
async function _cloned(argv) {
63-
console.log('Initialize the Eask-file for your project...');
63+
console.warn('Initialize the Eask-file for your project...');
6464
await init.create_eask_file();
6565
UTIL.e_call(argv, 'create/package');
6666
}

cmds/run/script.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -62,7 +62,7 @@ function startCommand(commands, count) {
6262

6363
let command = commands[count];
6464

65-
console.log('[RUN]: ' + command);
65+
console.warn('[RUN]: ' + command);
6666

6767
let proc = spawn(command, { stdio: 'inherit', shell: true });
6868

src/util.js

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -208,7 +208,7 @@ function _environment_name (argv) {
208208
*/
209209
async function e_call(argv, script, ...args) {
210210
if (!which(EASK_EMACS)) {
211-
console.log("Emacs is not installed (cannot find `" + EASK_EMACS + "' executable)");
211+
console.warn("Emacs is not installed (cannot find `" + EASK_EMACS + "' executable)");
212212
return;
213213
}
214214

@@ -230,8 +230,8 @@ async function e_call(argv, script, ...args) {
230230
console.log('');
231231
}
232232
if (5 <= argv.verbose) { // `all` scope
233-
console.log('[EXEC] ' + EASK_EMACS + ' ' + cmd.join(' '));
234-
console.log('');
233+
console.warn('[EXEC] ' + EASK_EMACS + ' ' + cmd.join(' '));
234+
console.warn('');
235235
}
236236

237237
setup_env();

0 commit comments

Comments
 (0)