Skip to content

Commit 80fda00

Browse files
authored
Merge branch 'master' into dependabot/github_actions/all-actions-c95a42c707
2 parents e10f988 + 97099ed commit 80fda00

File tree

2 files changed

+18
-15
lines changed

2 files changed

+18
-15
lines changed

.github/generate-help-output.py

+5-6
Original file line numberDiff line numberDiff line change
@@ -15,14 +15,13 @@ def remove_ansi_escape_codes(text):
1515
with open(readme_file, "r") as f:
1616
readme_content = f.read()
1717

18-
start_comment_tag = "<!-- HELP-COMMAND-OUTPUT:START -->"
19-
stop_comment_tag = "<!-- HELP-COMMAND-OUTPUT:END -->"
18+
start_comment_tag = "[comment]: # (HELP-COMMAND-OUTPUT:START)"
19+
stop_comment_tag = "[comment]: # (HELP-COMMAND-OUTPUT:END)"
2020

2121
comment_tag_pattern = rf"{start_comment_tag}(.*?){stop_comment_tag}"
2222
tag_section_content = re.search(comment_tag_pattern, readme_content, re.DOTALL)
2323

2424
if tag_section_content:
25-
2625
try:
2726
help_command_output_new = subprocess.check_output(["brew", "autoupdate", "--help"], text=True)
2827
except subprocess.CalledProcessError as e:
@@ -32,7 +31,7 @@ def remove_ansi_escape_codes(text):
3231
help_command_output_current = tag_section_content.group(1).strip()
3332
help_command_output_new = remove_ansi_escape_codes(help_command_output_new.strip())
3433

35-
start_code_pattern = "```shell"
34+
start_code_pattern = "```help"
3635
end_code_pattern = "```"
3736

3837
# Regex to check if the existing help section is in a shell code block
@@ -41,13 +40,13 @@ def remove_ansi_escape_codes(text):
4140

4241
if help_command_output_current != help_command_output_new:
4342
print("Content change detected.")
44-
help = f"{start_comment_tag}\n{start_code_pattern}\n{help_command_output_new}\n{end_code_pattern}\n{stop_comment_tag}"
43+
help = f"{start_comment_tag}\n\n{start_code_pattern}\n{help_command_output_new}\n{end_code_pattern}\n\n{stop_comment_tag}"
4544
readme_content = re.sub(comment_tag_pattern, help, readme_content, flags=re.DOTALL)
4645
print("Content updated.")
4746

4847
# Set GitHub Actions output variable
4948
with open(os.environ['GITHUB_OUTPUT'], 'a') as fh:
50-
print(f'changed=true', file=fh)
49+
print('changed=true', file=fh)
5150
else:
5251
print("No change detected. Content remains unchanged.")
5352
else:

README.md

+13-9
Original file line numberDiff line numberDiff line change
@@ -20,18 +20,21 @@ Now run `brew autoupdate start [interval] [options]` to enable autoupdate.
2020

2121
## Example
2222

23-
`brew autoupdate start 43200 --upgrade --cleanup --immediate --sudo`
23+
```sh
24+
brew autoupdate start 43200 --upgrade --cleanup --immediate --sudo
25+
```
2426

25-
This will upgrade all your casks and formulae every 12 hours and on every system boot. <br>
26-
If a sudo password is required for an upgrade, a GUI to enter your password will be displayed. <br>
27+
This will upgrade all your casks and formulae every 12 hours and on every system boot.
28+
If a sudo password is required for an upgrade, a GUI to enter your password will be displayed.
2729
Also, it will clean up every old version and left-over files.
2830

2931
Casks that have built-in auto-updates enabled by default will not be upgraded.
3032

3133
## Usage
3234

33-
<!-- HELP-COMMAND-OUTPUT:START -->
34-
```shell
35+
[comment]: # (HELP-COMMAND-OUTPUT:START)
36+
37+
```help
3538
Usage: brew autoupdate subcommand [interval] [options]
3639
3740
An easy, convenient way to automatically update Homebrew.
@@ -81,7 +84,8 @@ brew autoupdate version:
8184
-v, --verbose Make some output more verbose.
8285
-h, --help Show this message.
8386
```
84-
<!-- HELP-COMMAND-OUTPUT:END -->
87+
88+
[comment]: # (HELP-COMMAND-OUTPUT:END)
8589

8690
**Logs of the performed operations can be found at:** `~/Library/Logs/com.github.domt4.homebrew-autoupdate`
8791

@@ -97,13 +101,13 @@ the built-in autoupdate mechanism, which can be instructed to autoupdate less
97101
often, or disabled entirely. If you wish to update every 24 hours using the
98102
built-in autoupdate mechanism set this in your environment:
99103

100-
```bash
104+
```sh
101105
export HOMEBREW_AUTO_UPDATE_SECS="86400"
102106
```
103107

104108
or if you wish to disable the built-in autoupdate mechanism entirely:
105109

106-
```bash
110+
```sh
107111
export HOMEBREW_NO_AUTO_UPDATE="1"
108112
```
109113

@@ -126,4 +130,4 @@ the wider Homebrew leadership team in terms of maintenance/support requests.
126130

127131
## License
128132

129-
Code is under the [BSD 2 Clause (NetBSD) license](https://github.com/DomT4/homebrew-autoupdate/blob/master/LICENSE.txt).
133+
Code is under the [BSD 2 Clause (NetBSD) license](https://github.com/DomT4/homebrew-autoupdate/blob/master/LICENSE.txt).

0 commit comments

Comments
 (0)