Skip to content
This repository has been archived by the owner on Jan 18, 2023. It is now read-only.

Commit

Permalink
fix(dev): add dir option to dev command
Browse files Browse the repository at this point in the history
  • Loading branch information
nahtnam committed Apr 21, 2019
1 parent ecbf5e0 commit 16db25f
Showing 1 changed file with 9 additions and 3 deletions.
12 changes: 9 additions & 3 deletions src/cli/commands/dev.tsx
Expand Up @@ -8,7 +8,7 @@ import { yellow } from 'colorette';
import importRoute from '../../utils/import-route';
import log from '../log';

export const command: string = 'dev';
export const command: string = 'dev [dir]';
export const aliases: string[] = ['d'];
export const desc: string = 'start a development srvr';

Expand All @@ -18,11 +18,17 @@ export const builder: CommandBuilder = {
description: 'enable or disable logs',
boolean: true,
default: true,
},
},
'dir': {
default: './',
description: 'base directory for the light server',
hidden: true,
},
};

interface Args {
log: boolean;
dir: string;
}

const handle = async (argv: Args) => {
Expand All @@ -31,7 +37,7 @@ const handle = async (argv: Args) => {
messageColor: 'brightred',
});

const cwd = process.cwd();
const cwd = join(process.cwd(), argv.dir);
const routesPath = join(cwd, './routes');

const app = server({
Expand Down

0 comments on commit 16db25f

Please sign in to comment.