martinber / noaa-apt

NOAA APT weather satellite image decoder, for Linux, Windows, RPi 2+, OSX and Android+Termux
http://noaa-apt.mbernardi.com.ar
GNU General Public License v3.0
601 stars 55 forks source link

Command line argivements to change map overlay path #37

Closed ghost closed 3 years ago

ghost commented 3 years ago

While running the GNU/Linux armv7 (no-GUI) on a raspberry pi got the following error. image

It seems to use a relative path to refer to the res folder. Adding this to the pwd I was able to fix the issue. If it's possible to have a command-line input to change the res location that would solve it. Are there any workarounds for this?

martinber commented 3 years ago

Hi. This was intended but I'm realizing that maybe it wasn't a good idea because it is confusing, see that this issue is the same as #36.

The program needs some extra files in the res/ folder, right now it expects to find it in in the working directory. Instead of providing the location of the folder with an extra argument I would search for the res/ folder in the location of the executable. See https://doc.rust-lang.org/std/env/fn.current_exe.html . The problem with this is that it can give problems if the user launches the program from a symlink

I don't want to add another argument because I think it would be cumbersome for the user. What do you think?

ghost commented 3 years ago

Similar to issue #36 but this lauches the program without any problem. It terminates in the middle only when used with -m "yes".

I came across this issue trying to schedule a cronjob for decoding. the working directory is set to be the user home in that case.

martinber commented 3 years ago

I'm sorry but I will leave it like it is. So when running the program the working directory should have the res/ folder, which I think it is sort of expected for most software. I think the way is to use something like:

cd ~/Desktop/noaa-apt/ && ./noaa-apt input.wav -o output.png

I updated the instructions in the website