Skip to content

Change behavior of apify pull command #854

@patrikbraborec

Description

@patrikbraborec

When executing apify pull within an existing Actor directory, the command unexpectedly creates a new folder with the same name instead of updating the current directory's contents. This behavior deviates from the expected "pull" functionality, which is typically to synchronize and update existing local files, similar to how git pull operates.

To address the unexpected folder creation with apify pull and ensure a predictable user experience, I propose the following solution:

When a user executes apify pull within an existing actor directory, the CLI should prompt them before overwriting any local changes.

Proposed Flow:

  • User runs apify pull in an actor directory.
  • CLI Prompt: "If you pull, your local changes will be overwritten. Do you want to proceed? [Yes / No]"

If "Yes":

  • The CLI will "rewrite/replace" all files in the current directory with the latest version from the Apify Console.
  • The files from the Console will become the new source of truth for that local directory.

If "No":

  • The apify pull operation is aborted.
  • No files are changed or created.

For CLI use cases, we should also add --no-prompt flag, similar to apify push:

// Disable open browser on CI, or if user passed --no-prompt flag
if (!isCI && !this.flags.noPrompt) {
const shouldOpenBrowser = await inquirer.prompt([
{
type: 'confirm',
name: 'continue',
message: 'Do you want to open the Actor detail in your browser?',
default: true,
},
]);
if (shouldOpenBrowser.continue) {
await open(`https://console.apify.com${redirectUrlPart}/actors/${build.actId}`);
}
}

Metadata

Metadata

Assignees

Labels

t-dxIssues owned by the DX team.

Type

No type
No fields configured for issues without a type.

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions