rsm-hcd / AndcultureCode.Cli

and-cli command-line tool to manage the development of software applications
https://andculture.com
Apache License 2.0
14 stars 15 forks source link

Plugin project - path to base commands are not being properly constructed #138

Closed brandongregoryscott closed 3 years ago

brandongregoryscott commented 3 years ago

Attempted to upgrade a client project to 2.0.0-beta.1 and ran into this issue when running base commands:

bscot@BSCOTT-PC ~/proj/ (trunk) -> proj-cli -V
2.0.0-beta.1

bscot@BSCOTT-PC ~/proj/ (trunk) -> proj-cli deploy
module.js:550
    throw err;
    ^

Error: Cannot find module 'C:\Users\bscot\proj\node_modules\and-cli\and-cli-deploy.js'
    at Function.Module._resolveFilename (module.js:548:15)
    at Function.Module._load (module.js:475:25)
    at Function.Module.runMain (module.js:694:10)
    at startup (bootstrap_node.js:204:16)
    at bootstrap_node.js:625:3

bscot@BSCOTT-PC ~/proj/ (trunk) -> proj-cli dotnet
module.js:550
    throw err;
    ^

Error: Cannot find module 'C:\Users\bscot\proj\node_modules\and-cli\and-cli-dotnet.js'
    at Function.Module._resolveFilename (module.js:548:15)
    at Function.Module._load (module.js:475:25)
    at Function.Module.runMain (module.js:694:10)
    at startup (bootstrap_node.js:204:16)
    at bootstrap_node.js:625:3

I believe this was just a missed detail in the CommandRegistry module. There's a function that determines how to register the command based on whether the module is being imported or not (ie, it is being run as a plugin CLI). Since we are pushing out compiled dist folder, the executableFile path probably just needs to be prefixed with dist/

brandongregoryscott commented 3 years ago

Published with v2.0.0-beta.2