I get a segmentation fault when accidentally trying to compile a directory like this: neat halma/. Here is a bit of code, that can be placed at line 1077 or so of main.nt, to avoid this (too small for a PR, IMHO):
for (arg in args) {
if (arg.startsWith("-"))
continue;
if (basename(arg) == "") {
print("You need to specify a file and not a directory.");
return;
}
}
I am sure that code could be more robust ;)
Perhaps it would be better to check the directory to see if it has a package.json file, and if it does then cwd into that dir and do a neat build instead of failing with that message? Only fail with the message if there is no package.json file in the dir? Not sure which design you would like to follow.
I get a segmentation fault when accidentally trying to compile a directory like this:
neat halma/
. Here is a bit of code, that can be placed at line 1077 or so of main.nt, to avoid this (too small for a PR, IMHO):I am sure that code could be more robust ;)
Perhaps it would be better to check the directory to see if it has a package.json file, and if it does then cwd into that dir and do a
neat build
instead of failing with that message? Only fail with the message if there is no package.json file in the dir? Not sure which design you would like to follow.