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

Added zip feature and more code refactoring #4

Merged
merged 11 commits into from May 25, 2022

Conversation

winterrdog
Copy link
Contributor

Hey @alok8bb ,

As I'd promised earlier, this is my first iteration on creating the zip feature. You can try to test it and lemme know if nothing's broken. Added some more features like allowing the user to download multiple URLs. You can look at the commits if you want more details on that

@alok8bb
Copy link
Owner

alok8bb commented May 25, 2022

Hello @winterrdog, Sorry for the delay. I tested the build and the multiple URLs feature works perfectly. The zip feature didn't work for me, there was missing field name at line 1 column 279 error while downloading the directories. I think that is a bug because now I'm getting the same error while cloning any directory as well, and If I remember correctly, I've encountered this error before too. I got this error after successfully cloning some directories, I used the same URL to clone and it worked perfectly right after compiling but after some time I started getting the same error for every single URL.

 cloneit https://github.com/alok8bb/BMI-Calculator-Android

            Getting: "https://github.com/alok8bb/BMI-Calculator-Android"
[1/3] 🔍  Validating url...
[2/3] 🚚  Downloading...
missing field `name` at line 1 column 279

        [+] Downloaded 1 file(s).

@alok8bb alok8bb merged commit f260b2a into alok8bb:master May 25, 2022
@winterrdog
Copy link
Contributor Author

Hey @alok8bb , I'll definitely check that out. Thanks for the response and effort to try out the PR . I'll be updating you soon

@winterrdog
Copy link
Contributor Author

winterrdog commented May 25, 2022

I used the same URL to clone and it worked perfectly right after compiling but after some time I started getting the same error for every single URL.

Maybe it's the github.com or serde_json API frustrating our efforts🤔. Lemme carry out some more research.

@winterrdog
Copy link
Contributor Author

winterrdog commented May 25, 2022

 cloneit https://github.com/alok8bb/BMI-Calculator-Android

        Getting: "https://github.com/alok8bb/BMI-Calculator-Android"

[1/3] 🔍 Validating url...
[2/3] 🚚 Downloading...
missing field name at line 1 column 279

    [+] Downloaded 1 file(s).

Woo! You do Java!? 😬 😬
😅😅🙌.

Anyways... after sometime that URL worked and got some Java that i quickly evaded!😅

this is what showed up(with the -z flag added):

$ cargo r -- -z https://github.com/alok8bb/BMI-Calculator-Android                                                                                  
    Finished dev [unoptimized + debuginfo] target(s) in 0.05s
     Running `target/debug/cloneit -z 'https://github.com/alok8bb/BMI-Calculator-Android'`

            Getting: "https://github.com/alok8bb/BMI-Calculator-Android"
