Skip to content

Commit 976ae02

Browse files
Update src/plugins/terminal/scripts/init-alpine.sh
Co-authored-by: gemini-code-assist[bot] <176961590+gemini-code-assist[bot]@users.noreply.github.com>
1 parent 109ad45 commit 976ae02

File tree

1 file changed

+9
-4
lines changed

1 file changed

+9
-4
lines changed

src/plugins/terminal/scripts/init-alpine.sh

Lines changed: 9 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -87,11 +87,16 @@ usage() {
8787
8888
get_abs_path() {
8989
local path="$1"
90-
if [[ "$path" == /* ]]; then
91-
realpath "$path" 2>/dev/null || echo "$path"
92-
else
93-
realpath "$path" 2>/dev/null || echo "$(pwd)/$path"
90+
local abs_path
91+
abs_path=$(realpath -- "$path" 2>/dev/null)
92+
if [[ $? -ne 0 ]]; then
93+
if [[ "$path" == /* ]]; then
94+
abs_path="$path"
95+
else
96+
abs_path="$PWD/$path"
97+
fi
9498
fi
99+
echo "$abs_path"
95100
}
96101
97102
open_in_acode() {

0 commit comments

Comments
 (0)