Skip to content

Commit

Permalink
Update doc links from 12.x to 13.x in urls (#5903)
Browse files Browse the repository at this point in the history
  • Loading branch information
weitzman authored Mar 12, 2024
1 parent c6cee19 commit 110b2c4
Show file tree
Hide file tree
Showing 13 changed files with 25 additions and 28 deletions.
2 changes: 1 addition & 1 deletion .circleci/mergable.sh
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
set -e

# No need to check for mergability on commits that are already merged.
# No need to check for mergeability on commits that are already merged.
if [ "$CIRCLE_BRANCH" == "11.x" ] || [ "$CIRCLE_BRANCH" == "12.x" ] ; then
exit 0
fi
Expand Down
8 changes: 4 additions & 4 deletions CONTRIBUTING.md
Original file line number Diff line number Diff line change
@@ -1,13 +1,13 @@
---
edit_url: https://github.com/drush-ops/drush/blob/12.x/CONTRIBUTING.md
edit_url: https://github.com/drush-ops/drush/blob/13.x/CONTRIBUTING.md
---
Drush is built by people like you! Please [join us](https://github.com/drush-ops/drush).

## Git and Pull requests
* Contributions are submitted, reviewed, and accepted using GitHub pull requests.
* The latest changes are in the `12.x` branch. PR's should initially target this branch.
* See the test-specific [README.md](https://github.com/drush-ops/drush/blob/12.x/docs/contribute/unish.md) for instructions on running the test suite. Test before you push. Get familiar with Unish, our test suite. Optionally run tests in the provided Docker containers.
* We maintain branches named 12.x, 11.x, etc. These are release branches. From these branches, we make new tags for patch and minor versions.
* The latest changes are in the `13.x` branch. PR's should initially target this branch.
* See the test-specific [README.md](https://github.com/drush-ops/drush/blob/13.x/docs/contribute/unish.md) for instructions on running the test suite. Test before you push. Get familiar with Unish, our test suite. Optionally run tests in the provided Docker containers.
* We maintain branches named 13.x, 12.x, etc. These are release branches. From these branches, we make new tags for patch and minor versions.

## Development Environment
* You may choose to use the [DDEV](https://ddev.readthedocs.io/) for a [standardized development environment](/.ddev/config.yaml).
Expand Down
2 changes: 1 addition & 1 deletion appveyor.yml
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@ platform: 'x86'
clone_folder: C:\projects\work
branches:
only:
- 12.x
- 13.x

## Cache composer bits
cache:
Expand Down
12 changes: 6 additions & 6 deletions docs/commands.md
Original file line number Diff line number Diff line change
Expand Up @@ -10,9 +10,9 @@ Creating a new Drush command is easy. Follow the steps below.
1. Run `drush generate drush:command-file`.
2. Drush will prompt for the machine name of the module that should _own_ the file. The module selected must already exist and be enabled. Use `drush generate module` to create a new module.
3. Drush will then report that it created a commandfile. Edit as needed.
4. Use the classes for the core Drush commands at [/src/Commands](https://github.com/drush-ops/drush/tree/12.x/src/Commands) as inspiration and documentation.
4. Use the classes for the core Drush commands at [/src/Commands](https://github.com/drush-ops/drush/tree/13.x/src/Commands) as inspiration and documentation.
5. You may [inject dependencies](dependency-injection.md) into a command instance.
6. Write PHPUnit tests based on [Drush Test Traits](https://github.com/drush-ops/drush/blob/12.x/docs/contribute/unish.md#drush-test-traits).
6. Write PHPUnit tests based on [Drush Test Traits](https://github.com/drush-ops/drush/blob/13.x/docs/contribute/unish.md#drush-test-traits).

## Attributes or Annotations
The following are both valid ways to declare a command:
Expand Down Expand Up @@ -69,10 +69,10 @@ In the module that wants to alter a command info, add a class that:
1. Implement the alteration logic in the `alterCommandInfo()` method.
1. Along with the alter code, it's strongly recommended to log a debug message explaining what exactly was altered. This makes things easier on others who may need to debug the interaction of the alter code with other modules. Also it's a good practice to inject the the logger in the class constructor.

For an example, see [WootCommandInfoAlterer](https://github.com/drush-ops/drush/blob/12.x/sut/modules/unish/woot/src/Drush/CommandInfoAlterers/WootCommandInfoAlterer.php) provided by the testing 'woot' module.
For an example, see [WootCommandInfoAlterer](https://github.com/drush-ops/drush/blob/13.x/sut/modules/unish/woot/src/Drush/CommandInfoAlterers/WootCommandInfoAlterer.php) provided by the testing 'woot' module.

## Symfony Console Commands
Drush lists and runs Symfony Console commands, in addition to more typical annotated commands. See [this test](https://github.com/drush-ops/drush/blob/eed106ae4510d5a2df89f8e7fd54b41ffb0aa5fa/tests/integration/AnnotatedCommandCase.php#L178-L180) and this [commandfile](https://github.com/drush-ops/drush/blob/12.x/sut/modules/unish/woot/src/Commands/GreetCommand.php).
Drush lists and runs Symfony Console commands, in addition to more typical annotated commands. See [this test](https://github.com/drush-ops/drush/blob/eed106ae4510d5a2df89f8e7fd54b41ffb0aa5fa/tests/integration/AnnotatedCommandCase.php#L178-L180) and this [commandfile](https://github.com/drush-ops/drush/blob/13.x/sut/modules/unish/woot/src/Commands/GreetCommand.php).

## Auto-discovered commands (PSR4)

Expand Down Expand Up @@ -100,10 +100,10 @@ Using `require` in place of `conflict` is not recommended.

!!! warning "Symlinked packages"

While it is good practice to make your custom commands into a Composer package, please beware that symlinked packages (by using the composer repository type [Path](https://getcomposer.org/doc/05-repositories.md#path)) will **not** be discovered by Drush. When in development, it is recommended to [specify your package's](https://github.com/drush-ops/drush/blob/12.x/examples/example.drush.yml#L52-L67) path in your `drush.yml` to have quick access to your commands.
While it is good practice to make your custom commands into a Composer package, please beware that symlinked packages (by using the composer repository type [Path](https://getcomposer.org/doc/05-repositories.md#path)) will **not** be discovered by Drush. When in development, it is recommended to [specify your package's](https://github.com/drush-ops/drush/blob/13.x/examples/example.drush.yml#L52-L67) path in your `drush.yml` to have quick access to your commands.

## Site-wide Commands
Commandfiles that are installed in a Drupal site and are not bundled inside a Drupal module are called _site-wide_ commandfiles. Site-wide commands may either be added directly to the Drupal site's repository (e.g. for site-specific policy files), or via `composer require`. See the [examples/Commands](https://github.com/drush-ops/drush/tree/12.x/examples/Commands) folder for examples. In general, it's preferable to use modules to carry your Drush commands.
Commandfiles that are installed in a Drupal site and are not bundled inside a Drupal module are called _site-wide_ commandfiles. Site-wide commands may either be added directly to the Drupal site's repository (e.g. for site-specific policy files), or via `composer require`. See the [examples/Commands](https://github.com/drush-ops/drush/tree/13.x/examples/Commands) folder for examples. In general, it's preferable to use modules to carry your Drush commands.

Here are some examples of valid commandfile names and namespaces:

Expand Down
4 changes: 2 additions & 2 deletions docs/generators.md
Original file line number Diff line number Diff line change
Expand Up @@ -16,12 +16,12 @@ Creating a new Drush generator is easy. Follow the steps below.
1. Run `drush generate drush:generator`.
2. Drush will prompt for the machine name of the module that should _own_ the files. The module selected must already exist and be enabled. Use `drush generate module` to create a new module.
3. Drush will then report that it created a generator (PHP class and twig file). Edit as needed.
4. Similar to [ExampleGenerator](https://github.com/drush-ops/drush/tree/12.x/sut/modules/unish/woot/src/Drush/Generators), implement your custom logic in the generate() method.
4. Similar to [ExampleGenerator](https://github.com/drush-ops/drush/tree/13.x/sut/modules/unish/woot/src/Drush/Generators), implement your custom logic in the generate() method.
5. You may [inject dependencies](dependency-injection.md) from Drupal or Drush.

## Auto-discovered Generators (PSR4)

Generators that don't ship inside Drupal modules are called *global* generators. For example see [CustomDrushGenerator](https://github.com/drush-ops/drush/blob/12.x/tests/fixtures/lib/Drush/Generators/CustomGenerator.php). In general, it is better to use modules to carry your generators. If you still prefer using a global generator, please note:
Generators that don't ship inside Drupal modules are called *global* generators. For example see [CustomDrushGenerator](https://github.com/drush-ops/drush/blob/13.x/tests/fixtures/lib/Drush/Generators/CustomGenerator.php). In general, it is better to use modules to carry your generators. If you still prefer using a global generator, please note:

1. The generator class should be PSR4 auto-loadable.
1. The generator class namespace, relative to base namespace, should be `Drush\Generators`. For instance, if a Drush generator provider third party library maps this PSR4 autoload entry:
Expand Down
2 changes: 1 addition & 1 deletion docs/site-alias-manager.md
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@ Site Alias Manager

The [Site Alias Manager (SAM)](https://github.com/consolidation/site-alias/blob/4.0.1/src/SiteAliasManager.php) service is used to retrieve information about one or all of the site aliases for the current installation.

- An informative example is the [browse command](https://github.com/drush-ops/drush/blob/12.x/src/Commands/core/BrowseCommands.php)
- An informative example is the [browse command](https://github.com/drush-ops/drush/blob/13.x/src/Commands/core/BrowseCommands.php)
- A commandfile gets usually access to the SAM via [autowire](dependency-injection.md#autowire) of a dependency:
```php
#[Autowire(service: DependencyInjection::SITE_ALIAS_MANAGER)]
Expand Down
4 changes: 2 additions & 2 deletions docs/using-drush-configuration.md
Original file line number Diff line number Diff line change
Expand Up @@ -171,12 +171,12 @@ notify:
duration: 30
# Specify a command to run. Defaults to Notification Center (OSX) or libnotify (Linux)
cmd: /path/to/program
# See https://github.com/drush-ops/drush/blob/12.x/src/Commands/core/NotifyCommands.php for more settings.
# See https://github.com/drush-ops/drush/blob/13.x/src/Commands/core/NotifyCommands.php for more settings.
xh:
# Start profiling via xhprof/tideways and show a link to the run report.
link: http://xhprof.local
# See https://github.com/drush-ops/drush/blob/12.x/src/Commands/core/XhprofCommands.php for more settings.
# See https://github.com/drush-ops/drush/blob/13.x/src/Commands/core/XhprofCommands.php for more settings.
profile-builtins: true
profile-cpu: false
profile-memory: false
Expand Down
3 changes: 1 addition & 2 deletions examples/Commands/ArtCommands.php
Original file line number Diff line number Diff line change
Expand Up @@ -9,14 +9,13 @@
use Consolidation\AnnotatedCommand\Hooks\HookManager;
use Consolidation\OutputFormatters\StructuredData\RowsOfFields;
use Drush\Attributes as CLI;
use Drush\Style\DrushStyle;
use Symfony\Component\Console\Input\InputInterface;
use Symfony\Component\Console\Output\OutputInterface;

/**
* Run these commands using the --include option - e.g. `drush --include=/path/to/drush/examples art sandwich`
*
* See [Drush Test Traits](https://github.com/drush-ops/drush/blob/12.x/docs/contribute/unish.md#about-the-test-suites) for info on testing Drush commands.
* See [Drush Test Traits](https://github.com/drush-ops/drush/blob/13.x/docs/contribute/unish.md#about-the-test-suites) for info on testing Drush commands.
*/

class ArtCommands extends DrushCommands implements CustomEventAwareInterface
Expand Down
4 changes: 1 addition & 3 deletions examples/Commands/PolicyCommands.php
Original file line number Diff line number Diff line change
Expand Up @@ -7,14 +7,12 @@
use Drush\Attributes as CLI;
use Drush\Commands\core\RsyncCommands;
use Drush\Commands\core\UpdateDBCommands;
use Drush\Commands\DrushCommands;
use Drush\Commands\sql\SqlSyncCommands;
use Symfony\Component\Console\Input\InputOption;

/**
* Load this commandfile using the --include option - e.g. `drush --include=/path/to/drush/examples`
*
* See [Drush Test Traits](https://github.com/drush-ops/drush/blob/12.x/docs/contribute/unish.md#about-the-test-suites) for info on testing Drush commands.
* See [Drush Test Traits](https://github.com/drush-ops/drush/blob/13.x/docs/contribute/unish.md#about-the-test-suites) for info on testing Drush commands.
*/

class PolicyCommands extends DrushCommands
Expand Down
2 changes: 1 addition & 1 deletion mkdocs_base.yml
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,7 @@ theme:
site_url: https://www.drush.org/latest/
repo_url: https://github.com/drush-ops/drush
#Overridden on many pages via edit_uri plugin. See front matter.
edit_uri: blob/12.x/docs
edit_uri: blob/13.x/docs
extra_css:
- css/extra.drush.css
plugins:
Expand Down
2 changes: 1 addition & 1 deletion src/Attributes/Obsolete.php
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@

/**
* Mark commands as obsolete. These commands are omitted from help list and when
* user tries to run one, the command's description is shown. Example usage at https://github.com/drush-ops/drush/blob/12.x/src/Commands/LegacyCommands.php
* user tries to run one, the command's description is shown. Example usage at https://github.com/drush-ops/drush/blob/13.x/src/Commands/LegacyCommands.php
*/
#[Attribute(Attribute::TARGET_METHOD)]
class Obsolete extends NoArgumentsBase
Expand Down
6 changes: 3 additions & 3 deletions src/Commands/core/MkCommands.php
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,7 @@ final class MkCommands extends DrushCommands
/**
* Build a Markdown document for each Drush command/generator that is available on a site.
*
* This command is an early step when building the www.drush.org static site. Adapt it to build a similar site listing the commands that are available on your site. Also see Drush's [Github Actions workflow](https://github.com/drush-ops/drush/blob/12.x/.github/workflows/main.yml).
* This command is an early step when building the www.drush.org static site. Adapt it to build a similar site listing the commands that are available on your site. Also see Drush's [Github Actions workflow](https://github.com/drush-ops/drush/blob/13.x/.github/workflows/main.yml).
*/
#[CLI\Command(name: 'mk:docs')]
#[CLI\Bootstrap(level: DrupalBootLevels::FULL)]
Expand Down Expand Up @@ -125,7 +125,7 @@ protected static function appendTopics(AnnotatedCommand $command, string $dir_co
$value = "- [$topic_description]($target_relative) ($name)";
} else {
$rel_from_root = Path::makeRelative($abs, $base);
$value = "- [$topic_description](https://raw.githubusercontent.com/drush-ops/drush/12.x/$rel_from_root) ($name)";
$value = "- [$topic_description](https://raw.githubusercontent.com/drush-ops/drush/13.x/$rel_from_root) ($name)";
}
}
}
Expand Down Expand Up @@ -203,7 +203,7 @@ protected static function appendPreamble($command, $root): string
if ($command instanceof AnnotatedCommand) {
$path = Path::makeRelative($command->getAnnotationData()->get('_path'), $root);
}
$edit_url = $path ? "https://github.com/drush-ops/drush/blob/12.x/$path" : '';
$edit_url = $path ? "https://github.com/drush-ops/drush/blob/13.x/$path" : '';
$body = <<<EOT
---
edit_url: $edit_url
Expand Down
2 changes: 1 addition & 1 deletion src/TestTraits/DrushTestTrait.php
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@
* DrushTestTrait provides a `drush()` method that may be
* used to write functional tests for Drush extensions.
*
* More information is available at https://github.com/drush-ops/drush/blob/12.x/docs/contribute/unish.md#drush-test-traits.
* More information is available at https://github.com/drush-ops/drush/blob/13.x/docs/contribute/unish.md#drush-test-traits.
*/
trait DrushTestTrait
{
Expand Down

0 comments on commit 110b2c4

Please sign in to comment.