Use temp-file

db4
Slava Pestov 2008-02-26 14:58:16 -06:00
parent da575528cf
commit 5a8ab4f6ee
2 changed files with 6 additions and 4 deletions

View File

@ -6,16 +6,18 @@ bootstrap.image sequences io namespaces io.launcher math ;
: destination "slava@factorcode.org:www/images/latest/" ; : destination "slava@factorcode.org:www/images/latest/" ;
: checksums "checksums.txt" temp-file ;
: boot-image-names images [ boot-image-name ] map ; : boot-image-names images [ boot-image-name ] map ;
: compute-checksums ( -- ) : compute-checksums ( -- )
"checksums.txt" [ checksums [
boot-image-names [ dup write bl file>md5str print ] each boot-image-names [ dup write bl file>md5str print ] each
] with-file-writer ; ] with-file-writer ;
: upload-images ( -- ) : upload-images ( -- )
[ [
"scp" , boot-image-names % "checksums.txt" , destination , "scp" , boot-image-names % checksums , destination ,
] { } make try-process ; ] { } make try-process ;
: new-images ( -- ) : new-images ( -- )

View File

@ -39,12 +39,12 @@ IN: bunny.model
[ normals ] 2keep 3array [ normals ] 2keep 3array
] time ; ] time ;
: model-path "bun_zipper.ply" ; : model-path "bun_zipper.ply" temp-file ;
: model-url "http://factorcode.org/bun_zipper.ply" ; : model-url "http://factorcode.org/bun_zipper.ply" ;
: maybe-download ( -- path ) : maybe-download ( -- path )
model-path resource-path dup exists? [ model-path dup exists? [
"Downloading bunny from " write "Downloading bunny from " write
model-url dup print flush model-url dup print flush
over download-to over download-to