@@ -6,8 +6,10 @@ use std::process::exit;
6
6
7
7
use xshell:: { Shell , cmd} ;
8
8
9
- const JOSH_FILTER : & str = ":rev(2efebd2f0c03dabbe5c3ad7b4ebfbd99238d1fb2 :prefix=src/tools/clippy):/src/tools/clippy" ;
9
+ const JOSH_FILTER : & str = ":rev(53d3bc02ed90eba01c5dbc5b2d0c4cabb67ffb4d :prefix=src/tools/clippy):/src/tools/clippy" ;
10
10
const JOSH_PORT : & str = "42042" ;
11
+ const TOOLCHAIN_TOML : & str = "rust-toolchain.toml" ;
12
+ const UTILS_README : & str = "clippy_utils/README.md" ;
11
13
12
14
fn start_josh ( ) -> impl Drop {
13
15
// Create a wrapper that stops it on drop.
@@ -96,22 +98,32 @@ pub fn rustc_pull() {
96
98
97
99
// Update rust-toolchain file
98
100
let date = Utc :: now ( ) . format ( "%Y-%m-%d" ) . to_string ( ) ;
99
- let update = & mut update_text_region_fn (
101
+ let toolchain_update = & mut update_text_region_fn (
100
102
"# begin autogenerated nightly\n " ,
101
103
"# end autogenerated nightly" ,
102
104
|dst| {
103
105
writeln ! ( dst, "channel = \" nightly-{date}\" " ) . unwrap ( ) ;
104
106
} ,
105
107
) ;
108
+ let readme_update = & mut update_text_region_fn (
109
+ "<!-- begin autogenerated nightly -->\n " ,
110
+ "<!-- end autogenerated nightly -->" ,
111
+ |dst| {
112
+ writeln ! ( dst, "```\n nightly-{date}\n ```" ) . unwrap ( ) ;
113
+ } ,
114
+ ) ;
106
115
107
116
let mut updater = FileUpdater :: default ( ) ;
108
- updater. update_file ( "rust-toolchain.toml" , update ) ;
109
- updater. update_file ( "clippy_utils/README.md" , update ) ;
117
+ updater. update_file ( TOOLCHAIN_TOML , toolchain_update ) ;
118
+ updater. update_file ( UTILS_README , readme_update ) ;
110
119
111
120
let message = format ! ( "Bump nightly version -> {date}" ) ;
112
- cmd ! ( sh, "git commit rust-toolchain --no-verify -m {message}" )
113
- . run ( )
114
- . expect ( "FAILED to commit rust-toolchain file, something went wrong" ) ;
121
+ cmd ! (
122
+ sh,
123
+ "git commit --no-verify -m {message} -- {TOOLCHAIN_TOML} {UTILS_README}"
124
+ )
125
+ . run ( )
126
+ . expect ( "FAILED to commit rust-toolchain.toml file, something went wrong" ) ;
115
127
116
128
let commit = rustc_hash ( ) ;
117
129
0 commit comments