Hasty Briefsbeta

Bilingual

Create 'Mess' Directories

a year ago
  • #shell-scripting
  • #productivity
  • #development-tools
  • The article introduces a custom shell function `cdmess` for creating temporary 'mess' directories.
  • The function creates a timestamped directory under `/tmp` or a user-specified temporary directory.
  • It automatically changes into a newly created subdirectory with a random name (XXXX pattern).
  • Additionally, it sets up a Python virtual environment (`venv`) in the new directory and activates it.
  • The author suggests adapting the function for different workflows, such as using `uv` instead of `virtualenv` or creating a `package.json`.
  • The `cdmess` function is useful for quickly testing scripts, dependencies, or environments without affecting ongoing project directories.
  • It helps in faster iteration by avoiding full builds or server restarts in main project directories.