File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree Original file line number Diff line number Diff line change @@ -259,6 +259,14 @@ dc() {
259259 cd " ${PWD%/ $1 /* } /$1 /" 2> /dev/null || echo " Directory not found: $1 "
260260}
261261
262+ # cd into the latest directory in the current dir
263+ cdn () {
264+ dir=" $( fd --type d --max-depth 1 --exec stat -c ' %Y %n' {} |
265+ sort -n | tail -1 | cut -d' ' -f2) "
266+ echo " $dir "
267+ cd " $dir " || return 1
268+ }
269+
262270# Create a tmp dir, unzip file into it, cd into it
263271showme () {
264272 [ -z " $1 " ] && echo " Pass file to show" && return 1
@@ -278,14 +286,14 @@ showme() {
278286}
279287
280288# Need to be a function to capture exit code
281- boop () {
282- local last=" $? "
283- if [[ " $last " == ' 0' ]]; then
284- ,make-noise notify
285- else
286- ,make-noise error
287- fi
288- $( exit " $last " )
289+ boop () {
290+ local last=" $? "
291+ if [[ " $last " == ' 0' ]]; then
292+ ,make-noise notify
293+ else
294+ ,make-noise error
295+ fi
296+ $( exit " $last " )
289297}
290298
291299# Small functions (these are ideally aliases, but need args)
@@ -296,4 +304,4 @@ eout() {
296304
297305eoh () {
298306 esa --show-output " ${1:- 1} " | ,markdown-to-html
299- }
307+ }
You can’t perform that action at this time.
0 commit comments