eepykate / fet.sh

🐢 a fetch written in posix shell without any external commands (sponsored by https://git.io/kiwmi)
https://github.com/buffet/kiwmi
ISC License
366 stars 22 forks source link

Add macOS support #30

Closed sech1p closed 3 years ago

sech1p commented 3 years ago

should works

proof: Screenshot 2021-05-30 at 20 36 03

eepykate commented 3 years ago

Hey Tsuki, thanks for the PR!

I see that this PR is using some external commands (sysctl, awk, cut, date, uname, port, hostname), but sadly the whole reason this project was made was a challenge to see if I could make a fetch without external commands.

Nice work, but (in its current state) this PR doesn't seem to fit the goal of the project, sorry! ​ It would be terrific if you could find a way around those commands, though. ​ But I'm not sure if macOS has that info in files anywhere.

sech1p commented 3 years ago

Hey Tsuki, thanks for the PR!

I see that this PR is using some external commands (sysctl, awk, cut, date, uname, port, hostname), but sadly the whole reason this project was made was a challenge to see if I could make a fetch without external commands.

Nice work, but (in its current state) this PR doesn't seem to fit the goal of the project, sorry! ​ It would be terrific if you could find a way around those commands, though. ​ But I'm not sure if macOS has that info in files anywhere.

alright, my mistake, i will fix it tomorrow

I think that e.g. hostname can be replaced by $HOSTNAME variable (same as awk and cut) but /proc-related things rather not, because sysctl is the only one method to communicate with Mach kernel

eepykate commented 3 years ago

alright, my mistake, i will fix it tomorrow 👍

I think that e.g. hostname can be replaced by $HOSTNAME variable Sadly not, as that's a bashism.

  • bash uses HOSTNAME
  • zsh uses HOST
  • dash/mksh/mrsh/oksh have no alternative

sysctl is the only one method to communicate with [the Mac] kernel Ah, that's a shame. I think I ran into this issue when I was doing the initial macos "support", but I don't own a mac so I didn't really look that hard.

sech1p commented 3 years ago

Sadly not, as that's a bashism. - bash uses HOSTNAME - zsh uses HOST - dash/mksh/mrsh/oksh have no alternative

sh on Mac works with HOSTNAME env

eepykate commented 3 years ago

image

eepykate commented 3 years ago

no progress in roughly a month; closing

elkowar commented 3 years ago

F