fix(striker-ui-api): add get host name to access module

This commit is contained in:
Tsu-ba-me 2023-03-17 16:20:29 -04:00
parent b58a1cb63a
commit 7b0a7e711d

View File

@ -148,6 +148,22 @@ const getAnvilData = <HashType>(
spawnSyncOptions, spawnSyncOptions,
).stdout; ).stdout;
const getLocalHostName = () => {
let result: string;
try {
result = execModuleSubroutine('host_name', {
subModuleName: 'Get',
}).stdout;
} catch (subError) {
throw new Error(`Failed to get local host name; CAUSE: ${subError}`);
}
shout(`localHostName=${result}`);
return result;
};
const getLocalHostUUID = () => { const getLocalHostUUID = () => {
let result: string; let result: string;
@ -156,7 +172,7 @@ const getLocalHostUUID = () => {
subModuleName: 'Get', subModuleName: 'Get',
}).stdout; }).stdout;
} catch (subError) { } catch (subError) {
throw new Error(`Failed to get localhost UUID; CAUSE: ${subError}`); throw new Error(`Failed to get local host UUID; CAUSE: ${subError}`);
} }
shout(`localHostUUID=[${result}]`); shout(`localHostUUID=[${result}]`);
@ -201,6 +217,7 @@ export {
dbSubRefreshTimestamp, dbSubRefreshTimestamp,
dbWrite, dbWrite,
getAnvilData, getAnvilData,
getLocalHostName,
getLocalHostUUID, getLocalHostUUID,
getPeerData, getPeerData,
execModuleSubroutine as sub, execModuleSubroutine as sub,