Last active
March 31, 2016 09:43
-
-
Save SanSan-/3e78333a88fb13e4dce0 to your computer and use it in GitHub Desktop.
How to get path for app.db.jar
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| if !File.directory?('../app/db/target') then | |
| $name = File.basename(Dir['files/target/*.jar'].pop) | |
| elsif Dir['../app/db/target'].empty? then | |
| $name = File.basename(Dir['files/target/*.jar'].pop) | |
| else | |
| $name = File.basename(Dir['../app/db/target/*.jar'].select{ |i| i[/^(?!origin).*$/] }.pop) | |
| end | |
| if !File.directory?('../app/db/target') then | |
| $path = Dir['files/target'].pop | |
| elsif Dir['../app/db/target'].empty? then | |
| $path = Dir['files/target'].pop | |
| else | |
| $path = Dir['../app/db/target'].pop | |
| end | |
| printf("%s/%s\n",$path,$name) | |
| $end |
Author
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
$name = File.basename(Dir['../app/db/target/.jar'].select{ |i| i =~ /^(?!origin).$/i }.pop)