diff --git a/core/bootstrap/stage1.factor b/core/bootstrap/stage1.factor index f77383cf9d..9bc14a1188 100644 --- a/core/bootstrap/stage1.factor +++ b/core/bootstrap/stage1.factor @@ -3,8 +3,7 @@ USING: arrays assocs continuations debugger generic hashtables init io io.files kernel kernel.private make math memory namespaces parser parser.notes prettyprint sequences splitting -system vectors vocabs vocabs.loader words destructors -io.encodings.utf8 alien.strings ; +system vectors vocabs vocabs.loader words destructors ; QUALIFIED: bootstrap.image.private IN: bootstrap.stage1 @@ -38,9 +37,7 @@ load-help? off [ f parser-quiet? set-global - OBJ-ARGS special-object - [ utf8 alien>string "-resource-path=" ?head [ drop f ] unless ] map-find drop - [ "resource-path" set-global ] when* + init-resource-path "resource:basis/bootstrap/stage2.factor" dup exists? [ diff --git a/core/io/files/files.factor b/core/io/files/files.factor index d1ff0ffc77..02100bae5b 100644 --- a/core/io/files/files.factor +++ b/core/io/files/files.factor @@ -1,8 +1,8 @@ ! Copyright (C) 2004, 2009 Slava Pestov, Daniel Ehrenberg. ! See http://factorcode.org/license.txt for BSD license. USING: kernel kernel.private sequences init namespaces system io -io.backend io.pathnames io.encodings io.files.private -alien.strings ; +io.encodings.utf8 io.backend io.pathnames io.encodings io.files.private +alien.strings splitting ; IN: io.files MIXIN: file-reader @@ -61,9 +61,14 @@ M: object cwd ( -- path ) "." ; PRIVATE> +: init-resource-path ( -- ) + OBJ-ARGS special-object + [ utf8 alien>string "-resource-path=" ?head [ drop f ] unless ] map-find drop + [ image parent-directory ] unless* "resource-path" set-global ; + [ cwd current-directory set-global OBJ-IMAGE special-object alien>native-string cwd prepend-path \ image set-global OBJ-EXECUTABLE special-object alien>native-string cwd prepend-path \ vm set-global - image parent-directory "resource-path" set-global + init-resource-path ] "io.files" add-startup-hook