Skip to content
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
7 changes: 4 additions & 3 deletions cli.js
Original file line number Diff line number Diff line change
Expand Up @@ -11,9 +11,9 @@
const fs = require('fs');
const path = require('path');
const repl = require('repl');
const name = 'stylusdb-cli';
const debug = require('debug')(name);

const name = 'stylusdb-cli';

// Custom command setup
const fullCommands = {
Expand Down Expand Up @@ -68,13 +68,14 @@ function init() {
const customEval = function customEval(cmd, callback) {
let result;
cmd = cmd.trim();

let words = cmd.split(" ");
let command = words[0];
// Calling eval with an empty line below in the default case will cause it to be saved in command history.
if (cmd === '') {
return undefined;
}

switch (cmd) {
switch (command) {
case 'clear':
process.stdout.cursorTo(0, 0); // Move to top line of terminal
process.stdout.clearLine();
Expand Down