From 581af70b18d26a22420739bd1a48118c132500fe Mon Sep 17 00:00:00 2001 From: Marcus Kok Date: Sat, 6 Jul 2024 13:02:55 -0400 Subject: [PATCH 1/3] add dockerfile for development --- Dockerfile | 10 ++++++++++ README.md | 9 +++++++++ 2 files changed, 19 insertions(+) create mode 100644 Dockerfile diff --git a/Dockerfile b/Dockerfile new file mode 100644 index 0000000..9a1e047 --- /dev/null +++ b/Dockerfile @@ -0,0 +1,10 @@ +FROM golang:1.21.12 +RUN apt-get update && \ + apt-get install -y git neovim make +WORKDIR /app +COPY go.mod go.sum / +RUN go mod download +COPY . . +RUN make install +ENTRYPOINT sh + diff --git a/README.md b/README.md index 83ad519..2297e6e 100644 --- a/README.md +++ b/README.md @@ -45,4 +45,13 @@ make sandbox # creates the directory and copies over from ~/.config make clean # removes directory ``` +### Docker +You can also run the docker container that will set up a barebones shell for you +to test dotctl with + +```sh +docker built -d dotctl-dev . +docker run -it dotctl-dev +dotctl status +``` From df412f9434967f5789a8e33d2f404992fd5f17fe Mon Sep 17 00:00:00 2001 From: Marcus Kok Date: Sat, 6 Jul 2024 13:12:13 -0400 Subject: [PATCH 2/3] fix init command --- cmd/init.go | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/cmd/init.go b/cmd/init.go index 3417bf9..7b0a059 100644 --- a/cmd/init.go +++ b/cmd/init.go @@ -67,7 +67,7 @@ func runInitCommand(cmd *cobra.Command, args []string) { log.Fatalf("Unable to create dotfile structure: %s", error.Error(err)) } - _, err = fs.Create(path.Join(DotfilePath, "dotctl/config")) + _, err = fs.Create(path.Join(DotfilePath, "dotctl/config.yml")) if err != nil { panic(fmt.Errorf("Unable to create config file %w", err)) } From 8cff62784dfc26cf8a16c14e70685fce0bcde591 Mon Sep 17 00:00:00 2001 From: Marcus Kok Date: Sat, 6 Jul 2024 20:49:51 -0400 Subject: [PATCH 3/3] update test --- test/init_test.go | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/test/init_test.go b/test/init_test.go index 414e3eb..b7ff657 100644 --- a/test/init_test.go +++ b/test/init_test.go @@ -27,7 +27,7 @@ func TestInitCommand(t *testing.T) { homedir := os.Getenv("HOME") - _, err := afero.ReadFile(fs, filepath.Join(homedir, "dotfiles/dotctl/config")) + _, err := afero.ReadFile(fs, filepath.Join(homedir, "dotfiles/dotctl/config.yml")) if err != nil { t.Error(err.Error()) }