Skip to content

Commit 2d8da98

Browse files
committed
error order
1 parent 12b1e64 commit 2d8da98

File tree

1 file changed

+4
-4
lines changed

1 file changed

+4
-4
lines changed

cmd/dlt/install_dlt.go

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -47,14 +47,14 @@ func installDLTSymlink(directory string) (string, error) {
4747
}
4848

4949
target, err := filepath.EvalSymlinks(dltPath)
50-
if err == nil && realPath == target {
50+
if err != nil {
51+
return "", err
52+
}
53+
if realPath == target {
5154
cmdio.LogString(context.Background(), fmt.Sprintf("dlt already installed in directory %q", dir))
5255
return dltPath, nil
5356
}
5457
cmdio.LogString(context.Background(), fmt.Sprintf("cannot install dlt CLI: %q already exists", dltPath))
55-
if err != nil {
56-
return "", err
57-
}
5858
return "", errors.New("installation failed")
5959
}
6060

0 commit comments

Comments
 (0)