format import process from 'process' ; import os from 'os' ; import fs from 'fs-extra' ; import path from 'path' ; import { EnvironmentInfo , ReleaseChannel } from 'flipper-common' ; export async function getEnvironmentInfo ( packageJsonDir , isProduction ) { const packageJson = await fs . readJSON ( path . resolve ( packageJsonDir , 'package.json' ) ) ; const releaseChannel = process . env . FLIPPER_RELEASE_CHANNEL === 'insiders' ? ReleaseChannel . INSIDERS : process . env . FLIPPER_RELEASE_CHANNEL === 'stable' ? ReleaseChannel . STABLE : packageJson . releaseChannel === 'insiders' ? ReleaseChannel . INSIDERS : ReleaseChannel . STABLE ; const flipperReleaseRevision = ( global as any ) . __REVISION__ ?? packageJson . revision ; const appVersion = process . env . FLIPPER_FORCE_VERSION ?? ( isProduction ? packageJson . version : '0.0.0' ) ; return { processId : process . pid , isProduction , releaseChannel , flipperReleaseRevision , appVersion , os : { arch : process . arch , platform : process . platform , unixname : os . userInfo ( ) . username , } , versions : { electron : process . versions . electron , node : process . versions . node , platform : os . release ( ) , } , } ; }