6 ms·
D's default package manager already allows you to write code like this which 1. runs the code like a script 2. downloads dependencies if they are required.
by btbytes 7y ago
D's default package manager already allows you to write code like this which 1. runs the code like a script 2. downloads dependencies if they are required.
#!/usr/bin/env dub
/+ dub.sdl:
name "allthepythons"
dependency "d-glob" version="~>0.3.0"
+/
import std.stdio : stdout;
import glob : glob;
void main () {
foreach (entry ; glob("/usr/local/bin/python*")) {
stdout.writefln("%s", entry);
}
}
- 1980phipsi 7y agoDub's documentation should use some love...