Ejemplo n.º 1
0
        public static void Main(string[] args)
        {
            var region = Env.GetEnvironmentVariable("AWS_DEFAULT_REGION");

            if (string.IsNullOrEmpty(region))
            {
                throw new System.Exception("Environment variable AWS_DEFAULT_REGION is not set");
            }
            var accountId = Env.GetEnvironmentVariable("AWS_ACCOUNT_ID");

            if (string.IsNullOrEmpty(accountId))
            {
                throw new System.Exception("Environment variable AWS_ACCOUNT_ID is not set");
            }
            var app = new App();

            new SolarStack(app, new StackProps
            {
                Env = new Environment
                {
                    Account = accountId,
                    Region  = region
                }
            });
            app.Synth();
        }
Ejemplo n.º 2
0
        public CommandLineEnvironments GetEnvironment()
        {
            const string term = "TERM";

            return(string.IsNullOrEmpty(SysEnv.GetEnvironmentVariable(term))
        ? CommandLineEnvironments.Win32
        : CommandLineEnvironments.AnsiCompatible);
        }
Ejemplo n.º 3
0
 // https://qiita.com/tmisuoka0423/items/325dfe91e7073b358435
 // https://docs.aws.amazon.com/cdk/latest/guide/environments.html
 private static Environment makeEnv(string account = null, string region = null)
 {
     return(new Environment
     {
         Account = account ?? SysEnv.GetEnvironmentVariable("CDK_DEFAULT_ACCOUNT"),
         Region = region ?? SysEnv.GetEnvironmentVariable("CDK_DEFAULT_REGION")
     });
 }
Ejemplo n.º 4
0
        /// Get file path to the current user's profile
        public string GetProfilePath(PlatformType platform)
        {
            if (platform == PlatformType.Windows)
            {
                return(Env.GetEnvironmentVariable("USERPROFILE"));
            }

            return(Env.GetEnvironmentVariable("HOME"));
        }
Ejemplo n.º 5
0
        /// Initialize new CommandHandler
        public CommandHandler()
        {
            string path = Env.GetEnvironmentVariable("PATH");

            _envPaths = path.Split(Path.PathSeparator).ToList();

            _extensions = new List <string>
            {
                "exe", "bat", "ps1", "py", "sh"
            };
        }
Ejemplo n.º 6
0
 public string GetEnvironmentVariable(string variableName) =>
 SysEnv.GetEnvironmentVariable(variableName);