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

Function copyWebDir

cli/src/tasks/copy.ts:168–187  ·  view source on GitHub ↗
(config: Config, nativeAbsDir: string, webAbsDir: string)

Source from the content-addressed store, hash-verified

166}
167
168async function copyWebDir(config: Config, nativeAbsDir: string, webAbsDir: string) {
169 const webRelDir = basename(webAbsDir);
170 const nativeRelDir = relative(config.app.rootDir, nativeAbsDir);
171
172 if (config.app.extConfig.server?.url && !(await pathExists(webAbsDir))) {
173 logger.warn(
174 `Cannot copy web assets from ${c.strong(webRelDir)} to ${nativeRelDir}\n` +
175 `Web asset directory specified by ${c.input('webDir')} does not exist. This is not an error because ${c.input(
176 'server.url',
177 )} is set in config.`,
178 );
179
180 return;
181 }
182
183 await runTask(`Copying web assets from ${c.strong(webRelDir)} to ${nativeRelDir}`, async () => {
184 await remove(nativeAbsDir);
185 return fsCopy(webAbsDir, nativeAbsDir);
186 });
187}
188
189async function copyFederatedWebDirs(config: Config, nativeAbsDir: string) {
190 logger.info('FederatedCapacitor Plugin Loaded - Copying Web Assets');

Callers 3

copyFunction · 0.85
copyAppsFunction · 0.85
copyShellFunction · 0.85

Calls 3

runTaskFunction · 0.90
removeFunction · 0.85
warnMethod · 0.80

Tested by

no test coverage detected