//#region imports
import { crossPlatformPath, UtilsOs, path, Helpers, UtilsJson, dotTaonFolder, } from 'tnp-core/lib';
import { BaseCliWorkerConfig } from './base-cli-worker-config';
//#endregion
export var BaseCliWorkerUtils;
(function (BaseCliWorkerUtils) {
    BaseCliWorkerUtils.getPathToProcessLocalInfoJson = (serviceID) => {
        //#region @backendFunc
        // console.log('os.userInfo()', os.userInfo());
        return crossPlatformPath([
            UtilsOs.getRealHomeDir(),
            dotTaonFolder,
            '__workers-service-process-info__',
            `${serviceID}.json`,
        ]);
        //#endregion
    };
    BaseCliWorkerUtils.getAllServicesFromOS = () => {
        //#region @backendFunc
        const dir = crossPlatformPath(path.dirname(BaseCliWorkerUtils.getPathToProcessLocalInfoJson('dummy')));
        return Helpers.filesFrom(dir)
            .filter(f => f.endsWith('.json'))
            .map(f => BaseCliWorkerConfig.from(UtilsJson.readJsonWithComments(f)));
        //#endregion
    };
})(BaseCliWorkerUtils || (BaseCliWorkerUtils = {}));
//# sourceMappingURL=base-cli-worker.utils.js.map