From 1e29f9a400e8be4cfe531eda0c850a00b6a23ae8 Mon Sep 17 00:00:00 2001 From: Lim Yue Chuan Date: Mon, 5 Feb 2018 07:11:17 +0800 Subject: [PATCH] correct typos and improve refresh.yml documentation in README --- README.md | 35 +++++++++++++++++------------------ 1 file changed, 17 insertions(+), 18 deletions(-) diff --git a/README.md b/README.md index af84b9f..b3a52ba 100644 --- a/README.md +++ b/README.md @@ -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. @@ -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 ... @@ -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 ```