cameri / nostream

A Nostr Relay written in TypeScript
MIT License
729 stars 188 forks source link

Added directory check to start scripts #252

Closed hellodarkness closed 1 year ago

hellodarkness commented 1 year ago

Added a check to the start scripts to ensure they are being run from the correct directory. Informs user if they're being run from /scripts/ directly and provides a descriptive error message. Fixes #218

Description

If the start script(s) are run from the incorrect directory this currently throws a confusing error message. This fix checks the directory the script is being run from and will alert the user if they're running it from the wrong directory.

Related Issue

218

Motivation and Context

I encountered this problem myself when testing Nostream, and found an issue had already been raised, so I assume others will be making the same mistake and assuming it's "safe" to run ./start from within the scripts folder. Adding a simple message to the script will save people time troubleshooting postgres errors.

How Has This Been Tested?

Tested on Ubuntu Server 22.04

Screenshots (if appropriate):

Types of changes

Checklist:

cameri commented 1 year ago

@hellodarkness thank you!