www.digitalmars.com         C & C++   DMDScript  

digitalmars.D.learn - What's the best way to programmatically detect the most recent release

reply Andrew Edwards <edwards.ac gmail.com> writes:
The best way I know to determine the latest DMD release is 
http://ftp.digitalmars.com/LATEST. I'm not aware that such a file 
exists for LDC and GDC so I'm currently doing:

string latest(string url) {
     return executeShell("git ls-remote --tags " ~ url ~ " | cut 
-d 'v' -f 2 | cut -d '-' -f 1 | cut -d '^' -f 1 | uniq | tail -n 
1").output.strip;
}

Is there a better way?

Thanks,
Andrew
Oct 16
parent reply Jacob Carlborg <doob me.com> writes:
On 2017-10-16 17:13, Andrew Edwards wrote:
 The best way I know to determine the latest DMD release is 
 http://ftp.digitalmars.com/LATEST. I'm not aware that such a file exists 
 for LDC and GDC so I'm currently doing:
 
 string latest(string url) {
      return executeShell("git ls-remote --tags " ~ url ~ " | cut -d 'v' 
 -f 2 | cut -d '-' -f 1 | cut -d '^' -f 1 | uniq | tail -n 1").output.strip;
 }
 
 Is there a better way?
The official download script [1] is using the following: dmd - http://downloads.dlang.org/releases/LATEST dmd beta - http://downloads.dlang.org/pre-releases/LATEST ldc - https://ldc-developers.github.io/LATEST ldc beta - https://ldc-developers.github.io/LATEST_BETA gdc - http://gdcproject.org/downloads/LATEST [1] https://dlang.org/install.sh -- /Jacob Carlborg
Oct 16
parent reply Andrew Edwards <edwards.ac gmail.com> writes:
On Monday, 16 October 2017 at 18:21:46 UTC, Jacob Carlborg wrote:
 On 2017-10-16 17:13, Andrew Edwards wrote:
 Is there a better way?
The official download script [1] is using the following:
You're a godsend. Thank you very much.
Oct 16
parent Jacob Carlborg <doob me.com> writes:
On 2017-10-16 20:32, Andrew Edwards wrote:

 You're a godsend. Thank you very much.
:D -- /Jacob Carlborg
Oct 17