Skip to content
This repository has been archived by the owner on Nov 8, 2024. It is now read-only.

Commit

Permalink
Merge pull request #206 from apiaryio/abtris/exclude-team-api
Browse files Browse the repository at this point in the history
fix: add option --exclude-team-projects
  • Loading branch information
Ladislav Prskavec authored Aug 25, 2021
2 parents 5ab038f + a6384b9 commit 13638dd
Show file tree
Hide file tree
Showing 4 changed files with 8 additions and 1 deletion.
1 change: 1 addition & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -77,6 +77,7 @@ Usage:
apiary archive
Options:
[--exclude-team-projects], [--no-exclude-team-projects] # Skip team projects
Archive All Your API Description Documents from apiary.io to local files named following [api-project-subdomain.apib] pattern.
```
Expand Down
1 change: 1 addition & 0 deletions lib/apiary/cli.rb
Original file line number Diff line number Diff line change
Expand Up @@ -12,6 +12,7 @@ class CLI < Thor

desc 'archive', 'Archive All Your API Description Documents from apiary.io to local files named following [api-project-subdomain.apib] pattern.'
method_option :api_host, type: :string, banner: 'HOST', desc: 'Specify apiary host', hide: true
method_option :exclude_team_projects, type: :boolean, default: false, desc: 'Skip team projects'

def archive
cmd = Apiary::Command::Archive.new options
Expand Down
5 changes: 5 additions & 0 deletions lib/apiary/command/archive.rb
Original file line number Diff line number Diff line change
Expand Up @@ -37,7 +37,12 @@ def apilist_from_apiary
response = query_apiary

response['apis'].each do |api|
if api['apiIsTeam'] == true && @options.exclude_team_projects == true
puts "#{api['apiSubdomain']}... Team API skipping"
next
end
puts api['apiSubdomain']

@options = OpenStruct.new
@options.api_host ||= 'api.apiary.io'
@options.api_name ||= api['apiSubdomain']
Expand Down
2 changes: 1 addition & 1 deletion lib/apiary/version.rb
Original file line number Diff line number Diff line change
@@ -1,3 +1,3 @@
module Apiary
VERSION = '0.16.0'.freeze
VERSION = '0.16.1'.freeze
end

0 comments on commit 13638dd

Please sign in to comment.