Skip to content

Commit 916154b

Browse files
committed
feat(starter): log food to console
1 parent 2cbf0b3 commit 916154b

File tree

3 files changed

+15
-12
lines changed

3 files changed

+15
-12
lines changed

bin/order.bin.js

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
#!/usr/bin/env node
22
const commander = require('commander');
33
const version = require('../package').version;
4-
const greet = require('../src/greet');
4+
const waiter = require('../src/waiter');
55

66
commander
77
.version(version)
@@ -12,6 +12,6 @@ commander
1212
)
1313
.action(function(food, drink) {
1414
const includeWineCard = commander.wineCard;
15-
greet.restaurant();
15+
waiter.order(food, drink);
1616
})
1717
.parse(process.argv);

src/log.js

Lines changed: 0 additions & 9 deletions
This file was deleted.

src/waiter.js

Lines changed: 13 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,6 @@
1-
function order() {
1+
const chalk = require('chalk');
2+
3+
function order(food, drink) {
24
console.log(
35
'\n' +
46
' _ \n' +
@@ -8,6 +10,16 @@ function order() {
810
' \\__, |\\___/ \\__,_|_| \\___/|_| \\__,_|\\___|_| \n' +
911
' |___/ \n'
1012
);
13+
console.log(
14+
`${chalk.green('You ordered the following food: ')} ${chalk.blue.bold(
15+
food
16+
)}`
17+
);
18+
console.log(
19+
`${chalk.green('You ordered the following drink: ')} ${chalk.blue.bold(
20+
drink
21+
)}`
22+
);
1123
}
1224

1325
module.exports = { order };

0 commit comments

Comments
 (0)