alwaysai
Version:
The alwaysAI command-line interface (CLI)
39 lines • 2.29 kB
JavaScript
;
Object.defineProperty(exports, "__esModule", { value: true });
exports.getRemoteDeviceConfigFilePath = exports.getRemoteDeviceConfigDirectoryPath = exports.getLocalDeviceConfigFilePath = exports.getLocalDeviceConfigDirectoryPath = exports.getDeviceConfigPath = exports.DEVICE_CONFIG_FILE_NAME = exports.DEVICE_CREDENTIALS_DIRECTORY_NAME = void 0;
const path_1 = require("path");
const paths_1 = require("../paths");
const system_id_1 = require("./system-id");
/*===================================================================
Device File Paths
===================================================================*/
exports.DEVICE_CREDENTIALS_DIRECTORY_NAME = 'device';
exports.DEVICE_CONFIG_FILE_NAME = 'alwaysai.device.json';
function getDeviceConfigPath() {
const systemId = (0, system_id_1.getSystemId)();
return `${exports.DEVICE_CREDENTIALS_DIRECTORY_NAME}${systemId !== 'production' ? '-' + systemId : ''}`;
}
exports.getDeviceConfigPath = getDeviceConfigPath;
/*===================================================================
local alwaysai.device.json file setup
===================================================================*/
function getLocalDeviceConfigDirectoryPath() {
return (0, path_1.join)(paths_1.LOCAL_AAI_CFG_DIR, getDeviceConfigPath());
}
exports.getLocalDeviceConfigDirectoryPath = getLocalDeviceConfigDirectoryPath;
function getLocalDeviceConfigFilePath() {
return (0, path_1.join)(getLocalDeviceConfigDirectoryPath(), exports.DEVICE_CONFIG_FILE_NAME);
}
exports.getLocalDeviceConfigFilePath = getLocalDeviceConfigFilePath;
/*===================================================================
remote alwaysai.device.json file setup
===================================================================*/
function getRemoteDeviceConfigDirectoryPath() {
return path_1.posix.join(paths_1.REMOTE_AAI_CFG_DIR_LINUX, getDeviceConfigPath());
}
exports.getRemoteDeviceConfigDirectoryPath = getRemoteDeviceConfigDirectoryPath;
function getRemoteDeviceConfigFilePath() {
return path_1.posix.join(getRemoteDeviceConfigDirectoryPath(), exports.DEVICE_CONFIG_FILE_NAME);
}
exports.getRemoteDeviceConfigFilePath = getRemoteDeviceConfigFilePath;
//# sourceMappingURL=device-paths.js.map