Skip to content

Commit

Permalink
feat: Add a post-create message to Python actors (#349)
Browse files Browse the repository at this point in the history
Python actors require some post-create instructions:
- how to add additonal dependencies
- how to install Playwright and its browsers

This PR adds an option to have a post-create message in the template
definition, and to show it after you run `apify create` with a specific
template.

The accompanying PR in actor-templates is here:
apify/actor-templates#135
  • Loading branch information
fnesveda authored Mar 14, 2023
1 parent d7d7bf6 commit 637907f
Showing 1 changed file with 5 additions and 1 deletion.
6 changes: 5 additions & 1 deletion src/commands/create.js
Original file line number Diff line number Diff line change
Expand Up @@ -46,8 +46,9 @@ class CreateCommand extends ApifyCommand {
});

actorName = await ensureValidActorName(actorName);
let messages = null;
if (manifestPromise) {
({ archiveUrl: templateArchiveUrl, skipOptionalDeps } = await getTemplateDefinition(templateName, manifestPromise));
({ archiveUrl: templateArchiveUrl, skipOptionalDeps, messages } = await getTemplateDefinition(templateName, manifestPromise));
}

const cwd = process.cwd();
Expand Down Expand Up @@ -143,6 +144,9 @@ class CreateCommand extends ApifyCommand {

if (dependenciesInstalled) {
outputs.success(`Actor '${actorName}' was created. To run it, run "cd ${actorName}" and "apify run".`);
if (messages?.postCreate) {
outputs.info(messages?.postCreate);
}
} else {
outputs.success(`Actor '${actorName}' was created. Please install its dependencies to be able to run it using "apify run".`);
}
Expand Down

0 comments on commit 637907f

Please sign in to comment.