Skip to content

Commit 7ea6780

Browse files
authored
Twin Script Updates (#1174)
* Fixes an issue with PR brackets in the generation of TWiN * Adds the ability to accept TWiN as input rather than just a file. This allows a single step: ```nushell generate-twin | twin format | save 2025-09-19-twin0317.md ```
1 parent 64a9e01 commit 7ea6780

File tree

2 files changed

+12
-3
lines changed

2 files changed

+12
-3
lines changed

make_release/this_week_in_nu_weekly.nu

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -84,7 +84,7 @@ def generate-twin [
8484

8585
for pr in $user.prs {
8686
$twin_text += $"
87-
- [($pr.title) \(#($pr.number)]\)\(($pr.url)\)
87+
- [($pr.title) \(#($pr.number)\)]\(($pr.url)\)
8888
8989
" | str dedent
9090
}

make_release/twin-tweaks.nu

Lines changed: 11 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,16 @@
1-
def "twin format" [filename] {
1+
def "twin format" [filename?] {
22
use std/clip
33
use std-rfc/str
44

5+
let input = $in
6+
7+
let twin_content = (
8+
match $filename {
9+
null => $input
10+
_ => { open --raw $filename }
11+
}
12+
)
13+
514
{
615
Authorization: $'Bearer (kv get -u OPENROUTER_API_KEY)'
716
}
@@ -11,7 +20,7 @@ def "twin format" [filename] {
1120
Rewrite the following auto-generated changelog so it's more natural. For example, change things like 'rgwood created [Bump dependencies...' to 'rgwood [bumped dependencies...'. Keep the inline links. Make sure to keep ALL original URLs! When returning the text, do not include any explaination of the change or the surrounding backticks around the result:
1221
1322
```
14-
(open --raw $filename)
23+
($twin_content)
1524
```
1625
"
1726
| str unindent

0 commit comments

Comments
 (0)