@@ -19,7 +19,7 @@ REBOL [
19
19
20
20
start : func [
21
21
"INIT: Completes the boot sequence. Loads extras, handles args, security, scripts."
22
- /local file tmp script-path script-args code ver
22
+ /local tmp script-path script-args code ver
23
23
] bind [ ; context is: system/options (must use full path sys/log/.. as there is options/log too!)
24
24
25
25
;** Note ** We need to make this work for lower boot levels too!
@@ -55,36 +55,18 @@ start: func [
55
55
if any [do-arg script] [quiet: true]
56
56
57
57
;-- Set up option/paths for /path, /boot, /home, and script path (for SECURE):
58
- sys/log/more 'REBOL ["Initial path:" path]
59
- sys/log/more 'REBOL ["Initial boot:" boot]
58
+ ; sys/log/more 'REBOL ["Initial path:" path] ; current dir
59
+ ; sys/log/more 'REBOL ["Initial boot:" boot] ; executable
60
60
;sys/log/more 'REBOL ["Initial home:" home] ; always NONE at this state!
61
61
;- 1. /path - that is current directory (resolved from C as a part of args processing)
62
- ; nothing to do here
63
- ;- 2. /boot - path to executable (must handle relative paths)
64
- boot: any [to-real-file boot boot]
65
- unless exists? boot [
66
- ; the executable must be inside one of the system PATH directories...
67
- file: second split-path boot
68
- foreach dir parse any [get-env "PATH" "" ] pick ";:" system/platform = 'Windows [
69
- dir: dirize as file! dir
70
- if exists? tmp: dir/: file [
71
- boot: tmp
72
- break
73
- ]
74
- ]
75
- if boot <> tmp [
76
- sys/log/error 'REBOL "Path to executable was not resolved!"
77
- boot: none
78
- ]
79
- ]
62
+ ;- 2. /boot - path to executable (resolved from C as well)
80
63
;- 3. /home - preferably one of environment variables or current starting dir
81
64
home: dirize to-rebol-file any [
82
65
get-env "REBOL_HOME" ; User can set this environment variable with own location
83
66
get-env "HOME" ; Default user's home directory on Linux
84
67
get-env "USERPROFILE" ; Default user's home directory on Windows
85
68
path ; Directory where we started (O: not sure with this one)
86
69
]
87
-
88
70
89
71
if file? script [ ; Get the path (needed for SECURE setup)
90
72
script: any [to-real-file script script]
0 commit comments