AzurePoolCrossDbGenerator/Program.cs
/// <summary>
/// Load the config file or notify of problems and exit.
/// </summary>
/// <param name="configFileName"></param>
/// <returns></returns>
Load the config file or notify of problems and exit.
Load the config file or notify of problems and exit .
static string LoadConfigFile(string configFileName)
        {
            string fullPath = Path.Combine(Directory.GetCurrentDirectory(), configFileName);
            if (!System.IO.File.Exists(fullPath))
            {
                Program.WriteLine();
                Program.WriteLine($"Missing config file: {fullPath}. Use `config` command to initialise the environment.", ConsoleColor.Red);
                ExitApp();
            }
            string configJson = null;
            try
            {
                configJson = File.ReadAllText(fullPath);
            }
            catch (Exception ex)
            {
                Program.WriteLine();
                Program.WriteLine("Cannot read the config file: " + ex.Message, ConsoleColor.Red);
                ExitApp();
            }
            return configJson;
        }
static string LoadConfigFile ( string configFileName ) { string fullPath = Path . Combine ( Directory . GetCurrentDirectory ( ) , configFileName ) ; if ( ! System . IO . File . Exists ( fullPath ) ) { Program . WriteLine ( ) ; Program . WriteLine ( $" Missing config file:  { fullPath } . Use `config` command to initialise the environment. " , ConsoleColor . Red ) ; ExitApp ( ) ; } string configJson = null ; try { configJson = File . ReadAllText ( fullPath ) ; } catch ( Exception ex ) { Program . WriteLine ( ) ; Program . WriteLine ( " " + ex . Message , ConsoleColor . Red ) ; ExitApp ( ) ; } return configJson ; }
Load the config file or notify of problems and exit.
Load the config file or notify of problems and exit .
// check if the file exists // load the config file
None
configFileName
string
None