Metadrop / drupal-artifact-builder

Helper to generate drupal artifacts
0 stars 1 forks source link

Create branch if it is not present in the artifact repository #10

Closed jorgetutor closed 1 month ago

jorgetutor commented 1 month ago

It would be a great feature to create the destiny branch in the artifact repository when it does not exist.

Now the script clones the destiny branch by default

$this->runCommand(sprintf('git clone %s %s -b %s', $this->repository, self::ARTIFACT_REPOSITORY_FOLDER, $this->branch));

We will need to:

  1. Clone the repo without selecting the branch
  2. Checkout to branch if exists, create if not
omarlopesino commented 1 month ago

With this command we can check if a branch exist or not:

git rev-parse --verify <branch-name>