Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add script for running hot reloading server #169

Merged
merged 1 commit into from Aug 19, 2022
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Jump to
Jump to file
Failed to load files.
Diff view
Diff view
26 changes: 26 additions & 0 deletions dev-scripts/serve
@@ -0,0 +1,26 @@
#!/bin/bash

# Exit on first failing command.
set -e

# Exit on unset variable.
set -u

# Echo commands
set -x

# Change directory to repository root.
SCRIPT_DIR="$( cd "$( dirname "${BASH_SOURCE[0]}" )" &> /dev/null && pwd )"
readonly SCRIPT_DIR
cd "${SCRIPT_DIR}/.."

# Install modd if it's not present.
MODD_PATH="$(go env GOPATH)/bin/modd"
readonly MODD_PATH
if [[ ! -f "${MODD_PATH}" ]]; then
go get github.com/cortesi/modd/cmd/modd
go install github.com/cortesi/modd/cmd/modd
fi

# Run modd for hot reloading.
"${MODD_PATH}"
3 changes: 3 additions & 0 deletions modd.conf
@@ -0,0 +1,3 @@
**/*.go !**/*_test.go {
daemon: go run cmd/logpaste/main.go
}