[Export, Drone] Update export.el and .drone.yml
All checks were successful
continuous-integration/drone/push Build is passing

export.el:
Now export all org files in specified directories
Code a bit cleaner

.drone.yml:
Send all the content of org/config to the remote server
This commit is contained in:
Lucien Cartier-Tilet 2021-11-22 17:17:06 +01:00
parent d776dae8fb
commit a04de69b10
Signed by: phundrak
GPG Key ID: BD7789E705CB8DCA
2 changed files with 21 additions and 14 deletions

View File

@ -22,8 +22,7 @@ steps:
target:
from_secret: ssh_target
source:
- !org/config/LICENSE.md
- org/config/*.html
- org/config/*
strip_components: 2
username:
from_secret: ssh_username

View File

@ -1,22 +1,30 @@
#!/usr/bin/env -S emacs -Q --script
(require 'package)
(require 'org)
(require 'ox-html)
(setq package-archives '(("melpa" . "https://melpa.org/packages/")))
(package-initialize)
(package-refresh-contents)
(package-install 'htmlize)
(setq org-confirm-babel-evaluate nil
org-html-validation-link nil)
(let ((files (mapcar #'expand-file-name
(file-expand-wildcards "org/config/*.org"))))
(mapc (lambda (file)
(message (format "==========\nExporting %S\n==========" file))
(defun export-and-clean (directory)
(progn (mapc (lambda (file)
(progn (message (concat "====================\n"
"Exporting "
file
"\n"
"====================\n"))
(with-current-buffer (find-file file)
(org-html-export-to-html)))
files))
(let* ((files (mapcar #'expand-file-name
(file-expand-wildcards "org/config/*.html~"))))
(org-html-export-to-html))))
(directory-files directory t (regexp-quote ".org")))
(mapc (lambda (file)
(delete-file file))
files))
(delete-file file nil))
(directory-files directory t (regexp-quote "html~")))))
(dolist (dir '("org/config/" "org/config/Deprecated/" "org/config/WIP"))
(export-and-clean dir))