Closed maxsharabayko closed 4 years ago
Independent from how the output directory is specified,
--output="./output"
--output="/Users/<username/.../output"
the script determines the absolute path, and then goes (MacOS):
Directory / Directory /Users Directory /Users/<username> ...
And throws the EISDIR error trying to create directory / on MacOS.
EISDIR
/
This PR adds two additional checks to the mkDirByPathSync(..) function.
mkDirByPathSync(..)
Add handling of "EISDIR".
Create a directory only if the path does not exist. Using additional condition fs.existsSync(curDir)
fs.existsSync(curDir)
Independent from how the output directory is specified,
--output="./output"
--output="/Users/<username/.../output"
the script determines the absolute path, and then goes (MacOS):
And throws the
EISDIR
error trying to create directory/
on MacOS.This PR adds two additional checks to the
mkDirByPathSync(..)
function.Add handling of "EISDIR".
Create a directory only if the path does not exist. Using additional condition
fs.existsSync(curDir)