]> gitweb.factorcode.org Git - factor.git/blob - extra/mason/docs/docs.factor
Switch to https urls
[factor.git] / extra / mason / docs / docs.factor
1 ! Copyright (C) 2008, 2010 Slava Pestov.
2 ! See https://factorcode.org/license.txt for BSD license.
3 USING: hashtables http.client io.files.temp io.pathnames kernel
4 mason.common mason.config namespaces sequences ;
5 IN: mason.docs
6
7 : make-docs-archive ( -- )
8     [
9         { "tar" "cfz" }
10         "docs.tar.gz" temp-file suffix
11         "docs" suffix
12         short-running-process
13     ] with-cache-directory ;
14
15 : upload-docs-archive ( -- )
16     "docs.tar.gz" temp-file
17     docs-username get
18     docs-host get
19     docs-directory get "docs.tar.gz" append-path
20     upload-safely ;
21
22 : notify-docs ( -- )
23     status-secret get "secret" associate
24     docs-update-url get
25     http-post
26     2drop ;
27
28 : upload-docs ( -- )
29     upload-docs? get [
30         make-docs-archive
31         upload-docs-archive
32         notify-docs
33     ] when ;