Last active
February 16, 2018 16:19
-
-
Save btbytes/608a52b705b403df73c13bfe2a8ca718 to your computer and use it in GitHub Desktop.
Demonstrate the use of third party library dependency in a single-file D program that can be run as a Script.
This file contains 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
#!/usr/bin/env dub | |
/+ dub.sdl: | |
name "allthepythons" | |
dependency "d-glob" version="~>0.3.0" | |
+/ | |
/** | |
Demonstrate the use of third party library dependency in a single-file D program | |
that can be run as a Script. | |
The script can be converted into an executable by: | |
dub build --single allthepythons.d | |
*/ | |
import std.stdio : stdout; | |
import glob : glob; | |
void main () { | |
foreach (entry ; glob("/usr/local/bin/python*")) { | |
stdout.writefln("%s", entry); | |
} | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment