Allow installation on all platform#75
Open
doctolivier wants to merge 2 commits intocodebytere:mainfrom
Open
Conversation
Author
|
@codebytere If you can take a look or if it's not planned to support others OS 👍 |
mmaietta
reviewed
Feb 9, 2025
| askForPhotosAccess: askForPhotosAccess, | ||
| askForSpeechRecognitionAccess: askForSpeechRecognitionAccess, | ||
| askForScreenCaptureAccess: askForScreenCaptureAccess, | ||
| getAuthStatus: getAuthStatus, |
There was a problem hiding this comment.
FWIW, I think this could be refactored for a much smaller diff:
const permissions = process.platform === 'darwin' ? require('bindings')('permissions.node') : undefined
function askForAccessibilityAccess() {
return permissions?.askForAccessibilityAccess.call(this)
}
function askForCalendarAccess(accessLevel = 'write-only') {
if (!['write-only', 'full'].includes(accessLevel)) {
throw new TypeError(`${accessLevel} must be one of either 'write-only' or 'full'`)
}
return permissions?.askForCalendarAccess.call(this, accessLevel)
}
module.exports = {
askForAccessibilityAccess,
askForCalendarAccess,
askForMusicLibraryAccess: () => permissions ? permissions.askForMusicLibraryAccess.call(this) : undefined
// ...
}
e113096 to
4280ffc
Compare
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Fixe #64
On my Electron app, I need to supporte multiple OS and I would like to use your package to enhance the mac permissions experience, but I can't add it easely because of the npm
oslimitation. It failing my npm installation on local and CI although I've added the package inoptionalDependency.This is why I propose this changes that allow installation and usage on all platform but the APIs will return undefined if not macOs.