You are viewing a plain text version of this content. The canonical link for it is here.
Posted to issues@openwhisk.apache.org by GitBox <gi...@apache.org> on 2020/11/14 05:32:36 UTC

[GitHub] [openwhisk-wskdebug] alexkli edited a comment on issue #79: nodejs mounted action runner should set the right current working directory

alexkli edited a comment on issue #79:
URL: https://github.com/apache/openwhisk-wskdebug/issues/79#issuecomment-727148588


   The fix is probably to simply change the dir to `/code/....` in both mount scripts at the start of their `main()` functions:
   
   - here for mount-require.js: https://github.com/apache/openwhisk-wskdebug/blob/master/src/kinds/nodejs/mount-require.js#L39
   - here for mount-plain.js: https://github.com/apache/openwhisk-wskdebug/blob/master/src/kinds/nodejs/mount-plain.js#L46
   
   It would probably have to take the parent dir of the `sourcePath`, i.e. set the cwd to the dir of the source file being required:
   
   ```javascript
   process.chdir(path.dirname(path));
   ```
   
   Not sure if this will fully address https://github.com/adobe/aio-cli-plugin-app/issues/282 because it depends how the action.zip is packaged and how that might be different from the raw source structure that is mounted 1:1 in the wskdebug mounting case.
   
   cc @shazron


----------------------------------------------------------------
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

For queries about this service, please contact Infrastructure at:
users@infra.apache.org