feat(functions): Add a function to start and log into the devenv container

This commit is contained in:
2025-09-28 17:55:51 +02:00
parent 1a003a9d72
commit 526e6cae26

18
functions.d/devenv Normal file
View File

@@ -0,0 +1,18 @@
#!/bin/bash
function devenv() {
local status
# Get LXC container status
status=$(lxc info devenv | yq .Status)
# Start container if not running
if [ "${status}" != "RUNNING" ]; then lxc start devenv; fi
# Rename tmux window if inside tmux
if [ -n "$TMUX" ]; then tmux rename-window "devenv"; fi
# Login as user xavier
lxc exec devenv -- login -f xavier
}