Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP
Browse files

Fix weird dynamic variable behavior. Use lexical scoping.

  • Loading branch information...
commit ace654d666ea198b3396eb331643df7a1021829e 1 parent 523feb3
@jsmpereira authored
Showing with 1 addition and 4 deletions.
  1. +1 −4 src/hello-world.lisp
View
5 src/hello-world.lisp
@@ -5,13 +5,10 @@
#+ccl (ccl:getenv target)
#+sbcl (sb-posix:getenv target))
-;; Database
-(defvar *database-url* (heroku-getenv "DATABASE_URL"))
-
(defun db-params ()
"Heroku database url format is postgres://username:password@host:port/database_name.
TODO: cleanup code."
- (let* ((url (second (cl-ppcre:split "//" *database-url*)))
+ (let* ((url (second (cl-ppcre:split "//" (heroku-getenv "DATABASE_URL"))))
(user (first (cl-ppcre:split ":" (first (cl-ppcre:split "@" url)))))
(password (second (cl-ppcre:split ":" (first (cl-ppcre:split "@" url)))))
(host (first (cl-ppcre:split ":" (first (cl-ppcre:split "/" (second (cl-ppcre:split "@" url)))))))
Please sign in to comment.
Something went wrong with that request. Please try again.