Skip to content

Commit

Permalink
FEAT/FIX: improved CD shortcut command
Browse files Browse the repository at this point in the history
  • Loading branch information
Oldes committed Jun 8, 2018
1 parent 71a1fae commit cfe4555
Showing 1 changed file with 10 additions and 3 deletions.
13 changes: 10 additions & 3 deletions src/mezz/mezz-shell.r
Original file line number Diff line number Diff line change
Expand Up @@ -19,13 +19,20 @@ mkdir: :make-dir
cd: func [
"Change directory (shell shortcut function)."
'path [file! word! path! unset! string!] "Accepts %file, :variables and just words (as dirs)"
/local val
][
switch type?/word :path [
unset! [print what-dir]
file! [change-dir path]
unset! [print what-dir]
file! [change-dir get :path]
string! [change-dir to-rebol-file path]
word! path! [change-dir to-file path]
word! path! [
change-dir either all [
not error? set/any 'val try [get :path]
val
][ val ][ to-file path ]
]
]
what-dir
]

more: func [
Expand Down

0 comments on commit cfe4555

Please sign in to comment.