MCPcopy
hub / github.com/ionic-team/capacitor / copySecureLiveUpdatesKey

Function copySecureLiveUpdatesKey

cli/src/tasks/copy.ts:225–245  ·  view source on GitHub ↗
(secureLiveUpdatesKeyFile: string, rootDir: string, nativeAbsDir: string)

Source from the content-addressed store, hash-verified

223}
224
225async function copySecureLiveUpdatesKey(secureLiveUpdatesKeyFile: string, rootDir: string, nativeAbsDir: string) {
226 const keyAbsFromPath = join(rootDir, secureLiveUpdatesKeyFile);
227 const keyAbsToPath = join(nativeAbsDir, basename(keyAbsFromPath));
228 const keyRelToDir = relative(rootDir, nativeAbsDir);
229
230 if (!(await pathExists(keyAbsFromPath))) {
231 logger.warn(
232 `Cannot copy Secure Live Updates signature file from ${c.strong(keyAbsFromPath)} to ${keyRelToDir}\n` +
233 `Signature file does not exist at specified key path.`,
234 );
235
236 return;
237 }
238
239 await runTask(
240 `Copying Secure Live Updates key from ${c.strong(secureLiveUpdatesKeyFile)} to ${keyRelToDir}`,
241 async () => {
242 return fsCopy(keyAbsFromPath, keyAbsToPath);
243 },
244 );
245}
246
247async function copySSLCert(sslCertPaths: string[], rootDir: string, targetDir: string) {
248 const validCertPaths: string[] = [];

Callers 1

copyFunction · 0.85

Calls 2

runTaskFunction · 0.90
warnMethod · 0.80

Tested by

no test coverage detected