Selaa lähdekoodia

Add basic dump_db.sh. We fight for the user! (or hacker, sysadmin, whatever)

Brit Butler 11 vuotta sitten
vanhempi
commit
1d18a32454
2 muutettua tiedostoa jossa 26 lisäystä ja 0 poistoa
  1. 17 0
      examples/dump-db.lisp
  2. 9 0
      examples/dump_db.sh

+ 17 - 0
examples/dump-db.lisp

@@ -0,0 +1,17 @@
1
+(eval-when (:compile-toplevel :load-toplevel :execute)
2
+  (ql:quickload '(coleslaw cl-store)))
3
+
4
+(in-package :coleslaw)
5
+
6
+(defun main ()
7
+  (let ((db-file (rel-path (user-homedir-pathname) ".coleslaw.db")))
8
+    (format t "~%~%Coleslaw loaded. Attempting to load config file.~%")
9
+    (load-config "")
10
+    (format t "~%Config loaded. Attempting to load blog content.~%")
11
+    (load-content)
12
+    (format t "~%Content loaded. Attempting to dump content database.~%")
13
+    (cl-store:store *site* db-file)
14
+    (format t "~%Content database saved to ~s!~%~%" (namestring db-file))))
15
+
16
+(main)
17
+(exit)

+ 9 - 0
examples/dump_db.sh

@@ -0,0 +1,9 @@
1
+#!/bin/sh
2
+
3
+LISP=sbcl
4
+
5
+## Disclaimer:
6
+## I have not tested that all lisps take the "--load" flag.
7
+## This code might spontaneously combust your whole everything.
8
+
9
+$LISP --load "dump-db.lisp"