From 02ba57cd64ce9f8b2d25d4e77855be00f07f8013 Mon Sep 17 00:00:00 2001 From: Nico Verbruggen Date: Thu, 17 Mar 2022 19:54:13 +0100 Subject: [PATCH] =?UTF-8?q?=F0=9F=8F=97=20TODO:=20Automatic=20isolated=20P?= =?UTF-8?q?HP=20handling?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- phpmon/Domain/SiteList/SiteListVC+Actions.swift | 14 ++++++++++++++ 1 file changed, 14 insertions(+) diff --git a/phpmon/Domain/SiteList/SiteListVC+Actions.swift b/phpmon/Domain/SiteList/SiteListVC+Actions.swift index dfab717..c71e54e 100644 --- a/phpmon/Domain/SiteList/SiteListVC+Actions.swift +++ b/phpmon/Domain/SiteList/SiteListVC+Actions.swift @@ -70,11 +70,25 @@ extension SiteListVC { @objc func openInTerminal() { Shell.run("open -b com.apple.terminal '\(selectedSite!.absolutePath)'") + // TODO: (ISOLATION) If isolated, make it so that the PATH is set for the isolated PHP version + // This might be possible with AppleScript? Worth a shot, using: + /* + tell application "Terminal" + activate + set shell to do script "echo 1" in window 1 + do script "echo 2" in shell + do script "echo 3" in shell + end tell + */ } @objc func openWithEditor(sender: EditorMenuItem) { guard let editor = sender.editor else { return } editor.openDirectory(file: selectedSite!.absolutePath) + + if editor.type == .terminal { + // TODO: (ISOLATION) Attempt to do automatic scripting here too (see above) + } } @objc func isolateSite(sender: PhpMenuItem) {