Skip to content

Commit

Permalink
feat: vscode-distrobox script
Browse files Browse the repository at this point in the history
  • Loading branch information
bketelsen committed Feb 17, 2024
1 parent 614ada6 commit 8040287
Showing 1 changed file with 14 additions and 0 deletions.
14 changes: 14 additions & 0 deletions usr/bin/vscode-distrobox
Original file line number Diff line number Diff line change
@@ -0,0 +1,14 @@
#!/bin/sh

container_name="$(printf '{"containerName":"%s"}' "$1" | od -A n -t x1 | tr -d "\n\t ")"

if flatpak list | grep -q com.visualstudio.code; then
code_command="flatpak run com.visualstudio.code"
elif command -v code 2> /dev/null > /dev/null; then
code_command="code"
else
echo "vscode not installed"
exit 127
fi

${code_command} --folder-uri="vscode-remote://attached-container+${container_name}/${2}"

0 comments on commit 8040287

Please sign in to comment.