borkdude / tools

Tools
19 stars 2 forks source link

lein2deps: fails to generate deps.edn file when defproject form is not the first in the file #1

Closed mpenet closed 2 years ago

mpenet commented 2 years ago

As the title mentions I think the defproject form is assumed to be the first thing it encounters, which is not always true:

If you take an example like this

(def foo "1.0.0")
(defproject something "1.0.0"
   :dependencies [[foo/bar ~foo]])

It will generate {:deps [] :paths nil}

You might have to wrap the loaded content in an artificial (do ...) or read-eval the file line by line until EOF.