在repl中获取当前clojure项目的版本 [英] Getting the version of the current clojure project in the repl
本文介绍了在repl中获取当前clojure项目的版本的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!
问题描述
是否可以在clojure repl中获取项目信息?
Is it possible to grab the project information within the clojure repl?
例如,如果定义了一个项目:
For example, if there was a project defined:
(defproject blahproject "0.1.2" ....)
在项目目录中运行repl时,是否有这样的功能?
When running a repl in the project directory, is there a function like this?
> (project-version)
;=> 0.1.2
推荐答案
Leiningen项目文件只是Clojure数据:)
Leiningen project files are just Clojure data :)
(-> "/path/to/project.clj" slurp read-string (nth 2))
这篇关于在repl中获取当前clojure项目的版本的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!
查看全文