Compare commits
2 Commits
11df0f41fa
...
b3946f9131
Author | SHA1 | Date |
---|---|---|
Zynh0722 | b3946f9131 | |
Zynh0722 | c290afca3a |
24
src/main.rs
24
src/main.rs
|
@ -29,21 +29,21 @@ fn main() -> Result<(), Box<dyn Error>> {
|
|||
let args = Args::parse();
|
||||
|
||||
#[cfg(not(windows))]
|
||||
let boot_folder = args
|
||||
.boot_directory
|
||||
.or_else(|| PathBuf::from_str(BOOT_PATH).ok());
|
||||
|
||||
#[cfg(not(windows))]
|
||||
let boot_folder = unsafe { boot_folder.unwrap_unchecked() };
|
||||
let boot_folder = unsafe {
|
||||
args.boot_directory
|
||||
.or_else(|| PathBuf::from_str(BOOT_PATH).ok())
|
||||
.unwrap_unchecked()
|
||||
};
|
||||
|
||||
#[cfg(windows)]
|
||||
if args.boot_directory.is_none() {
|
||||
eprintln!("You must supply a boot-directory on windows; see --help");
|
||||
exit(1);
|
||||
}
|
||||
let boot_folder = {
|
||||
if args.boot_directory.is_none() {
|
||||
eprintln!("You must supply a boot-directory on windows; see --help");
|
||||
exit(1);
|
||||
}
|
||||
|
||||
#[cfg(windows)]
|
||||
let boot_folder = unsafe { args.boot_directory.unwrap_unchecked() };
|
||||
unsafe { args.boot_directory.unwrap_unchecked() }
|
||||
};
|
||||
|
||||
let grub_env = boot_folder.join("grub/grubenv");
|
||||
|
||||
|
|
Loading…
Reference in New Issue