Browse Source

added cdtmp alias

Fabian Peter Hammerle 5 years ago
parent
commit
f29cddc7e4
1 changed files with 2 additions and 0 deletions
  1. 2 0
      rc.xsh

+ 2 - 0
rc.xsh

@@ -7,6 +7,7 @@ import shutil
 import stat
 import subprocess
 import sys
+import tempfile
 
 TERMUX=shutil.which('termux-info') is not None
 
@@ -166,6 +167,7 @@ def yaml_write(path, data):
     with open(path, 'w') as f:
         f.write(yaml.dump(data, default_flow_style=False))
 
+aliases['cdtmp'] = lambda: os.chdir(tempfile.mkdtemp())
 try:
     docker_gid = grp.getgrnam('docker').gr_gid
 except KeyError: