Would like to be able to check to see if a certain user Library is installed or not.
ie.
if(check for library) {
libInstalled = true
} else {
give a warning and a link to download...
}
Thanks.
@gopher.ny , @bravenel , etc.
Would like to be able to check to see if a certain user Library is installed or not.
ie.
if(check for library) {
libInstalled = true
} else {
give a warning and a link to download...
}
Thanks.
@gopher.ny , @bravenel , etc.
Backdoor would be to scrape http://yourHubIp:8080/library/list and search for the name. Could use the code from: [RELEASE] Web Scraper Device
Well, my solution for now is to try and call a method within the Library and trap on error.
libraryCheck()
if(state.libraryInstalled == 'COMPLETE') {
....
}
def libraryCheck(){
try {
checkForLibrary() // only found within the Library
} catch(e) {
section("<b>Ooops!</b>") {
paragraph "Library NOT found"
}
}
}
That will work. While you're doing it you may want to consider having it return a version number and check to make sure it satisfies your minimum version requirement.
Well, looks like my libraryCheck won't work after all. An app can't be saved that calls a library that doesn't exist. This is my last roadblock to be able to automatically download/update 'bundles' from GitHub.
Would need...
Then I could trap it?
try{
#include BPTWorld.bpt-normalStuff
} catch(e) {
magic happens...
}
I can add an app function that checks whether particular library (namespace/name) is installed.
Thanks, I look forward to seeing what you come up with.
Took a hard look at this too. In my case it still wouldn't work because we can't save an app if the #include doesn't exist. Thanks.
Will you please add this for use in drivers, too?