mirror of
https://github.com/pulsar-edit/pulsar.git
synced 2025-01-07 15:49:23 +03:00
Add Atom::isReleasedVersion, which determines if the version is a SHA
This commit is contained in:
parent
6bb4eaee93
commit
8a8df8d6cb
@ -438,3 +438,11 @@ describe "the `atom` global", ->
|
||||
expect(atom.config.get('core.themes')).not.toContain packageName
|
||||
expect(atom.config.get('core.themes')).not.toContain packageName
|
||||
expect(atom.config.get('core.disabledPackages')).not.toContain packageName
|
||||
|
||||
describe ".isReleasedVersion()", ->
|
||||
it "returns false if the version is a SHA and true otherwise", ->
|
||||
version = '0.1.0'
|
||||
spyOn(atom, 'getVersion').andCallFake -> version
|
||||
expect(atom.isReleasedVersion()).toBe true
|
||||
version = '36b5518'
|
||||
expect(atom.isReleasedVersion()).toBe false
|
||||
|
@ -361,6 +361,10 @@ class Atom
|
||||
getVersion: ->
|
||||
app.getVersion()
|
||||
|
||||
# Public: Determine whether the current version is an official release.
|
||||
isReleasedVersion: ->
|
||||
not /\w{7}/.test(@getVersion()) # Check if the release is a 7-character SHA prefix
|
||||
|
||||
getGitHubAuthTokenName: ->
|
||||
'Atom GitHub API Token'
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user