mcd refactor

This commit is contained in:
thek4n 2025-01-23 21:26:00 +03:00
parent 43973a1d68
commit 667badeb9c
2 changed files with 7 additions and 3 deletions

View File

@ -35,4 +35,4 @@ columns = 150
lines = 42 lines = 42
[general] [general]
live_config_reload = true live_config_reload = true

View File

@ -42,11 +42,15 @@ va() {
} }
mcd() { mcd() {
local dir
if [ -z "${1}" ]; then if [ -z "${1}" ]; then
cd "$(mktemp -td "${USER:-user}.XXXX")" dir="$(mktemp -ut "${USER:-user}.XXXX")"
else else
mkdir -p "${1}" && cd "${1}" dir="${1}"
fi fi
mkdir -p "${dir}" && cd "${dir}"
} }
open() { open() {