Skip to content

Commit

Permalink
update init hook
Browse files Browse the repository at this point in the history
  • Loading branch information
anycodes committed Jun 22, 2021
1 parent e6016c2 commit 8a4ab82
Show file tree
Hide file tree
Showing 2 changed files with 11 additions and 1 deletion.
2 changes: 1 addition & 1 deletion package-lock.json

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

10 changes: 10 additions & 0 deletions src/common/load/loadApplication.ts
Original file line number Diff line number Diff line change
Expand Up @@ -82,6 +82,16 @@ async function handleDecompressFile({ zipball_url, applicationPath, name }) {
strip: 1,
});
const hasPublishYaml = await getYamlContent(path.resolve(temporaryPath, 'publish.yaml'));
// preInit
try{
const baseChildComponent = await require(path.join(temporaryPath, 'hook'));
const tempObj = {
"tempPath": temporaryPath,
"targetPath": applicationPath
}
await baseChildComponent.preInit(tempObj)
process.env[`${applicationPath}-post-init`] = JSON.stringify(tempObj)
}catch (e){}
if (hasPublishYaml) {
fs.copySync(`${temporaryPath}/src`, applicationPath);
rimraf.sync(temporaryPath);
Expand Down

0 comments on commit 8a4ab82

Please sign in to comment.