| 1 |
import nake |
| 2 |
nakeImports |
| 3 |
|
| 4 |
task "install", "compile and install nake binary": |
| 5 |
if shell("nim", "c", "nake") == 0: |
| 6 |
let path = getEnv("PATH").split(PathSep) |
| 7 |
for index, dir in pairs(path): |
| 8 |
echo " ", index, ". ", dir |
| 9 |
echo "Where to install nake binary? (quit with ^C or quit or exit)" |
| 10 |
let ans = stdin.readLine().toLowerAscii |
| 11 |
var index = 0 |
| 12 |
case ans |
| 13 |
of "q", "quit", "x", "exit": |
| 14 |
quit 0 |
| 15 |
else: |
| 16 |
index = parseInt(ans) |
| 17 |
if index > path.len or index < 0: |
| 18 |
echo "Invalid index." |
| 19 |
quit 1 |
| 20 |
moveFile "nake", path[index]/"nake" |
| 21 |
echo "Great success!" |
| 22 |
|
| 23 |
|