icmake/md
raw| 1 | // md: target should be a series of blank-delimited directories to be created |
| 2 | // If an element is a whildcard, the directory will always be created, |
| 3 | // using mkdir -p. |
| 4 | // |
| 5 | // uses: run() |
| 6 | |
| 7 | void md(string target) |
| 8 | { |
| 9 | int idx; |
| 10 | list paths; |
| 11 | string dir; |
| 12 | |
| 13 | paths = strtok(target, " "); |
| 14 | |
| 15 | for (idx = listlen(paths); idx--; ) |
| 16 | { |
| 17 | dir = element(idx, paths); |
| 18 | if (!exists(dir)) |
| 19 | run("mkdir -p " + dir); |
| 20 | } |
| 21 | } |