Skip to content
Merged
Show file tree
Hide file tree
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
14 changes: 3 additions & 11 deletions lib/hexo.js
Original file line number Diff line number Diff line change
Expand Up @@ -48,19 +48,11 @@ function entry(cwd = process.cwd(), args) {

return hexo.init();
}).then(() => {
let cmd = '';
let cmd = 'help';

if (!args.h && !args.help) {
cmd = args._.shift();

if (cmd) {
const c = hexo.extend.console.get(cmd);
if (!c) cmd = 'help';
} else {
cmd = 'help';
}
} else {
cmd = 'help';
const c = args._.shift();
if (c && hexo.extend.console.get(c)) cmd = c;
}

watchSignal(hexo);
Expand Down
4 changes: 2 additions & 2 deletions test/scripts/version.js
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@ const { platform, release } = require('os');
const { format } = require('util');
const cliVersion = require('../../package.json').version;
const rewire = require('rewire');
const { spawn } = require('hexo-util')
const { spawn } = require('hexo-util');

function getConsoleLog({ args }) {
return args.map(arr => format.apply(null, arr)).join('\n');
Expand Down Expand Up @@ -39,7 +39,7 @@ describe('version', () => {

if (process.env.CI === 'true') {
if (process.platform === 'darwin') {
const osInfo = await spawn('sw_vers', '-productVersion')
const osInfo = await spawn('sw_vers', '-productVersion');
output.should.contain(`os: ${platform()} ${release()} ${osInfo}`);
} else if (process.platform === 'linux') {
const v = await spawn('cat', '/etc/os-release');
Expand Down