MCPcopy Index your code
hub / github.com/ionic-team/capacitor / getWebDir

Function getWebDir

cli/src/tasks/init.ts:106–126  ·  view source on GitHub ↗
(config: Config, webDir?: string)

Source from the content-addressed store, hash-verified

104}
105
106async function getWebDir(config: Config, webDir?: string) {
107 if (!webDir) {
108 const framework = detectFramework(config);
109 if (framework?.webDir) {
110 return framework.webDir;
111 }
112
113 const answers = await logPrompt(
114 `${c.strong(`What is the web asset directory for your app?`)}\n` +
115 `This directory should contain the final ${c.strong('index.html')} of your app.`,
116 {
117 type: 'text',
118 name: 'webDir',
119 message: `Web asset directory`,
120 initial: config.app.webDir ? config.app.webDir : 'www',
121 },
122 );
123 return answers.webDir;
124 }
125 return webDir;
126}
127
128async function runMergeConfig(config: Config, extConfig: ExternalConfig, type: 'json' | 'ts') {
129 const configDirectory = dirname(config.app.extConfigFilePath);

Callers 1

initCommandFunction · 0.70

Calls 2

detectFrameworkFunction · 0.90
logPromptFunction · 0.90

Tested by

no test coverage detected