fix(cli): improve project metadata loading and normalize CLI error handling

This commit is contained in:
2026-05-09 12:34:58 +00:00
parent c7c1bbb460
commit adb13b027d
13 changed files with 3328 additions and 5222 deletions
+5 -4
View File
@@ -1,6 +1,6 @@
import * as plugins from '../../plugins.js';
import { TspmServiceManager } from '../../../client/tspm.servicemanager.js';
import { Logger } from '../../../shared/common/utils.errorhandler.js';
import { handleError, Logger } from '../../../shared/common/utils.errorhandler.js';
import type { CliArguments } from '../../types.js';
export function registerDisableCommand(smartcli: plugins.smartcli.Smartcli) {
@@ -18,10 +18,11 @@ export function registerDisableCommand(smartcli: plugins.smartcli.Smartcli) {
console.log(' The daemon will no longer start on system boot');
console.log(' Use "tspm enable" to re-enable the service');
} catch (error) {
console.error('Error disabling service:', error.message);
const errorMessage = handleError(error).message;
console.error('Error disabling service:', errorMessage);
if (
error.message.includes('permission') ||
error.message.includes('denied')
errorMessage.includes('permission') ||
errorMessage.includes('denied')
) {
console.log('\nNote: You may need to run this command with sudo');
}