Bug in Lterm Project (Fixed)

in #utopian-io7 years ago (edited)

Lterm is a NJACK Winter of Code project. NWoC is a program that helps students understand the paradigm of Open Source contribution and gives them real world software development experience.
Now, something about the project :- Its a Terminal like copy but for Website, Pretty neat eh ?
screenshot from 2018-01-01 06-15-08
screenshot from 2018-01-01 06-15-36
At first i checked the project it was pretty cool so i tried more commands, as you can see after you execute every command and press help it shows completed and not completed , probably an array of all the items with a [0,1] value for not completed and completed.
3
Everything worked great but, When i executed the clear command which didnt show "completed" after i execute it. it was a BUG . i forked the project and went into the codebase :-

  • Reading the development section of documentation i knew i had to check the js/main.js
    4
  • i knew they would be having an array arr for checking if the command is executed or not, initially the value was 0.
    5
  • They changed the value to 1 on every execution like this :- arr[6]=1;
    6
  • they had a correct implementation of "clear" command which works with "Clear" aswell.
    7
    Then, Why didn't it worked ? i thought about it a bit, then saw that they didnt had implemented the functionality of "clear" command but somehow it worked when i executed, that means there must be some other file which is doing all the ground work. Soon enough i checked the index.html and checked all the linked js files
    8
    There was this file terminal.min.js which was interesting, i looked into it and searched "clear:function(){" and got the root of the problem :D
    noname
    Then, i added the arr[9]=1; but it still didnt worked like i wanted.. hmm what could be the problem this time ?
    10
    Maybe the file is not able to access arr ? But it's declared var arr It should be global, i searched on StackOverflow and found an alternative, window.arr could also make a variable globally accessible. Hmm let's try it in the main.js file
    11
    And Violla executing the clear or Clear command works just as it should be.
    12
    13
    Here's My PR for the related bug :- PR
    Thankyou for reading, If you liked it please press the thumbs up :+1:
    Always Keep Sharing, Keep Exploring :)
    Have a Nice day and a Happy New Year!!



Posted on Utopian.io - Rewarding Open Source Contributors

Sort:  

Hello sachincool,

@SteemEngineTeam would like to take the time to thank you for signing up and participating in our community. Your contributions and support are important to us and we hope you will continue to use our platform.

We plan to give back to our community members, so have an upvote on us

Thank you.

P.s for Mods I didn't knew whether to post it under "Bug " or "Development". if i took the wrong choice feel free to mention it in the reviews :)

Thats a nice project!

Thank you for the contribution. It has been approved.

To answer your question, you could have posted in either category - this one is perfectly fine! Good find, and nice fix.

You can contact us on Discord.
[utopian-moderator]

Hey @sachincool I am @utopian-io. I have just upvoted you!

Achievements

  • You have less than 500 followers. Just gave you a gift to help you succeed!
  • Seems like you contribute quite often. AMAZING!

Suggestions

  • Contribute more often to get higher and higher rewards. I wish to see you often!
  • Work on your followers to increase the votes/rewards. I follow what humans do and my vote is mainly based on that. Good luck!

Get Noticed!

  • Did you know project owners can manually vote with their own voting power or by voting power delegated to their projects? Ask the project owner to review your contributions!

Community-Driven Witness!

I am the first and only Steem Community-Driven Witness. Participate on Discord. Lets GROW TOGETHER!

mooncryption-utopian-witness-gif

Up-vote this comment to grow my power and help Open Source contributions like this one. Want to chat? Join me on Discord https://discord.gg/Pc8HG9x