|
1 | | -import { Argv } from 'yargs'; |
2 | 1 | import inquirer from 'inquirer'; |
| 2 | +import { Argv } from 'yargs'; |
3 | 3 | import checkNodejsVersion from '../checks/nodejs-version'; |
4 | 4 | import checkProjectStructure from '../checks/project-structure'; |
5 | 5 | import { getConfigFromCli, StartCliFlags } from '../config/start'; |
6 | 6 | import { printRouteInfo } from '../printers/start'; |
7 | 7 | import { createServer } from '../runtime/server'; |
8 | 8 | import { startInspector } from '../runtime/utils/inspector'; |
9 | | -import { getDebugFunction, setLogLevelByName } from '../utils/logger'; |
| 9 | +import { getDebugFunction, logger, setLogLevelByName } from '../utils/logger'; |
10 | 10 | import { ExternalCliOptions, sharedCliOptions } from './shared'; |
11 | 11 | import { CliInfo } from './types'; |
12 | 12 | import { getFullCommand } from './utils'; |
13 | | -import { logger } from '../utils/logger'; |
14 | 13 |
|
15 | 14 | const debug = getDebugFunction('twilio-run:start'); |
16 | 15 |
|
@@ -46,7 +45,15 @@ export async function handler( |
46 | 45 | const config = await getConfigFromCli(argv, cliInfo, externalCliOptions); |
47 | 46 |
|
48 | 47 | const command = getFullCommand(argv); |
49 | | - await checkProjectStructure(config.baseDir, command); |
| 48 | + const directories = { |
| 49 | + assetsDirectories: config.assetsFolderName |
| 50 | + ? [config.assetsFolderName] |
| 51 | + : undefined, |
| 52 | + functionsDirectories: config.functionsFolderName |
| 53 | + ? [config.functionsFolderName] |
| 54 | + : undefined, |
| 55 | + }; |
| 56 | + await checkProjectStructure(config.baseDir, command, false, directories); |
50 | 57 |
|
51 | 58 | debug('Determined configuration: %p', config); |
52 | 59 | process.title = config.appName; |
@@ -163,6 +170,14 @@ export const cliInfo: CliInfo = { |
163 | 170 | describe: |
164 | 171 | 'Enables legacy mode, it will prefix your asset paths with /assets', |
165 | 172 | }, |
| 173 | + 'assets-folder': { |
| 174 | + type: 'string', |
| 175 | + describe: 'Specific folder name to be used for static assets', |
| 176 | + }, |
| 177 | + 'functions-folder': { |
| 178 | + type: 'string', |
| 179 | + describe: 'Specific folder name to be used for static functions', |
| 180 | + }, |
166 | 181 | }, |
167 | 182 | }; |
168 | 183 |
|
|
0 commit comments