Skip to content

Commit

Permalink
add new klone init test & fix klone init error
Browse files Browse the repository at this point in the history
Signed-off-by: Tim Ramlot <42113979+inteon@users.noreply.github.com>
  • Loading branch information
inteon committed Jan 11, 2024
1 parent 24b0607 commit 3807164
Show file tree
Hide file tree
Showing 2 changed files with 13 additions and 1 deletion.
3 changes: 3 additions & 0 deletions pkg/mod/index.go
Original file line number Diff line number Diff line change
Expand Up @@ -73,6 +73,9 @@ func (w WorkDir) editKloneFile(fn func(*kloneFile) error) error {
reader := bufio.NewReader(file)
for {
line, isPrefix, err := reader.ReadLine()
if err == io.EOF {
break
}
if err != nil {
return err
}
Expand Down
11 changes: 10 additions & 1 deletion test.sh
Original file line number Diff line number Diff line change
Expand Up @@ -3,5 +3,14 @@
set -e

go build -o ./dist/klone_test .
klone_binary=$(realpath ./dist/klone_test)

cd ./example && ../dist/klone_test sync
pushd ./example
"$klone_binary" sync
popd

temp_dir=$(mktemp -d)
trap '{ rm -rf "$temp_dir"; echo "> Deleted temp dir $temp_dir"; }' EXIT
pushd "$temp_dir"
"$klone_binary" init
popd

0 comments on commit 3807164

Please sign in to comment.