修复mac升级到mojave后因脚本权限问题导致无法通过终端进行ssh的问题。

pull/173/head
Apex Liu 2019-07-22 12:15:58 +08:00
parent 62e2ce6286
commit adbeed7c04
8 changed files with 134 additions and 120 deletions

View File

@ -381,7 +381,7 @@
}; };
buildConfigurationList = C149EBF315D5214600B1F558 /* Build configuration list for PBXProject "TP-Assist" */; buildConfigurationList = C149EBF315D5214600B1F558 /* Build configuration list for PBXProject "TP-Assist" */;
compatibilityVersion = "Xcode 10.0"; compatibilityVersion = "Xcode 10.0";
developmentRegion = English; developmentRegion = en;
hasScannedForEncodings = 0; hasScannedForEncodings = 0;
knownRegions = ( knownRegions = (
en, en,

View File

@ -6,6 +6,7 @@ on scriptRun(argsCmd, argsProfile, argsTitle)
end scriptRun end scriptRun
on CommandRun(theCmd, theProfile, theTitle) on CommandRun(theCmd, theProfile, theTitle)
try
tell application "iTerm" tell application "iTerm"
if it is not running then if it is not running then
tell application "iTerm" tell application "iTerm"
@ -77,4 +78,8 @@ on CommandRun(theCmd, theProfile, theTitle)
end try end try
end if end if
end tell end tell
on error msg
display dialog "ERROR: " & msg
end try
end CommandRun end CommandRun

View File

@ -6,12 +6,13 @@ on scriptRun(argsCmd, argsProfile, argsTitle)
end scriptRun end scriptRun
on CommandRun(theCmd, theProfile, theTitle) on CommandRun(theCmd, theProfile, theTitle)
try
tell application "Terminal" tell application "Terminal"
if it is not running then if it is not running then
--if this is the first time Terminal is running you have specify window 1 --if this is the first time Terminal is running you have specify window 1
--if you dont do this you will get two windows and the title wont be set --if you dont do this you will get two windows and the title wont be set
activate activate
delay 1.0 delay 3.0
set newTerm to do script theCmd in window 1 set newTerm to do script theCmd in window 1
set newTerm's current settings to settings set theProfile set newTerm's current settings to settings set theProfile
set custom title of front window to theTitle set custom title of front window to theTitle
@ -67,10 +68,16 @@ on CommandRun(theCmd, theProfile, theTitle)
end if end if
# set current settings of selected tab of front window to settings set theProfile --set current settings of selected tab of front window to settings set theProfile
# set title displays custom title of front window to true --set title displays custom title of front window to true
# set custom title of selected tab of front window to theTitle --set custom title of selected tab of front window to theTitle
end if end if
end tell end tell
on error msg
display dialog "ERROR: " & msg
end try
end CommandRun end CommandRun

View File

@ -3,12 +3,12 @@
TPAssist TPAssist
*/ */
"app_name" = "Teleport助手"; "app_name" = "Teleport Assist";
//============================================= //=============================================
// for About Window // for About Window
//============================================= //=============================================
"version" = "Version: "; "version" = "Version: ";
"app_full_name" = "Teleport Assist for macOS"; "app_full_name" = "Teleport Assist for macOS";
"copyright" = "Copyright © 2017~2018 TP4A. All rights reserved."; "copyright" = "Copyright © 2017~2019, tp4a.com. All rights reserved.";
"visit_tp4a_website" = "Visit Teleport Website" "visit_tp4a_website" = "Visit Teleport Website"

View File

@ -28,8 +28,10 @@
<string>${MACOSX_DEPLOYMENT_TARGET}</string> <string>${MACOSX_DEPLOYMENT_TARGET}</string>
<key>LSUIElement</key> <key>LSUIElement</key>
<true/> <true/>
<key>NSAppleEventsUsageDescription</key>
<string></string>
<key>NSHumanReadableCopyright</key> <key>NSHumanReadableCopyright</key>
<string>Copyright © 2017~2018 TP4A. All rights reserved.</string> <string>Copyright © 2017~2019, tp4a.com. All rights reserved.</string>
<key>NSMainNibFile</key> <key>NSMainNibFile</key>
<string>MainMenu</string> <string>MainMenu</string>
<key>NSPrincipalClass</key> <key>NSPrincipalClass</key>

View File

@ -15,5 +15,5 @@
"about " = "关于 "; "about " = "关于 ";
"version" = "版本:"; "version" = "版本:";
"app_full_name" = "Teleport助手 - macOS"; "app_full_name" = "Teleport助手 - macOS";
"copyright" = "© 2017~2018 TP4A保留所有权利。"; "copyright" = "© 2017~2019tp4a.com。保留所有权利。";
"visit_tp4a_website" = "访问 Teleport 网站"; "visit_tp4a_website" = "访问 Teleport 网站";