Created
May 15, 2026 19:09
-
-
Save sploders101/fd095e1db97ea8c77ce436f49679e5dc to your computer and use it in GitHub Desktop.
Devtools wrapper
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| #!/bin/bash | |
| function show_help() { | |
| echo "Usage: $0 [OPTIONS] [DIRECTORY]" | |
| echo "" | |
| echo "Options:" | |
| echo " --no-net Disable network access" | |
| echo " -h, --help Show this help message" | |
| echo "" | |
| echo "Positional:" | |
| echo " DIRECTORY Directory to mount (default: current directory)" | |
| } | |
| NETWORK="" | |
| NO_NET=false | |
| MOUNT_DIR="" | |
| while [[ $# -gt 0 ]]; do | |
| if [[ "$1" == "--" ]]; then | |
| shift | |
| break | |
| fi | |
| case "$1" in | |
| --no-net) | |
| NO_NET=true | |
| shift | |
| ;; | |
| -h|--help) | |
| show_help | |
| exit 0 | |
| ;; | |
| *) | |
| MOUNT_DIR="$1" | |
| shift | |
| ;; | |
| esac | |
| done | |
| MOUNT_DIR="$(realpath ${MOUNT_DIR:-.})" | |
| if [ "$NO_NET" = true ]; then | |
| NETWORK="--network=none" | |
| else | |
| NETWORK="--network=host" | |
| fi | |
| podman run --rm -it \ | |
| -v "$MOUNT_DIR":$MOUNT_DIR \ | |
| -w "$MOUNT_DIR" \ | |
| -v "$SSH_AUTH_SOCK:$SSH_AUTH_SOCK" \ | |
| -v "$HOME/Sync/.config:/home/dev/Sync/.config:ro" \ | |
| -v "$HOME/.config/helix:/home/dev/.config/helix:ro" \ | |
| -v "$HOME/.config/opencode/opencode.json:/home/dev/.config/opencode/opencode.json:ro" \ | |
| -v "$HOME/.gitconfig:/home/dev/.gitconfig:ro" \ | |
| --userns=keep-id \ | |
| $NETWORK \ | |
| -e TERM="$TERM" \ | |
| -e COLORTERM="$COLORTERM" \ | |
| -e SSH_AUTH_SOCK="$SSH_AUTH_SOCK" \ | |
| devtools \ | |
| bash |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment