From d4e56002e8599b48f75967c9372e3c2d2460044b Mon Sep 17 00:00:00 2001 From: Ilya Sevostyanov <1166655+i-sevostyanov@users.noreply.github.com> Date: Thu, 13 Jun 2024 21:38:06 +0400 Subject: [PATCH] chore: fix typos --- .codecov.yml | 2 +- Dockerfile | 6 +++--- README.md | 2 +- internal/shell/shell.go | 8 ++++---- 4 files changed, 9 insertions(+), 9 deletions(-) diff --git a/.codecov.yml b/.codecov.yml index 518f54a..9264971 100644 --- a/.codecov.yml +++ b/.codecov.yml @@ -24,5 +24,5 @@ coverage: # https://docs.codecov.com/docs/ignoring-paths ignore: - cmd - - internal/repl + - internal/shell - "**/*_mock*.go" diff --git a/Dockerfile b/Dockerfile index 45cffe1..1af237d 100644 --- a/Dockerfile +++ b/Dockerfile @@ -14,12 +14,12 @@ RUN set -eux; apk update; apk add --no-cache git openssh # Install dependencies RUN go mod download RUN go mod verify -RUN cd $GO_WORKDIR/cmd/repl && go install +RUN cd $GO_WORKDIR/cmd/shell && go install # Put everything together in a clean image FROM scratch # Copy binary into PATH -COPY --from=build-env /go/bin/repl /usr/local/bin/repl +COPY --from=build-env /go/bin/shell /usr/local/bin/shell -ENTRYPOINT ["repl"] +CMD ["shell"] diff --git a/README.md b/README.md index 465bcc0..dabc645 100644 --- a/README.md +++ b/README.md @@ -29,7 +29,7 @@ The NanoDB command line provides an SQL shell that can be used to select, insert ```shell git clone https://github.com/i-sevostyanov/NanoDB.git cd NanoDB -go run ./cmd/repl/main.go +go run ./cmd/shell/main.go #> \import /testdata/demo.sql ``` diff --git a/internal/shell/shell.go b/internal/shell/shell.go index 935a122..fe399c9 100644 --- a/internal/shell/shell.go +++ b/internal/shell/shell.go @@ -63,10 +63,10 @@ func (s *Shell) Run(ctx context.Context) { continue } - if repl, err := s.exec(input); err != nil { + if reply, err := s.exec(input); err != nil { s.write(err.Error() + "\n") - } else if repl != "" { - s.write(repl) + } else if reply != "" { + s.write(reply) } } }() @@ -249,7 +249,7 @@ func (s *Shell) importFile(params []string) (string, error) { } func (s *Shell) showHelp() string { - help := `repl is the NanoDB interactive terminal. + help := `shell is the NanoDB interactive terminal. Commands: \use Use specified database