holatuwol / liferay-intellij

Tool to build out IntelliJ workspace project for Liferay, originally designed as an introduction to streams concepts for Java developers.
52 stars 51 forks source link

Use absolute path for the file path #16

Closed ericyanLr closed 1 year ago

ericyanLr commented 1 year ago

Hi @holatuwol ,

When using the feature to specify additional folders for blade projects:

ij /path/to/folder1 /path/to/folder2 /path/to/folder3

I sometimes encounter the error:

node:internal/fs/utils:344
    throw err;
    ^

Error: ENOENT: no such file or directory, open '../../../../../../../../tmp/sb/modules/abc/abc-api/abc-api.iml'
    at Object.openSync (node:fs:585:3)
    at Object.writeFileSync (node:fs:2153:35)
    at saveContent (/Users/liferay/Liferay/development/repos/holatuwol/liferay-intellij/streams7/streams6.js:257:5)
    at /Users/liferay/Liferay/development/repos/holatuwol/liferay-intellij/streams0/node_modules/highland/lib/index.js:1559:13
    at Stream.s._send (/Users/liferay/Liferay/development/repos/holatuwol/liferay-intellij/streams0/node_modules/highland/lib/index.js:1285:9)
    at Stream.write (/Users/liferay/Liferay/development/repos/holatuwol/liferay-intellij/streams0/node_modules/highland/lib/index.js:1375:18)
    at Stream._send (/Users/liferay/Liferay/development/repos/holatuwol/liferay-intellij/streams0/node_modules/highland/lib/index.js:761:26)
    at push (/Users/liferay/Liferay/development/repos/holatuwol/liferay-intellij/streams0/node_modules/highland/lib/index.js:1250:19)
    at /Users/liferay/Liferay/development/repos/holatuwol/liferay-intellij/streams0/node_modules/highland/lib/index.js:1719:13
    at Stream.s._send (/Users/liferay/Liferay/development/repos/holatuwol/liferay-intellij/streams0/node_modules/highland/lib/index.js:1285:9) {
  errno: -2,
  syscall: 'open',
  code: 'ENOENT',
  path: '../../../../../../../../tmp/sb/modules/abc/abc-api/abc-api.iml'

The proposed fix resolves this by using the absolute path instead of relative path.

Feel free to let me know if you have any questions. Thanks!