mirror of
https://github.com/dkhamsing/open-source-ios-apps.git
synced 2024-12-22 21:38:44 +01:00
[scripts] Generate App Store only list (#491)
This commit is contained in:
parent
7f33fe5d0b
commit
bce45e21f9
6
.github/deploy.sh
vendored
6
.github/deploy.sh
vendored
@ -19,4 +19,10 @@ then
|
|||||||
git commit -m "[auto] [ci skip] Generate ARCHIVE"
|
git commit -m "[auto] [ci skip] Generate ARCHIVE"
|
||||||
fi
|
fi
|
||||||
|
|
||||||
|
if [[ $status == *"APPSTORE.md"* ]]
|
||||||
|
then
|
||||||
|
git add APPSTORE.md
|
||||||
|
git commit -m "[auto] [ci skip] Generate APPSTORE"
|
||||||
|
fi
|
||||||
|
|
||||||
git push --quiet "https://${GH_TOKEN}@github.com/dkhamsing/open-source-ios-apps" master:master > /dev/null 2>&1
|
git push --quiet "https://${GH_TOKEN}@github.com/dkhamsing/open-source-ios-apps" master:master > /dev/null 2>&1
|
||||||
|
31
.github/osia_convert.rb
vendored
31
.github/osia_convert.rb
vendored
@ -6,6 +6,8 @@ README = 'README.md'
|
|||||||
ARCHIVE = 'ARCHIVE.md'
|
ARCHIVE = 'ARCHIVE.md'
|
||||||
ARCHIVE_TAG = 'archive'
|
ARCHIVE_TAG = 'archive'
|
||||||
|
|
||||||
|
APPSTORE = 'APPSTORE.md'
|
||||||
|
|
||||||
def apps_archived(apps)
|
def apps_archived(apps)
|
||||||
a = apps.select {|a| a['tags'] != nil }.select {|b| b['tags'].include?ARCHIVE_TAG}
|
a = apps.select {|a| a['tags'] != nil }.select {|b| b['tags'].include?ARCHIVE_TAG}
|
||||||
a.sort_by { |k, v| k['title'].downcase }
|
a.sort_by { |k, v| k['title'].downcase }
|
||||||
@ -29,7 +31,7 @@ def apps_for_cat(apps, id)
|
|||||||
s.sort_by { |k, v| k['title'].downcase }
|
s.sort_by { |k, v| k['title'].downcase }
|
||||||
end
|
end
|
||||||
|
|
||||||
def output_apps(apps)
|
def output_apps(apps, appstoreonly)
|
||||||
o = ''
|
o = ''
|
||||||
apps.each do |a|
|
apps.each do |a|
|
||||||
name = a['title']
|
name = a['title']
|
||||||
@ -56,6 +58,11 @@ def output_apps(apps)
|
|||||||
unless itunes.nil?
|
unless itunes.nil?
|
||||||
t << "[` App Store`](#{itunes}) "
|
t << "[` App Store`](#{itunes}) "
|
||||||
end
|
end
|
||||||
|
|
||||||
|
if appstoreonly
|
||||||
|
next if itunes.nil?
|
||||||
|
end
|
||||||
|
|
||||||
o << "- #{t} \n"
|
o << "- #{t} \n"
|
||||||
|
|
||||||
o << " <details><summary>"
|
o << " <details><summary>"
|
||||||
@ -174,7 +181,7 @@ def output_stars(number)
|
|||||||
end
|
end
|
||||||
end
|
end
|
||||||
|
|
||||||
def write_readme(j)
|
def write_readme(j, file, appstoreonly = false)
|
||||||
t = j['title']
|
t = j['title']
|
||||||
subt = j['subtitle']
|
subt = j['subtitle']
|
||||||
desc = j['description']
|
desc = j['description']
|
||||||
@ -185,9 +192,14 @@ def write_readme(j)
|
|||||||
|
|
||||||
output = '# ' + t
|
output = '# ' + t
|
||||||
output << "\n\n"
|
output << "\n\n"
|
||||||
output << desc
|
|
||||||
output << "\n\n#{subt}\n\n"
|
if appstoreonly == false
|
||||||
output << output_badges(apps.count)
|
output << desc
|
||||||
|
output << "\n\n#{subt}\n\n"
|
||||||
|
output << output_badges(apps.count)
|
||||||
|
else
|
||||||
|
output << 'List of open-source apps published on the App Store (complete list [here](https://github.com/dkhamsing/open-source-ios-apps))'
|
||||||
|
end
|
||||||
|
|
||||||
output << "\n\nJump to\n\n"
|
output << "\n\nJump to\n\n"
|
||||||
|
|
||||||
@ -216,14 +228,14 @@ def write_readme(j)
|
|||||||
output << temp
|
output << temp
|
||||||
|
|
||||||
cat_apps = apps_for_cat(apps, c['id'])
|
cat_apps = apps_for_cat(apps, c['id'])
|
||||||
output << output_apps(cat_apps)
|
output << output_apps(cat_apps, appstoreonly)
|
||||||
end
|
end
|
||||||
|
|
||||||
output << "\n"
|
output << "\n"
|
||||||
output << f
|
output << f
|
||||||
|
|
||||||
File.open(README, 'w') { |f| f.write output }
|
File.open(file, 'w') { |f| f.write output }
|
||||||
puts "wrote #{README} ✨"
|
puts "wrote #{file} ✨"
|
||||||
end
|
end
|
||||||
|
|
||||||
def write_archive(j)
|
def write_archive(j)
|
||||||
@ -252,5 +264,6 @@ end
|
|||||||
|
|
||||||
j = get_json
|
j = get_json
|
||||||
|
|
||||||
write_readme(j)
|
write_readme(j, README)
|
||||||
write_archive(j)
|
write_archive(j)
|
||||||
|
write_readme(j, APPSTORE, true)
|
||||||
|
Loading…
Reference in New Issue
Block a user