Home

dotnix @5682408277f23e343166e28aafed1579f884a812 - refs - log -
-
https://git.jolheiser.com/dotnix.git
My nix dotfiles
dotnix / home / nogui / nushell / autoload / tmp.nu
- raw -
 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
12
13
14
module tmp {
  # Create a temporary directory and cd in to it
  export def --env main [
    --description(-d): string # Optional filename description for identifying
  ]: nothing -> nothing {
    mut name = "tmp"
    if $description != null {
      $name = $description
    }
    let t = mktemp --directory $"($name).XXX"
    cd $t
  }
}
use tmp *