tapio / live-server

A simple development http server with live reload capability.
http://tapiov.net/live-server/
4.41k stars 484 forks source link

Fix exception when homeDir is not available #375

Open kaykayehnn opened 3 years ago

kaykayehnn commented 3 years ago

I encountered a crash when running live-server from a systemd service, and tracked the issue to loading the config from a user's home folder

https://github.com/tapio/live-server/blob/01cd7f970439d42537bbe13b4885befb816a0446/live-server.js#L17-L23

In systemd services, the HOME variable is not present, which causes the issue.

This PR fixes it by verifying the variable is non-empty before loading a user's config.

belauzas commented 2 years ago

Hi @kaykayehnn I would like to use your PR for dead-server update, because this project seems to be abandoned.