sindresorhus/LaunchAtLogin-Legacy

Fix TODO in Sources/LaunchAtLoginHelper/main.swift

cbjeukendrup opened this issue · 0 comments

I saw the TODO at
https://github.com/sindresorhus/LaunchAtLogin/blob/0f39982b9d6993eef253b81219d3c39ba1e680f3/Sources/LaunchAtLoginHelper/main.swift#L6

I think the "solution" is the following:

        let bundleId = Bundle.main.bundleIdentifier!
        guard bundleId.hasSuffix("-LaunchAtLoginHelper") else {
            NSApp.terminate(nil)
            return
        }
        let mainBundleId = bundleId.dropLast(20)

Maybe the guard statement isn't even necessary.

I hesitated about making a Pull Request for this, because I wasn't sure if I should also update the .zip files. Therefore, I decided to make an Issue.