File tree 2 files changed +24
-11
lines changed
2 files changed +24
-11
lines changed Original file line number Diff line number Diff line change @@ -19,21 +19,21 @@ mkdir: :make-dir
19
19
20
20
cd : func [
21
21
"Change directory (shell shortcut function)."
22
- 'path [ file! word! path! unset! string! ] "Accepts %file, :variables and just words (as dirs)"
22
+ 'path "Accepts %file, :variables and just words (as dirs)"
23
23
/local val
24
24
] [
25
- switch type? /word :path [
26
- ; unset! [print what-dir] ;-- looks like now need to print it as what-dir is now as a result
27
- file! [change-dir get :path ]
28
- string! [change-dir to-rebol-file path]
25
+ change-dir to-rebol-file switch /default type? /word :path [
26
+ unset! [return what-dir]
27
+ file! [get :path ]
28
+ string! [path]
29
29
word! path! [
30
- change-dir either all [
31
- not error? set /any 'val try [ get : path ]
32
- not function? :val
33
- val
34
- ][ val ][ to-file path ]
30
+ form either all [
31
+ not error? try [ set /any 'val get /any path]
32
+ not any- function? :val
33
+ probe val
34
+ ][ val ][ path ]
35
35
]
36
- ]
36
+ ][ form path ]
37
37
what-dir
38
38
]
39
39
Original file line number Diff line number Diff line change 6
6
Needs: [%../quick-test-module.r3 ]
7
7
]
8
8
9
+ secure [%/ allow]
10
+
9
11
~~~start-file~~~ "FILE tests"
10
12
13
+ ===start-group=== "cd"
14
+ --test-- "cd / cd ~"
15
+ dir: what-dir
16
+ --assert all [
17
+ not error? try [cd / ]
18
+ not error? try [cd ~]
19
+ ]
20
+ change-dir dir
21
+ ===end-group===
22
+
23
+
11
24
===start-group=== "to-local-file"
12
25
13
26
--test-- "issue-2351"
You can’t perform that action at this time.
0 commit comments