Skip to content

Commit 4529f1f

Browse files
committed
fix(package/custom-container): package custom-container to ros
1 parent 69f1065 commit 4529f1f

1 file changed

Lines changed: 6 additions & 5 deletions

File tree

src/lib/package/template.js

Lines changed: 6 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -616,16 +616,17 @@ async function uploadAndUpdateFunctionCode({ tpl, tplPath, useNas, baseDir, ossC
616616
const codeUriCache = new Map();
617617

618618
for (const {serviceName, serviceRes, functionName, functionRes} of definition.findFunctionsInTpl(updatedTplContent)) {
619-
if (isOssUrl((functionRes.Properties || {}).CodeUri)) { continue; }
620-
621619
const runtime = (functionRes.Properties || {}).Runtime;
622-
const codeUri = (functionRes.Properties || {}).CodeUri;
623-
const absCodeUri = path.resolve(baseDir, codeUri);
624620
if (runtime === 'custom-container') {
625-
delete functionRes.Properties.CodeUri;
621+
delete (functionRes.Properties || {}).CodeUri;
626622
continue;
627623
}
628624

625+
if (isOssUrl((functionRes.Properties || {}).CodeUri)) { continue; }
626+
627+
const codeUri = (functionRes.Properties || {}).CodeUri;
628+
const absCodeUri = path.resolve(baseDir, codeUri);
629+
629630
if (!await fs.pathExists(absCodeUri)) {
630631
throw new Error(`codeUri ${absCodeUri} is not exist`);
631632
}

0 commit comments

Comments
 (0)