! Copyright (C) 2008 Slava Pestov.
! Copyright (C) 2015 Doug Coleman.
! See https://factorcode.org/license.txt for BSD license.
-USING: bootstrap.image checksums checksums.openssl io
+USING: arrays bootstrap.image checksums checksums.openssl io
io.directories io.encodings.ascii io.encodings.utf8 io.files
io.files.temp io.files.unique io.launcher io.pathnames kernel
make math.parser namespaces sequences splitting system unicode ;
[ unicode:blank? ] trim-tail
] with-directory ;
-: git-branch-destination ( -- dest )
+: git-branch-destinations ( -- dests )
build-images-destination get
"sheeple@downloads.factorcode.org:downloads.factorcode.org/images/"
or
- factor-git-branch "/" 3append ;
+ factor-git-branch dup { "master" "main" } member?
+ [ drop { "master" "main" } ] [ 1array ] if
+ [ "/" 3append ] with map ;
: checksums-path ( -- temp ) "checksums.txt" temp-file ;
: scp-name ( -- path ) "scp" ;
: upload-images ( -- )
- [
- \ scp-name get-global scp-name or ,
- "-4" , ! force ipv4
- boot-image-names %
- checksums-path ,
- git-branch-destination [ print flush ] [ , ] bi
- ] { } make try-process ;
+ git-branch-destinations [
+ [
+ [
+ \ scp-name get-global scp-name or ,
+ "-4" , ! force ipv4
+ boot-image-names %
+ checksums-path ,
+ ] { } make
+ ] dip suffix try-process
+ ] each ;
: append-build ( path -- path' )
vm-git-id "." glue ;