File tree Expand file tree Collapse file tree 2 files changed +8
-2
lines changed Expand file tree Collapse file tree 2 files changed +8
-2
lines changed Original file line number Diff line number Diff line change
1
+ - Fix ` cargo bootimage ` on Windows (there was a bug in the argument parsing)
2
+
1
3
# 0.7.2
2
4
3
5
- New features for ` bootimage runner `
Original file line number Diff line number Diff line change @@ -6,11 +6,15 @@ use std::{env, mem};
6
6
7
7
pub ( crate ) fn parse_args ( ) -> Result < Command , ErrorMessage > {
8
8
let mut args = env:: args ( ) ;
9
- let executable_name = args. next ( ) . ok_or ( "no first argument (executable name)" ) ?;
9
+ let is_cargo_bootimage = {
10
+ let executable_name = args. next ( ) . ok_or ( "no first argument (executable name)" ) ?;
11
+ let file_stem = Path :: new ( & executable_name) . file_stem ( ) . and_then ( |s| s. to_str ( ) ) ;
12
+ file_stem == Some ( "cargo-bootimage" )
13
+ } ;
10
14
let first = args. next ( ) ;
11
15
match first. as_ref ( ) . map ( |s| s. as_str ( ) ) {
12
16
Some ( "build" ) => parse_build_args ( args) ,
13
- Some ( "bootimage" ) if executable_name . ends_with ( "cargo-bootimage" ) => parse_build_args ( args)
17
+ Some ( "bootimage" ) if is_cargo_bootimage => parse_build_args ( args)
14
18
. map ( |cmd| match cmd {
15
19
Command :: BuildHelp => Command :: CargoBootimageHelp ,
16
20
cmd => cmd,
You can’t perform that action at this time.
0 commit comments