Skip to content

Commit 6429b3a

Browse files
committed
test symlink
1 parent be032fa commit 6429b3a

3 files changed

Lines changed: 13 additions & 4 deletions

File tree

acceptance/dlt/install-dlt/output.txt

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -2,10 +2,12 @@
22
>>> errcode [CLI] install-dlt
33
dlt successfully installed to the directory "[BUILD_DIR]"
44
dlt init is not yet implemented. This will initialize a new DLT project in the future.
5+
/ U s e r s / a l y s s a . g o r b a n e v a / r e p o s / c l i / a c c e p t a n c e / b u i l d / d a r w i n _ a r m 6 4 / d a t a b r i c k s
56

67
=== dlt file exists, should not overwrite
78
>>> errcode [CLI] install-dlt -d tmpdir
89
dlt successfully installed to the directory "tmpdir"
10+
[DLT] -> [CLI]
911

1012
=== Executable not called as databricks
1113
>>> errcode ./notdatabricks install-dlt

acceptance/dlt/install-dlt/script

Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,10 +1,21 @@
11
trace errcode $CLI install-dlt
22
"$DLT" init
33

4+
# Add debug line to show CLI value
5+
for ((i=0; i<${#CLI}; i++)); do
6+
echo -n "${CLI:$i:1} "
7+
done
8+
echo
9+
410
title "dlt file exists, should not overwrite"
511
mkdir -p tmpdir
612
touch tmpdir/dlt
713
trace errcode $CLI install-dlt -d tmpdir
14+
if [[ "$OSTYPE" == "msys" || "$OSTYPE" == "cygwin" || "$OSTYPE" == "win32" ]]; then
15+
echo "$DLT -> ${$(realpath "$DLT")%.exe}"
16+
else
17+
echo "$DLT -> $(realpath "$DLT")"
18+
fi
819
rm -rf tmpdir
920

1021
title "Executable not called as databricks"

cmd/dlt/install_dlt.go

Lines changed: 0 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,6 @@ import (
66
"fmt"
77
"os"
88
"path/filepath"
9-
"runtime"
109

1110
"github.com/databricks/cli/libs/cmdio"
1211
"github.com/spf13/cobra"
@@ -27,9 +26,6 @@ func InstallDLTSymlink(directory string) error {
2726
dir = filepath.Dir(path)
2827
}
2928
dltPath := filepath.Join(dir, "dlt")
30-
if runtime.GOOS == "windows" {
31-
dltPath += ".exe"
32-
}
3329

3430
if fi, err := os.Lstat(dltPath); err == nil {
3531
if fi.Mode()&os.ModeSymlink != 0 {

0 commit comments

Comments
 (0)