You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Maybe add warning inside app for those (like me) that did not read the Readme.md saying that SwiftRuntimeForCommandLineTools.dmg may be needed for macos 10.14.3 and earlier. (This app should run on macos 10.11, 10.12, and 10.13 high sierra, tho I think the Swift-runtime typically may only be needed for 10.12 or 10.13) In any case, I think we can check if Swift-runtime is needed by seeing if this file exists:
/usr/lib/swift/libswiftCore.dylib
BTW... thanks for the app! The older macs running older macos with older batteries are the ones that really might be helped by this. I have seen quite a few with swollen batteries likely due to overheating/overcharging. (The darned Aldente app won't work on older macs as it requires 10.15 or newer ;-)
Anyways, when I added the snippet below to main.scpt it worked ok for me in some limited testing. YMMV ;-)
var app = Application.currentApplication()
app.includeStandardAdditions = true
// (snip) Test and warn if SwiftRuntimeForCommandLineTools.dmg is needed (like for 10.14.3 or earlier)
// See https://github.com/zackelia/bclm/issues/6
var path = Path('/usr/lib/swift/libswiftCore.dylib');
var finderApp = Application("Finder");
var status = finderApp.exists(path);
var url = `https://support.apple.com/kb/DL1998?locale=en_US`
// app.displayAlert(status)
if (status == false) {
if (app.displayAlert(`For 10.14.3 and earlier please install SwiftRuntimeForCommandLineTools.dmg `, {
message: `Please do small one-time-only install. Would you like to open the Apple download site?`,
as: 'critical',
buttons: ['Remind Me Later', 'Open site'],
defaultButton: 'Open site'
}).buttonReturned === 'Open site') {
app.doShellScript(`open '${url}'`)
}
}
// (\snip) End of test and warn if SwiftRuntimeForCommandLineTools.dmg is needed
var version = 'v' + app.doShellScript(`defaults read '${app.pathTo(this)}/Contents/Info.plist' CFBundleShortVersionString`)
var latestVersion = app.doShellScript(`curl -s 'https://api.github.com/repos/godly-devotion/charge-limiter/releases/latest' | awk -F '"' '/tag_name/{print $4}'`)
var url = `https://github.com/godly-devotion/charge-limiter/releases/latest`
If anyone knows a better way than using Finder to test that file /usr/lib/swift/libswiftCore.dylib exists, then that might avoid possible issue where you might have to set finder to show all files. Tho in my quick and dirty testing, I do not think I had to do this:
Maybe add warning inside app for those (like me) that did not read the Readme.md saying that SwiftRuntimeForCommandLineTools.dmg may be needed for macos 10.14.3 and earlier. (This app should run on macos 10.11, 10.12, and 10.13 high sierra, tho I think the Swift-runtime typically may only be needed for 10.12 or 10.13) In any case, I think we can check if Swift-runtime is needed by seeing if this file exists:
BTW... thanks for the app! The older macs running older macos with older batteries are the ones that really might be helped by this. I have seen quite a few with swollen batteries likely due to overheating/overcharging. (The darned Aldente app won't work on older macs as it requires 10.15 or newer ;-)
Anyways, when I added the snippet below to main.scpt it worked ok for me in some limited testing. YMMV ;-)
If anyone knows a better way than using Finder to test that file
/usr/lib/swift/libswiftCore.dylib
exists, then that might avoid possible issue where you might have to set finder to show all files. Tho in my quick and dirty testing, I do not think I had to do this:The text was updated successfully, but these errors were encountered: