0

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$ 
  • Does it make a difference if you manually run /usr/local/bin/draft from your /home/s/Dropbox/blog directory? Where is hexo, and is it in PATH? – Kevin Kruse Sep 21 '18 at 17:33
  • @KevinKruse Thank you for the visit. I updated the question after your questions. They actually should be considered. – trzczy Sep 22 '18 at 1:39
1

Purged Nodejs and Hexo installation. Extracted node-v10.11.0-linux-x64 to /opt/. Installed Hexo. Typed out in terminal

sudo ln -s /opt/node-v10.11.0-linux-x64/bin/node /usr/bin/node
sudo ln -s /opt/node-v10.11.0-linux-x64/bin/npm /usr/bin/npm
sudo ln -s /opt/node-v10.11.0-linux-x64/bin/npx /usr/bin/npx
sudo ln -s /opt/node-v10.11.0-linux-x64/bin/hexo /usr/bin/hexo

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.