[1/3] Validating url...
[2/3] Downloading...
  [00:00:00] [------------------------------------------------------------] 225B/225B .gitignore
  [00:00:00] [------------------------------------------------------------] 47B/47B .gitignore
  [00:00:00] [------------------------------------------------------------] 8B/8B .name
  [00:00:00] [------------------------------------------------------------] 4.36KiB/4.36KiB Project.xml
  [00:00:00] [------------------------------------------------------------] 142B/142B codeStyleConfig.xml
  [00:00:00] [------------------------------------------------------------] 170B/170B compiler.xml
  [00:00:00] [------------------------------------------------------------] 943B/943B gradle.xml
  [00:00:00] [------------------------------------------------------------] 1.21KiB/1.21KiB jarRepositories.xml
  [00:00:00] [------------------------------------------------------------] 372B/372B misc.xml
  [00:00:00] [------------------------------------------------------------] 180B/180B vcs.xml
  [00:00:00] [------------------------------------------------------------] 814B/814B README.md
  [00:00:00] [------------------------------------------------------------] 6B/6B .gitignore
  [00:00:00] [------------------------------------------------------------] 1.41KiB/1.41KiB build.gradle
  [00:00:00] [------------------------------------------------------------] 750B/750B proguard-rules.pro
  [00:00:00] [------------------------------------------------------------] 665B/665B ExampleInstrumentedTest.kt
  [00:00:00] [------------------------------------------------------------] 770B/770B AndroidManifest.xml
  [00:00:00] [------------------------------------------------------------] 4.05KiB/4.05KiB MainActivity.kt
  [00:00:00] [------------------------------------------------------------] 1.64KiB/1.64KiB ResultActivity.kt
  [00:00:00] [------------------------------------------------------------] 1.66KiB/1.66KiB ic_launcher_foreground.xml
  [00:00:00] [------------------------------------------------------------] 315B/315B ic_baseline_add_24.xml
  [00:00:00] [------------------------------------------------------------] 297B/297B ic_baseline_remove_24.xml
  [00:00:00] [------------------------------------------------------------] 441B/441B ic_gender_female.xml
  [00:00:00] [------------------------------------------------------------] 470B/470B ic_gender_male.xml
  [00:00:00] [------------------------------------------------------------] 5.47KiB/5.47KiB ic_launcher_background.xml
  [00:00:00] [------------------------------------------------------------] 746B/746B poppins.xml
  [00:00:00] [------------------------------------------------------------] 376B/376B poppins_bold.xml
  [00:00:00] [------------------------------------------------------------] 376B/376B poppins_light.xml
  [00:00:00] [------------------------------------------------------------] 376B/376B poppins_medium.xml
  [00:00:00] [------------------------------------------------------------] 356B/356B poppins_regular.xml
  [00:00:00] [------------------------------------------------------------] 376B/376B poppins_semibold.xml
  [00:00:00] [------------------------------------------------------------] 12.51KiB/12.51KiB activity_main.xml
  [00:00:00] [------------------------------------------------------------] 3.05KiB/3.05KiB activity_result.xml
  [00:00:00] [------------------------------------------------------------] 639B/639B custom_appbar.xml
  [00:00:00] [------------------------------------------------------------] 272B/272B ic_launcher.xml
  [00:00:00] [------------------------------------------------------------] 272B/272B ic_launcher_round.xml
  [00:00:00] [------------------------------------------------------------] 3.51KiB/3.51KiB ic_launcher.png
  [00:00:00] [------------------------------------------------------------] 5.21KiB/5.21KiB ic_launcher_round.png
  [00:00:00] [------------------------------------------------------------] 2.57KiB/2.57KiB ic_launcher.png
  [00:00:00] [------------------------------------------------------------] 3.31KiB/3.31KiB ic_launcher_round.png
  [00:00:00] [------------------------------------------------------------] 4.81KiB/4.81KiB ic_launcher.png
  [00:00:00] [------------------------------------------------------------] 7.30KiB/7.30KiB ic_launcher_round.png
  [00:00:00] [------------------------------------------------------------] 7.72KiB/7.72KiB ic_launcher.png
  [00:00:00] [------------------------------------------------------------] 11.59KiB/11.59KiB ic_launcher_round.png
  [00:00:00] [------------------------------------------------------------] 10.40KiB/10.40KiB ic_launcher.png
  [00:00:00] [------------------------------------------------------------] 16.18KiB/16.18KiB ic_launcher_round.png
  [00:00:00] [------------------------------------------------------------] 779B/779B strings.xml
  [00:00:00] [------------------------------------------------------------] 1003B/1003B themes.xml
  [00:00:00] [------------------------------------------------------------] 810B/810B colors.xml
  [00:00:00] [------------------------------------------------------------] 3.50KiB/3.50KiB font_certs.xml
  [00:00:00] [------------------------------------------------------------] 786B/786B strings.xml
  [00:00:00] [------------------------------------------------------------] 1003B/1003B themes.xml
  [00:00:00] [------------------------------------------------------------] 343B/343B ExampleUnitTest.kt
  [00:00:00] [------------------------------------------------------------] 642B/642B build.gradle
  [00:00:00] [------------------------------------------------------------] 1.16KiB/1.16KiB gradle.properties
  [00:00:00] [------------------------------------------------------------] 53.06KiB/53.06KiB gradle-wrapper.jar
  [00:00:00] [------------------------------------------------------------] 230B/230B gradle-wrapper.properties
  [00:00:00] [------------------------------------------------------------] 5.17KiB/5.17KiB gradlew
  [00:00:00] [------------------------------------------------------------] 2.21KiB/2.21KiB gradlew.bat
  [00:00:00] [------------------------------------------------------------] 44B/44B settings.gradle
[3/3] Downloaded Successfully.

without the -z flag:

