ittybittyapps / appstoreconnect-cli

An easy to use command-line tool for interacting with the Apple AppStore Connect API
MIT License
172 stars 17 forks source link

Add sync pull command entry point #225

Closed adamjcampbell closed 3 years ago

adamjcampbell commented 3 years ago

📝 Summary of Changes

Changes proposed in this pull request:

⚠️ Items of Note

Causes fatalError when attempting to run pull when it is unimplemented

Unsure if we want to merge unimplemented commands or if this should be a draft

🧐🗒 Reviewer Notes

💁 Example

Unimplemented Usage

$ swift run asc testflight sync pull

Fatal error: Unimplemented command: file /Users/adam/Developer/appstoreconnect-cli/Sources/AppStoreConnectCLI/Commands/TestFlight/Sync/TestFlightPullCommand.swift, line 26

Generated Help

$ swift run asc testflight sync pull --help

OVERVIEW: Pull down existing TestFlight configuration, refreshing local configuration files.

USAGE: asc testflight sync pull [--api-issuer <uuid>] [--api-key-id <keyid>] [--csv] [--json] [--table] [--yaml] [--verbose] [--filter-bundle-ids <filter-bundle-ids> ...] [--output-path <output-path>]

OPTIONS:
  --api-issuer <uuid>     An AppStore Connect API Key issuer ID. (default: @env:APPSTORE_CONNECT_ISSUER_ID)
        The value for this option can be obtained from the AppStore Connect portal and takes the form of a
        UUID.

        If not specified on the command line this value will be read from the environment variable
        APPSTORE_CONNECT_ISSUER_ID.
  --api-key-id <keyid>    An AppStoreConnect API Key ID. (default: @env:APPSTORE_CONNECT_API_KEY_ID)
        The value for this option can be obtained from the AppStore Connect portal and takes the form of
        an 10 character alpha-numeric identifier, eg. 7MM5YSX5LS

        If not specified on the command line the value of this option will be read from the environment
        variable APPSTORE_CONNECT_API_KEY_ID.

        The environment will be searched for key with the name of APPSTORE_CONNECT_API_KEY. The contents
        of this environment key are expected to be a PKCS 8 (.p8) formatted private key associated with
        this Key ID.

        If the APPSTORE_CONNECT_API_KEY environment variable is empty, in the incorrect format, or not
        found then the following directories will be searched in sequence for a private key file with the
        name of 'AuthKey_<keyid>.p8': ./private_keys, ~/private_keys, ~/.private_keys and
        ~/.appstoreconnect/private_keys.
  --csv/--json/--table/--yaml
                          Display results in specified format. (default: table)
  -v, --verbose           Display extra messages as command is running.
  --filter-bundle-ids <filter-bundle-ids>
                          Filter the app configurations by the specified bundle IDs
  --output-path <output-path>
                          Path to the folder containing the TestFlight configuration. (default:
                          ./config/apps)
  -h, --help              Show help information.

🔨 How To Test

As the command is unimplemented there is not much to test yet.

adamjcampbell commented 3 years ago

@DechengMa I have added CommandError it throws a much more ergonomic looking error now:

$ asc testflight sync pull

Error: This command has not been implemented
Program ended with exit code: 1