mirror of
https://github.com/Xe/xn--ts9h
synced 2024-11-14 13:17:06 +00:00
fix program filename check
This commit is contained in:
parent
8f1dda8e53
commit
a05ad4c25f
1 changed files with 6 additions and 1 deletions
|
@ -4,7 +4,12 @@ use std::{env, ffi::OsString, io, os::unix::process::CommandExt, process::Comman
|
||||||
use syslog::{unix, Facility::LOG_AUTH, Formatter3164};
|
use syslog::{unix, Facility::LOG_AUTH, Formatter3164};
|
||||||
|
|
||||||
fn main() -> io::Result<()> {
|
fn main() -> io::Result<()> {
|
||||||
if env::args_os().nth(0).unwrap() != "🥺" {
|
let progName = std::env::current_exe()
|
||||||
|
.ok()
|
||||||
|
.and_then(|pb| pb.file_name().map(|s| s.to_os_string()))
|
||||||
|
.and_then(|s| s.into_string().ok());
|
||||||
|
|
||||||
|
if progName.unwrap() != "🥺" {
|
||||||
eprintln!(
|
eprintln!(
|
||||||
"error: called 🥺 with name {:?}",
|
"error: called 🥺 with name {:?}",
|
||||||
env::args_os().nth(0).unwrap()
|
env::args_os().nth(0).unwrap()
|
||||||
|
|
Loading…
Reference in a new issue