Skip to content

Instantly share code, notes, and snippets.

@btbytes
Last active February 16, 2018 16:19
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save btbytes/608a52b705b403df73c13bfe2a8ca718 to your computer and use it in GitHub Desktop.
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.
#!/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