<commit_before>(in-package :cl-user)

(print ">>> Building system....")
(require 'asdf)
(asdf:disable-output-translations)
(require-quicklisp)
(let* ((this-file (load-time-value (or *load-truename* #.*compile-file-pathname*)))
       (this-file-dir (make-pathname :directory (pathname-directory this-file))))
  (push this-file-dir asdf:*central-registry*))
(ql:quickload :test-grid-server)

(print ">>> saving image tg-server...")
(sb-ext:save-lisp-and-die "tg-server"
                          :toplevel (lambda ()
                                      (tg-server:start :port (parse-integer (asdf::getenv "PORT"))
                                                       :smtp-password (asdf::getenv "SMTP_PASSWORD"))
                                      (loop (sleep 1000)))
                          :executable t
                          :purify t)

(print ">>> Done building system")

;; 3<commit_msg>heroky deployment: specify lisp image file name toghether with the directory<commit_after>(in-package :cl-user)

(print ">>> Building system....")
(require 'asdf)
(asdf:disable-output-translations)
(require-quicklisp)
(let* ((this-file (load-time-value (or *load-truename* #.*compile-file-pathname*)))
       (this-file-dir (make-pathname :directory (pathname-directory this-file))))
  (push this-file-dir asdf:*central-registry*))
(ql:quickload :test-grid-server)

(print ">>> saving image tg-server...")
(sb-ext:save-lisp-and-die (merge-pathnames "tg-server" *build-dir*)
                          :toplevel (lambda ()
                                      (tg-server:start :port (parse-integer (asdf::getenv "PORT"))
                                                       :smtp-password (asdf::getenv "SMTP_PASSWORD"))
                                      (loop (sleep 1000)))
                          :executable t
                          :purify t)

(print ">>> Done building system")

;; 3
{'fraction_non_alphanumeric': 0.15275590551181104, 'fraction_numerical': 0.005249343832020997, 'mean_word_length': 1.9368258859784284, 'pattern_counts': {'":': 0, '<': 3, '<?xml version=': 0, '>': 21, 'https://': 0, 'lorem ipsum': 0, 'www.': 0, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 8, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '1313268', 'n_tokens_mistral': 576, 'n_tokens_neox': 553, 'n_words': 117}