Adds support for repo hosted images and removes the need to pass an image path
This commit is contained in:
parent
63fe1bf7e2
commit
6812561666
Binary file not shown.
After Width: | Height: | Size: 13 KiB |
22
soloweb
22
soloweb
|
@ -499,21 +499,17 @@
|
||||||
(define count-dirs (lambda (p)
|
(define count-dirs (lambda (p)
|
||||||
(length (filter (lambda (c) (equal? c "/")) (string->list p)))))
|
(length (filter (lambda (c) (equal? c "/")) (string->list p)))))
|
||||||
|
|
||||||
(define init (lambda (solo-path image)
|
(define init (lambda (solo-path)
|
||||||
(is-solo? solo-path)
|
(is-solo? solo-path)
|
||||||
(if (equal? (path-dir solo-path) (pwd))
|
(if (equal? (path-dir solo-path) (pwd))
|
||||||
(error-exit "soloweb error: the site cannot be generated in the same directory as the repository, as the folders will share a name"))
|
(error-exit "soloweb error: the site cannot be generated in the same directory as the repository, as the folders will share a name"))
|
||||||
(set! repo-dir solo-path)
|
(set! repo-dir solo-path)
|
||||||
(set! c (conf solo-path))
|
(set! c (conf solo-path))
|
||||||
(set! repo-name (path-base solo-path))
|
(set! repo-name (path-base solo-path))
|
||||||
(if (and image (path-exists? image))
|
|
||||||
(begin
|
|
||||||
(set! logo-file (append "logo" (path-extension image)))
|
|
||||||
(cp image logo-file))
|
|
||||||
(display-lines "No logo file was found, skipping"))
|
|
||||||
|
|
||||||
(define new-base (path-join (pwd) repo-name))
|
(define new-base (path-join (pwd) repo-name))
|
||||||
(mkdir new-base 0755)
|
(mkdir new-base 0755)
|
||||||
|
(chdir new-base)
|
||||||
|
|
||||||
(display-lines "soloweb: archiving and compressing")
|
(display-lines "soloweb: archiving and compressing")
|
||||||
(chdir (path-dir repo-dir))
|
(chdir (path-dir repo-dir))
|
||||||
|
@ -523,6 +519,14 @@
|
||||||
(chdir new-base)
|
(chdir new-base)
|
||||||
(mkdir "files" 0755)
|
(mkdir "files" 0755)
|
||||||
|
|
||||||
|
(define logo-list (path-glob (path-join repo-dir ".solo" "logo.*")))
|
||||||
|
(if (not (null? logo-list))
|
||||||
|
(begin
|
||||||
|
(set! logo-file (path-base (car logo-list)))
|
||||||
|
(cp (car logo-list) logo-file))
|
||||||
|
(display-lines "No logo file was found, skipping"))
|
||||||
|
|
||||||
|
|
||||||
(display-lines "soloweb: generating html")
|
(display-lines "soloweb: generating html")
|
||||||
(make-history-html)
|
(make-history-html)
|
||||||
(make-files-html)
|
(make-files-html)
|
||||||
|
@ -533,11 +537,9 @@
|
||||||
(set! sys-args (cdr sys-args))
|
(set! sys-args (cdr sys-args))
|
||||||
(case (length sys-args)
|
(case (length sys-args)
|
||||||
(0 (error-exit "No solo repo path was given"))
|
(0 (error-exit "No solo repo path was given"))
|
||||||
(1 (init (path-abs (car sys-args)) #f))
|
(1 (init (path-abs (car sys-args))))
|
||||||
(else
|
(else
|
||||||
(init
|
(error-exit "Too many arguments. Expected only a path to a solo repo.")))))
|
||||||
(path-abs (car sys-args))
|
|
||||||
(path-abs (car (cdr sys-args))))))))
|
|
||||||
(main)
|
(main)
|
||||||
|
|
||||||
; vim: ts=2 sw=2 expandtab ft=slope
|
; vim: ts=2 sw=2 expandtab ft=slope
|
||||||
|
|
Loading…
Reference in New Issue