config [
bootstrap-profile :> profile
vocab "vocab-manifest-" prepend temp-file :> manifest-file
- image vocab manifest-file profile deploy-command-line :> flags
+ image-path vocab manifest-file profile deploy-command-line :> flags
profile ?make-staging-image
vm-path flags run-factor
manifest-file parse-vocab-manifest-file
] with-variables ;
-:: make-deploy-image-executable ( vm-path image vocab config -- manifest )
- vm-path image vocab config make-deploy-image
- image vm-path embed-image ;
+:: make-deploy-image-executable ( vm image vocab config -- manifest )
+ vm image vocab config make-deploy-image
+ image vm embed-image ;
HOOK: deploy* os ( vocab -- )
:: embed-image ( image executable -- )
executable binary <file-appender> [| out |
out stream-tell :> offset
- image binary <file-reader> [| in |
+ image-path binary <file-reader> [| in |
in out stream-copy*
] with-disposal
image-magic uintptr_t <ref> out stream-write
output-stream
error-stream
vm-path
- image
+ image-path
current-directory
} %
USING: accessors io.streams.c math.parser system ;
IN: tools.deploy.test.18
-: main ( -- ) image show ;
+: main ( -- ) image-path show ;
MAIN: main
open-panel [ listener-run-files ] when* ;
: menu-save-image ( -- )
- image save-panel [ save-image ] when* ;
+ image-path save-panel [ save-image ] when* ;
! Handle Open events from the Finder
CLASS: FactorWorkspaceApplicationDelegate < FactorApplicationDelegate
run-file
] [
"Cannot find " write write "." print
- "Please move " write image write " into the same directory as the Factor sources," print
+ "Please move " write image-path write " into the same directory as the Factor sources," print
"and try again." print
1 (exit)
] if
] unit-test
{ } [
- image binary [
+ image-path binary [
10 [ 65536 read drop ] times
] with-file-reader
] unit-test
! Test EOF behavior
{ 10 } [
- image binary [
+ image-path binary [
0 read drop
10 read length
] with-file-reader
: 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 ;
+ [ image-path 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-IMAGE special-object alien>native-string cwd prepend-path \ image-path set-global
OBJ-EXECUTABLE special-object alien>native-string cwd prepend-path \ vm-path set-global
init-resource-path
] "io.files" add-startup-hook
} ;
ARTICLE: "io.pathnames.special" "Special pathnames"
-"If a pathname begins with " { $snippet "resource:" } ", it is resolved relative to the directory containing the current image (see " { $link image } ")."
+"If a pathname begins with " { $snippet "resource:" } ", it is resolved relative to the directory containing the current image (see " { $link image-path } ")."
$nl
"If a pathname begins with " { $snippet "vocab:" } ", then it will be searched for in all current vocabulary roots (see " { $link "add-vocab-roots" } ")."
$nl
: save-image-and-exit ( path -- )
normalize-path saving-path t (save-image) ;
-: save ( -- ) image save-image ;
+: save ( -- ) image-path save-image ;
"Getting the path to the Factor VM and image:"
{ $subsections
vm-path
- image
+ image-path
}
"Getting a monotonically increasing nanosecond count:"
{ $subsections nano-count }
{ $description "Outputs a monotonically increasing count of nanoseconds elapsed since an arbitrary starting time. The difference of two calls to this word allows timing. This word is unaffected by system clock changes." }
{ $notes "This is a low-level word. The " { $vocab-link "tools.time" } " vocabulary defines words to time code execution time." } ;
-HELP: image
+HELP: image-path
{ $values { "path" "a pathname string" } }
{ $description "Outputs the pathname of the currently running Factor image." } ;
PRIVATE>
-: image ( -- path ) \ image get-global ;
+: image-path ( -- path ) \ image-path get-global ;
: vm-path ( -- path ) \ vm-path get-global ;
IN: contributors
: changelog ( -- authors )
- image parent-directory [
+ image-path parent-directory [
"git log --no-merges --pretty=format:%an"
ascii [ lines ] with-process-reader
] with-directory ;
! !!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!
: git-pull-master ( -- )
- image parent-directory
+ image-path parent-directory
[
{ "git" "pull" "git://factorcode.org/git/factor.git" "master" }
run-command
! !!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!
: rebuild-latest ( -- )
- image parent-directory
+ image-path parent-directory
[
backup
download-latest-image
! !!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!
: update-latest ( -- )
- image parent-directory
+ image-path parent-directory
[
git-id
git-pull-master
! !!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!
: git-pull-clean ( -- )
- image parent-directory [
+ image-path parent-directory [
{ "git" "pull" "git://factorcode.org/git/factor.git" branch-name }
run-command
] with-directory ;
! !!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!
: rebuild ( -- )
- image parent-directory [
+ image-path parent-directory [
download-clean-image
make-clean
make
! !!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!
: update ( -- )
- image parent-directory [
+ image-path parent-directory [
git-id
git-pull-clean
git-id