Skip to content
Draft
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 3 additions & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -27,13 +27,15 @@ Installing this in a production environment is not recommended.

## Usage

> ⚠️ **Warning:** Always create a new Git branch before running this tool. Otherwise, you may accidentally commit the generated audit classes to your production branch.

Once the tool has been installed, you can run it directly from Composer’s `vendor/bin`

```bash
vendor/bin/audit-class-generator
```

This will open a new git branch and apply temporary audit classes to any Twig HTML elements that already have a "class" attribute defined.
This will apply temporary audit classes to any Twig HTML elements that already have a "class" attribute defined.

Then view the source of the page you want to debug in a browser. You'll see that any tag that already had a "class" attribute now has a unique, pseudorandom class like `audit_34f39d` appended to the class list.

Expand Down
5 changes: 1 addition & 4 deletions bin/audit-class-generator
Original file line number Diff line number Diff line change
Expand Up @@ -30,11 +30,8 @@ if (isset($options['h']) || isset($options['help'])) {

$config = Config::create($options);

//First, we need to be on a safe git branch, since this set of changes will mess with lots of files
exec('git checkout -b temporary-template-audit-branch-remove-me-soon');

echo PHP_EOL;
echo "Temporary git branch created. Iterating through templates ... ";
echo "Iterating through templates ... ";
echo PHP_EOL;

$applier = new Applier();
Expand Down