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

correct typos and improve refresh.yml documentation in README #20

Merged
merged 1 commit into from
Feb 5, 2018
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
35 changes: 17 additions & 18 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@

## Rebuild and re-run your Go applications when files change.

This project was inspired by [https://github.com/pilu/fresh](https://github.com/pilu/fresh). Lack of updates and response from the maintainer, but a non-idiomatic codebase, numerous bugs, and lack of detailed reporting made the project a dead end for me to use. Enter `refresh`.
This project was inspired by [https://github.com/pilu/fresh](https://github.com/pilu/fresh). The lack of updates and response from the maintainer, non-idiomatic codebase, numerous bugs, and lack of detailed reporting made the project a dead end for me to use. Enter `refresh`.

This simple command line application will watch your files, trigger a build of your Go binary and restart the application for you.

Expand Down Expand Up @@ -41,8 +41,7 @@ That's it! Now, as you change your code the binary will be re-built and re-start
## HTTP Handler

Refresh is nice enough to ship with an `http.Handler` that you can wrap around your requests. Why would you want to do that?
Well, if there is an error doing a build, the built in `http.Handler` will print the error in your browser in giant text so you'll know that
there was a problem, and where to fix it (hopefully).
Well, if there is an error doing a build, the built in `http.Handler` will print the error in your browser in giant text so you'll know that there was a problem, and where to fix it (hopefully).

```go
...
Expand All @@ -54,30 +53,30 @@ err = http.ListenAndServe(":3000", web.ErrorChecker(m))
## Configuration Settings

```yml
# this is the root of your application relavite to your configuration file:
# The root of your application relative to your configuration file.
app_root: .
# a list of folders you don't want to watch. the folders you ignore, the faster things will be:
# List of folders you don't want to watch. The more folders you ignore, the
# faster things will be.
ignored_folders:
- vendor
- log
- tmp
# a list of file extensions you want to watch for changes:
# List of file extensions you want to watch for changes.
included_extensions:
- .go
# the directory you want to build your binary in:
# The directory you want to build your binary in.
build_path: /tmp
# `fsnotify` can trigger many events at once when you change a file.
# in order to help cut down on the amount of builds that occur, a delay
# is used to let the extra events fly away.
# `fsnotify` can trigger many events at once when you change a file. To minimize
# unnecessary builds, a delay is used to ignore extra events.
build_delay: 200ms
# If you have a specific sub-directory of your project you want to build
build_target_path : ""
# what would you like to call the built binary:
# If you have a specific sub-directory of your project you want to build.
build_target_path : "./cmd/cli"
# What you would like to name the built binary.
binary_name: refresh-build
# any extra commands you want to send to the built binary when it is run:
command_flags: []
# any extra environment variables you want to send to the built binary when it is run:
command_env: []
# do you want to use colors when printing out log messages:
# Extra command line flags you want passed to the built binary when running it.
command_flags: ["--env", "development"]
# Extra environment variables you want defined when the built binary is run.
command_env: ["PORT=1234"]
# If you want colors to be used when printing out log messages.
enable_colors: true
```