Exemplo n.º 1
0
 /// <summary>
 /// Creates a new local shell connector instance.
 /// </summary>
 public Shell()
 {
     //https://github.com/deinsoftware/toolbox#system
     this.NotificationSystem = ToolBox.Notification.NotificationSystem.Default;
     this.BridgeSystem       = (Utils.CurrentOS == Utils.OS.WIN ? ToolBox.Bridge.BridgeSystem.Bat : ToolBox.Bridge.BridgeSystem.Bash);
     this.LocalShell         = new ShellConfigurator(BridgeSystem, NotificationSystem);
 }
        public ShellConfigurator(IBridgeSystem bridgeSystem, INotificationSystem notificationSystem = null)
        {
            if (bridgeSystem == null)
            {
                throw new ArgumentException(nameof(bridgeSystem));
            }
            _bridgeSystem = bridgeSystem;

            if (notificationSystem == null)
            {
                _notificationSystem = NotificationSystem.Default;
            }
            else
            {
                _notificationSystem = notificationSystem;
            }

            if (!OS.IsWin())
            {
                Term("chmod +x cmd.sh");
            }
        }
Exemplo n.º 3
0
        public ShellConfigurator(IBridgeSystem bridgeSystem, INotificationSystem notificationSystem = null)
        {
            if (bridgeSystem == null)
            {
                throw new ArgumentException(nameof(bridgeSystem));
            }
            _bridgeSystem = bridgeSystem;

            if (notificationSystem == null)
            {
                _notificationSystem = NotificationSystem.Default;
            }
            else
            {
                _notificationSystem = notificationSystem;
            }

            if (!OS.IsWin())
            {
                Term($"chmod +x {Path.Combine(Utility.GetExecutionAssemblyPath(), "cmd.sh")}");
            }
        }