Skip to content

Instantly share code, notes, and snippets.

@btbytes
Last active Feb 16, 2018
Embed
What would you like to do?
Demonstrate the use of third party library dependency in a single-file D program that can be run as a Script.
#!/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