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

fix: Allow filename starting with "http(s)://" while keeping an URL checking #318

Merged
merged 1 commit into from
Oct 19, 2021

Conversation

dduportal
Copy link
Contributor

This PR ensures that the plugins "file" and "yaml" are able to read/write files which names starts with http:// or even https://, while keeping the auto-detection of URL location vs. file path.

  • A new core package is added, named text, to treat all the read, write, diff, etc. operations outside the plugins (so that the 2 plugins does not depend on each other)

    • A new "ReadLine" method is added to allow extracting only a line from a text file (either URL or file) without loading it all on memory
  • The method isURL (migrated in the text package):

    • Is used everywhere a hasprefix checking for http / https is used
    • checks if the file exists before trying to URL parse

@dduportal dduportal requested a review from olblak October 19, 2021 05:54
@dduportal dduportal added bug Something isn't working condition Modify condition resource resource-file Resource of kind File resource-yaml Resource of kind YAML source target Related to updatecli target labels Oct 19, 2021
…hecking

Signed-off-by: Damien Duportal <damien.duportal@gmail.com>
@olblak olblak enabled auto-merge (squash) October 19, 2021 08:18
@olblak olblak merged commit c7ea707 into updatecli:main Oct 19, 2021
@dduportal dduportal deleted the fix/uri-file-detection branch October 19, 2021 09:00
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working condition Modify condition resource resource-file Resource of kind File resource-yaml Resource of kind YAML source target Related to updatecli target
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

2 participants