How to access the current Subversion build number?

前端 未结 16 2164
刺人心
刺人心 2020-11-27 05:43

How can you automatically import the latest build/revision number in subversion?

The goal would be to have that number visible on your webpage footer like SO does.

16条回答
  •  一向
    一向 (楼主)
    2020-11-27 06:05

    In Rails I use this snippet in my environment.rb which gives me a constant I can use throughout the application (like in the footer of an application layout).

    SVN_VERSION  = IO.popen("svn info").readlines[4].strip.split[1]
    

提交回复
热议问题