in provider-utils/awscloudformation/utils/livestream-obs.js [19:55]
async function createConfig(context, projectConfig, projectName) {
// check for obs installation!
let profileDir = '';
if (process.platform === 'darwin') {
profileDir = `${process.env.HOME}/Library/Application Support/obs-studio/basic/profiles/`;
} else if (process.platform === 'win32') {
profileDir = `${process.env.APPDATA}/obs-studio/basic/profiles/`;
} else {
profileDir = '';
}
if (!fs.existsSync(profileDir)) {
// Ask if they want to continue later
context.print.info('OBS profile not folder not found. Switching to project folder.');
profileDir = `${process.env.PWD}/OBS/`;
fs.mkdirSync(profileDir);
}
profileDir = `${profileDir + projectName}/`;
if (!fs.existsSync(profileDir)) {
fs.mkdirSync(profileDir);
}
if (projectConfig.serviceType === 'livestream') {
generateINILive(projectName, profileDir);
generateServiceLive(profileDir, projectConfig.output.oMediaLivePrimaryIngestUrl);
} else if (projectConfig.serviceType === 'ivs') {
const targetDir = context.amplify.pathManager.getBackendDirPath();
const props = JSON.parse(fs.readFileSync(`${targetDir}/video/${projectName}/props.json`));
generateINIIVS(projectName, profileDir, props);
generateServiceIVS(profileDir, projectConfig.output);
}
context.print.success('\nConfiguration complete.');
context.print.blue(chalk`Open OBS and select {bold ${projectName}} profile to use the generated profile for OBS`);
}