13 Commits

Author SHA1 Message Date
bobo.yang
e53b0576b3 Refactor command location and DevChat installation
- Updated the locateCommand function to split the output of the 'where' and 'which' commands and return the first line.
- Modified the DevChat installation command to include the path in quotes to handle paths with spaces.
2023-07-06 07:42:44 +08:00
bobo.yang
e6f184cfe6 update devchat check logic 2023-07-06 07:42:44 +08:00
bobo.yang
d474957fe8 Add Python Path configuration and command to package.json
- Added a new configuration 'DevChat.PythonPath' in package.json.
- This configuration allows users to specify the location of the Python binary.
- Also added a new command 'DevChat.PythonPath' to the command palette.
- Updated commandsBase.ts to use the Python Path from the configuration.
- If the Python Path is not set in the configuration, it will use the default Python command.
- If the DevChat status is 'Missing required dependency: Python3', the status bar item will trigger the 'devchat.PythonPath' command.
2023-07-06 07:42:44 +08:00
bobo.yang
35215a7fb6 Prevent duplicate binPath in PATH environment variable
- Check if binPath is already in PATH before adding it.
- Add binPath to PATH only if it's not already present.
- Log a message when binPath is added to PATH.
2023-06-16 09:08:51 +08:00
bobo.yang
1bb215f51b Improve error handling in DevChat dependency check
- Add a catch block to handle errors when checking pipx environment path.
- Log detailed error message when DevChat dependency check fails.
- Move DevChat installation check to a separate try-catch block.
- Update logger error message to info when pipx environment path is not found.
2023-06-16 09:05:10 +08:00
bobo.yang
9820571783 Improve DevChat dependency check and logging
- Remove redundant DevChat installation check.
- Change logger error message to info when pipx environment path is not found.
- Move DevChat installation check outside of the if-else block.
- Return true after running 'devchat --help' command.
2023-06-15 21:20:52 +08:00
bobo.yang
5fc21c1982 Refactor checkDevChatDependency to accept pythonCommand
- Update checkDevChatDependency to take pythonCommand as an argument.
- Modify getPipxEnvironmentPath to use pythonCommand.
- Adjust statusBarViewBase.ts to pass pythonCommand.
- Update test cases in commandsBase.test.ts accordingly.
2023-06-13 11:56:03 +08:00
bobo.yang
3fc21b920e update log text 2023-06-13 10:45:11 +08:00
bobo.yang
659e35edf8 don't focus on output while devchat check fail. 2023-06-13 08:46:53 +08:00
bobo.yang
abba2c7df3 Add getValidPythonCommand function and improve dependency check
- Implement getValidPythonCommand in commandsBase.ts to detect Python 3.
- Update dependencyCheck in statusBarViewBase.ts to use getValidPythonCommand.
- Modify install.py to use sys.executable instead of hardcoded 'python3'.
2023-06-13 08:32:22 +08:00
bobo.yang
13f161506f Improve DevChat dependency check and error handling
- Add logger import to commandsBase.ts.
- Replace plain error handling with logger in checkDevChatDependency.
- Refactor getPipxEnvironmentPath and updateEnvironmentPath functions.
2023-06-12 08:39:02 +08:00
bobo.yang
ba097eab26 add unit tests for src 2023-05-31 16:10:53 +08:00
bobo.yang
82faf14eb6 Separate VSCode from core logic for ISSUE #125
- Extract VSCode-related code from core logic.
- Improve modularity for easier unit testing.
2023-05-31 16:10:53 +08:00