Skip to content

Commit 632ba36

Browse files
committed
Changed updater script to handle new version strings
New version strings are in a different place, and Sparkle will no longer be including the Git hash in the CFBundleVersion query, so we must get it from the ZIP filename.
1 parent 271b9b3 commit 632ba36

File tree

1 file changed

+13
-9
lines changed

1 file changed

+13
-9
lines changed

Scripts/update_feed.rb

Lines changed: 13 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -24,15 +24,14 @@
2424

2525
#Get the latest revision from the appcast
2626
appcast_enclosure = sortedchannels[0].search('./enclosure').first
27-
appcast_revision = sortedchannels[0].xpath('.//sparkle:version').text
28-
appcast_url = appcast_enclosure.attribute('url');
29-
if !appcast_revision
30-
appcast_revision = appcast_enclosure.attribute_with_ns('version', sparkle).to_s
31-
end
32-
appcast_revision_split = appcast_revision.split( /-/ )
33-
appcast_revision_code = appcast_revision_split[1]
34-
appcast_revision_split = appcast_revision_code.split( /g/ )
35-
appcast_revision_code = appcast_revision_split[1]
27+
appcast_url = appcast_enclosure.attribute('url').to_s;
28+
29+
appcast_filename = appcast_url.split( '/' )[-1]
30+
appcast_filename_split = appcast_filename.split( '.' )
31+
appcast_filename_base = appcast_filename_split[0]
32+
appcast_filename_split = appcast_filename_base.split( '-' )
33+
34+
appcast_revision_code = appcast_filename_split[1]
3635

3736
#Remove modified files that may cause conflicts.
3837
#%x[hg revert --all]
@@ -60,6 +59,11 @@
6059

6160
latest_revision = version_element.inner_text
6261

62+
if latest_revision.split( /-/ ).count < 2
63+
version_element = plistdoc.xpath('//key[.="GitVersion"]/following-sibling::string[1]')
64+
latest_revision = version_element.inner_text
65+
end
66+
6367
#latest_revision = %x[/usr/local/bin/hg log -r . --template '{latesttag}-{latesttagdistance}-{node|short}']
6468
revision_split = latest_revision.split( /-/ )
6569
revision_number = revision_split[0]

0 commit comments

Comments
 (0)