The Wayback Machine - https://web.archive.org/web/20221219222142/https://github.com/arduino/arduino-cli/pull/931
Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add archive command to zip a sketch and its files #931

Merged
merged 3 commits into from Sep 3, 2020

Conversation

silvanocerza
Copy link
Contributor

@silvanocerza silvanocerza commented Sep 1, 2020

Please check if the PR fulfills these requirements

  • The PR has no duplicates (please search among the Pull Requests
    before creating one)
  • The PR follows
    our contributing guidelines
  • Tests for the changes have been added (for bug fixes / features)
  • Docs have been added / updated (for bug fixes / features)
  • What kind of change does this PR introduce?
    New CLI command and new gRPC interface.
  • What is the current behavior?
    User can't create an archive of a Sketch from the CLI.
    gRPC consumer doesn't have an interface to archive a Sketch.
  • What is the new behavior?
    User can create a zip file containing all files from a Sketch, build directory is only included if explicitly specified with the --include-build-dir flag.

Some possible examples on how to call the command from the CLI:

arduino-cli archive
arduino-cli archive .
arduino-cli archive . <some_folder>
arduino-cli archive . <some_folder>/MySketchArchive.zip
arduino-cli archive <path_to_sketch>
arduino-cli archive <path_to_sketch> <some_folder>
arduino-cli archive <path_to_sketch> <some_folder>/MySketchArchive.zip
  • Does this PR introduce a breaking change?
    No.
  • Other information:
    None.

See how to contribute

@silvanocerza silvanocerza requested review from cmaglie, ubidefeo and rsora Sep 1, 2020
@silvanocerza silvanocerza self-assigned this Sep 1, 2020
@silvanocerza silvanocerza added the status: in progress Work is in progress on this label Sep 1, 2020
@silvanocerza silvanocerza removed the status: in progress Work is in progress on this label Sep 1, 2020
@silvanocerza silvanocerza force-pushed the scerza/archive-command branch 10 times, most recently from f6d0094 to 3fb2fab Compare Sep 2, 2020
@silvanocerza
Copy link
Contributor Author

silvanocerza commented Sep 3, 2020

Links check is failing again because of https://codecov.io/gh/arduino/arduino-cli, it seems to work finely on the browser for me though.
The rest of the tests are finally working too. 🎉

commands/instances.go Outdated Show resolved Hide resolved
Copy link
Member

@cmaglie cmaglie left a comment

I've made some suggestions to slightly simplify here and there.

I'm wondering if the case:

arduino-cli archive . /path/to/some/dir/name

should automatically infer that we mean /path/to/some/dir/name.zip when the name folder doesn't exists. Personally, if I don't specify explicitly .zip I would expect a /path/to/some/dir/name: directory does not exists, but I'll leave to @ubidefeo the last word on this.

commands/instances.go Outdated Show resolved Hide resolved
commands/instances.go Outdated Show resolved Hide resolved
rpc/commands/commands.proto Outdated Show resolved Hide resolved
test/conftest.py Show resolved Hide resolved
test/test_archive.py Outdated Show resolved Hide resolved
commands/instances.go Outdated Show resolved Hide resolved
@cmaglie
Copy link
Member

cmaglie commented Sep 3, 2020

Nice work BTW, especially on the tests!

cmaglie
cmaglie approved these changes Sep 3, 2020
Copy link
Member

@cmaglie cmaglie left a comment

👍

@silvanocerza silvanocerza merged commit b8cf32d into master Sep 3, 2020
1 check passed
@silvanocerza silvanocerza deleted the scerza/archive-command branch Sep 3, 2020
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

3 participants
Morty Proxy This is a proxified and sanitized view of the page, visit original site.