! Copyright (C) 2008 Slava Pestov.
! See http://factorcode.org/license.txt for BSD license.
-USING: checksums checksums.openssl splitting assocs
-kernel io.files bootstrap.image sequences io namespaces make
-io.launcher math io.encodings.ascii io.files.temp io.pathnames
-io.directories ;
+USING: bootstrap.image checksums checksums.openssl io
+io.directories io.encodings.ascii io.files io.files.temp
+io.launcher io.pathnames kernel make namespaces sequences system ;
IN: bootstrap.image.upload
SYMBOL: upload-images-destination
] each
] with-file-writer ;
+! Windows scp doesn't like pathnames with colons, it treats them as hostnames.
+! Workaround for uploading checksums.txt created with temp-file.
+! e.g. C:\Users\\Doug\\AppData\\Local\\Temp/factorcode.org\\Factor/checksums.txt
+! ssh: Could not resolve hostname c: no address associated with name
+
+HOOK: scp-name os ( -- path )
+M: object scp-name "scp" ;
+M: windows scp-name "pscp" ;
+
: upload-images ( -- )
[
- "scp" ,
+ \ scp-name get-global scp-name or ,
boot-image-names %
checksums , destination ,
] { } make try-process ;