$ cargo r -- https://github.com/alok8bb/BMI-Calculator-Android 
    Finished dev [unoptimized + debuginfo] target(s) in 0.04s
     Running `target/debug/cloneit 'https://github.com/alok8bb/BMI-Calculator-Android'`

            Getting: "https://github.com/alok8bb/BMI-Calculator-Android"
[1/3] Validating url...
[2/3] Downloading...
  [00:00:00] [------------------------------------------------------------] 225B/225B .gitignore
  [00:00:00] [------------------------------------------------------------] 47B/47B .gitignore
  [00:00:00] [------------------------------------------------------------] 8B/8B .name
  [00:00:00] [------------------------------------------------------------] 4.36KiB/4.36KiB Project.xml
  [00:00:00] [------------------------------------------------------------] 142B/142B codeStyleConfig.xml
  [00:00:00] [------------------------------------------------------------] 170B/170B compiler.xml
  [00:00:00] [------------------------------------------------------------] 943B/943B gradle.xml
  [00:00:00] [------------------------------------------------------------] 1.21KiB/1.21KiB jarRepositories.xml
  [00:00:00] [------------------------------------------------------------] 372B/372B misc.xml
  [00:00:00] [------------------------------------------------------------] 180B/180B vcs.xml
  [00:00:00] [------------------------------------------------------------] 814B/814B README.md
  [00:00:00] [------------------------------------------------------------] 6B/6B .gitignore
  [00:00:00] [------------------------------------------------------------] 1.41KiB/1.41KiB build.gradle
  [00:00:00] [------------------------------------------------------------] 750B/750B proguard-rules.pro
  [00:00:00] [------------------------------------------------------------] 665B/665B ExampleInstrumentedTest.kt
  [00:00:00] [------------------------------------------------------------] 770B/770B AndroidManifest.xml
  [00:00:00] [------------------------------------------------------------] 4.05KiB/4.05KiB MainActivity.kt
  [00:00:00] [------------------------------------------------------------] 1.64KiB/1.64KiB ResultActivity.kt
  [00:00:00] [------------------------------------------------------------] 1.66KiB/1.66KiB ic_launcher_foreground.xml
  [00:00:00] [------------------------------------------------------------] 315B/315B ic_baseline_add_24.xml
  [00:00:00] [------------------------------------------------------------] 297B/297B ic_baseline_remove_24.xml
  [00:00:00] [------------------------------------------------------------] 441B/441B ic_gender_female.xml
  [00:00:00] [------------------------------------------------------------] 470B/470B ic_gender_male.xml
  [00:00:00] [------------------------------------------------------------] 5.47KiB/5.47KiB ic_launcher_background.xml
  [00:00:00] [------------------------------------------------------------] 746B/746B poppins.xml
  [00:00:00] [------------------------------------------------------------] 376B/376B poppins_bold.xml
  [00:00:00] [------------------------------------------------------------] 376B/376B poppins_light.xml
  [00:00:00] [------------------------------------------------------------] 376B/376B poppins_medium.xml
  [00:00:00] [------------------------------------------------------------] 356B/356B poppins_regular.xml
  [00:00:00] [------------------------------------------------------------] 376B/376B poppins_semibold.xml
  [00:00:00] [------------------------------------------------------------] 12.51KiB/12.51KiB activity_main.xml
  [00:00:00] [------------------------------------------------------------] 3.05KiB/3.05KiB activity_result.xml
  [00:00:00] [------------------------------------------------------------] 639B/639B custom_appbar.xml
  [00:00:00] [------------------------------------------------------------] 272B/272B ic_launcher.xml
  [00:00:00] [------------------------------------------------------------] 272B/272B ic_launcher_round.xml
  [00:00:00] [------------------------------------------------------------] 3.51KiB/3.51KiB ic_launcher.png
  [00:00:01] [------------------------------------------------------------] 5.21KiB/5.21KiB ic_launcher_round.png
missing field `name` at line 1 column 279

        [+] Downloaded 1 file(s).

lemme keep troubleshooting that 1.

@winterrdog
Copy link
Contributor Author

winterrdog commented May 25, 2022

there was missing field name at line 1 column 279 error while downloading the directories. I think that is a bug because now I'm getting the same error while cloning any directory as well, and If I remember correctly, I've encountered this error before too.

It's caused by serde_json's failure to correctly parse the json sent by the github.com api

Check this out

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