diff --git a/_example/build.sh b/_example/build.sh index 6472f4e9..dbb5b3dc 100755 --- a/_example/build.sh +++ b/_example/build.sh @@ -4,12 +4,14 @@ export GO111MODULE=on DIR=$(cd $(dirname $0); pwd) BIN_DIR=$(cd $(dirname $(dirname $0)); pwd)/bin +RESULT=0 + mkdir -p ${BIN_DIR} -go build -o ${BIN_DIR}/exec-command ${DIR}/exec-command/main.go -go build -o ${BIN_DIR}/http-prompt ${DIR}/http-prompt/main.go -go build -o ${BIN_DIR}/live-prefix ${DIR}/live-prefix/main.go -go build -o ${BIN_DIR}/simple-echo ${DIR}/simple-echo/main.go -go build -o ${BIN_DIR}/simple-echo-cjk-cyrillic ${DIR}/simple-echo/cjk-cyrillic/main.go -go build -o ${BIN_DIR}/even-lexer ${DIR}/even-lexer/main.go -go build -o ${BIN_DIR}/bang-executor ${DIR}/bang-executor/main.go -go build -o ${BIN_DIR}/automatic-indenter ${DIR}/automatic-indenter/main.go + +for absolute in ${DIR}/*/; do + relative=${absolute#*_example} + relative=${relative%/} + go build -o ${BIN_DIR}${relative} ${absolute}/main.go || RESULT=1 +done + +exit $RESULT diff --git a/_example/http-prompt/main.go b/_example/http-prompt/main.go index 38d4f743..67fbfb5e 100644 --- a/_example/http-prompt/main.go +++ b/_example/http-prompt/main.go @@ -160,7 +160,6 @@ func executor(in string) { func completer(in prompt.Document) ([]prompt.Suggest, istrings.RuneNumber, istrings.RuneNumber) { endIndex := in.CurrentRuneIndex() - in. w := in.GetWordBeforeCursor() if w == "" { return []prompt.Suggest{}, 0, 0 diff --git a/_example/simple-echo/cjk-cyrillic/main.go b/_example/simple-echo-cjk-cyrillic/main.go similarity index 100% rename from _example/simple-echo/cjk-cyrillic/main.go rename to _example/simple-echo-cjk-cyrillic/main.go