Closed JeroenBoersma closed 7 years ago
I reload zazu with these changes,rm data/applications.json
, then wait for the file to be created. Once it's created it's contents are an empty array. ]:
Maybe some os specific logic?
diff --git a/lib/file.js b/lib/file.js
index 0978d9e..8e9e5af 100644
--- a/lib/file.js
+++ b/lib/file.js
@@ -46,6 +46,9 @@ class File {
isDirectory () {
const isDirectory = this.stats.isDirectory()
const isSymbolicLink = this.stats.isSymbolicLink()
+ if (process.platform === 'darwin') {
+ return isDirectory && !isSymbolicLink && !this.isApp()
+ }
return isDirectory && !isSymbolicLink
}
os specific in isDirectory too, hmm, will work out for now... Maybe we have too reconsider some codeparts for long term...
Also strange that it empties your applications.json because isApp should never go into that last bit of code
We could create a isMacApp
method.
return isDirectory && !isSymbolicLink && !this.isMacApp()
isMacApp () {
return process.platform === 'darwin' && this.isApp()
}
If you think that's any better?
I think that would mac ;) it more clear...
Maybe even refactor isApp()...
isApp(){
return isAppMac() || isAppLinux() || isAppWindows();
}
isAppMac() {}
isAppLinux(){}
isAppWindows() {}
isDirectory && !isSymbolicLink && !this.isAppMac()
Thanks!
It could create some double lookup, but I think it should be best of both worlds