如何获取当前clojure项目的版本 [英] how to get the version of the current clojure project in the repl

查看:99
本文介绍了如何获取当前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

and running a repl in the project directory

有这样的功能吗?

> (project-version) 
;=> 0.1.2 


推荐答案

Leiningen项目文件只是Clojure数据: )

Leiningen project files are just Clojure data :)

( - >/path/to/project.cljslurp read-string(nth 2))

这篇关于如何获取当前clojure项目的版本的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