I have Debian 9.5 with xfce and hexo: 3.7.1
The question is about throttle my script called "draft":
s@lokal:~$ sudo cat /usr/local/bin/draft
#!/bin/bash
killall hexo
cd /home/s/Dropbox/blog
hexo clean
pwd
whoami
hexo g --draft
hexo server --draft &
sleep 5
firefox 'http://localhost:4000/'
s@lokal:~$
What I am trying to get across is to run hexo combined command from a desktop entry. The desktop file is this
s@lokal:~$ cat ~/Desktop/blog.desktop; ls -l ~/Desktop/blog.desktop
[Desktop Entry]
Version=1.0
Type=Application
Name=blog
Comment=
Exec=/usr/local/bin/draft
Icon=accessories-text-editor
Path=/home/s/Dropbox/blog/
Terminal=true
StartupNotify=true
-rwxr-xr-x 1 s s 179 Sep 21 18:16 /home/s/Desktop/blog.desktop
I turned the Terminal key to true to watch messages. I am getting this after clicking the desktop entry:
hexo: no process found
/usr/local/bin/draft: line 4: hexo: command not found
/home/s/Dropbox/blog
s
/usr/local/bin/draft: line 9: hexo: command not found
/usr/local/bin/draft: line 10: hexo: command not found
The important part of the messages is that hexo command has been not found. When I run the same command that is attached to exec key, the command is getting actually found.
s@lokal:~$ /usr/local/bin/draft
hexo: no process found
INFO Deleted database.
INFO Deleted public folder.
/home/s/Dropbox/blog
s
INFO Start processing
INFO Files loaded in 599 ms
...
How to fix the desktop entry and why is it so?
update
Adding some data
s@lokal:~/Dropbox/blog$ whereis hexo
hexo: /home/s/.nvm/versions/node/v10.9.0/bin/hexo
s@lokal:~/Dropbox/blog$ $PATH
bash: /home/s/.nvm/versions/node/v10.9.0/bin:/usr/local/bin:/usr/bin:/bin:/usr/local/games:/usr/games: No such file or directory
s@lokal:~/Dropbox/blog$
/usr/local/bin/draft
from your/home/s/Dropbox/blog
directory? Where ishexo
, and is it in PATH?