parser: check if argument is a directory

Signed-off-by: Alberto Corona <alberto@0x1a.us>
gen: fix platform check

Signed-off-by: Alberto Corona <alberto@0x1a.us>