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

Enhance lib install from git url and zip file #1145

Merged
merged 1 commit into from
Jan 20, 2021

Conversation

silvanocerza
Copy link
Contributor

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)
  • UPGRADING.md has been updated with a migration guide (for breaking changes)
  • What kind of change does this PR introduce?

Enhances the behaviour of lib install when using the --git-url or --zip-file flags.

  • What is the current behavior?

Previously installing from a zip file would extract the content directly into the user library folder, this could have caused problem if the zip file wasn't structured correctly.

Installing from a git repository would clone the repo directly to the user library folder and leave it as it is. Also it would fail if the library is already installed and would not reinstall it.

  • What is the new behavior?

When using the --zip-file flag we now extract to a temp directory to verify that the zip is structured correctly and to infer the name of the library being installed. If everything is fine we then copy it over to the user library folder to finalize the installation.

When using the --git-url flag after cloning the repository to the user library folder we delete the .git folder to make it a plain folder. Cloning should be faster too since we now clone using depth of one commit to avoid downloading useless files.

Both when installing from a zip file or from a git repository we delete the installed library folder if one with the same name is already installed. This fixes failures when trying to install with --git-url an already installed library.

Nope.

  • Other information:

None.


See how to contribute

Previously installing from a zip file would extract the content directly
into the user library folder, this could have caused problem if the zip
file wasn't structured correctly.

To handle this we now extract to a temp directory to verify that the zip
is structured correctly and to infer the name of the library being
installed. If everything is fine we then copy it over to the user
library folder to finalize the installation.

Installing from a git repository has been enhanced too, after
cloning the repository to the user library folder we delete the .git
folder to make it a plain folder. Cloning should be faster too since we
now clone using depth of one commit to avoid downloading useless files.

Both when installing from a zip file or from a git repository we delete
the installed library folder if one with the same name is already
installed.
Copy link

@ubidefeo ubidefeo left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

tested and working

@silvanocerza silvanocerza merged commit c8f9efb into master Jan 20, 2021
@silvanocerza silvanocerza deleted the scerza/lib-install-git-failure branch January 20, 2021 16:51
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

2 participants