purplesyringa / win-sudo

Add `sudo` command to Git Bash
MIT License
183 stars 55 forks source link

install.sh : sparse-checkout and automatic PATH set (revised...again) (UNDER COMPRESSION) #18

Closed DemonixCraft closed 6 years ago

DemonixCraft commented 6 years ago

For the install of win-sudo, I propose that we take a different course of action, 'sparse-checkout'. Unlike 'git clone', which I have tried before on a previous PR, sparse-checkout allows the user to install sub-directories in a git repo, meaning that instead of installing the project to /tmp, moving all of the 'sudo' files to /bin, and then removing the project, now we can use a simpler-ish method of grabbing the 's' folder from the git repo and installing it to /bin. Even better, I'm super close to finishing my PATH line so the $PATH variable can be set directly from script. I also removed some extra code that wasn't required for the install(Refer to my previous Closed PR).

All that is required for my commit to be finished is the following :

And then this commit will work. Testing is still being done but I should be finished in about 2-3 days if I have a lot of time.

Any and all feedback would be appreciated. Also if you would like to help me you could do the following :

  1. Run curl -s https://raw.githubusercontent.com/DemonixCraft/win-sudo/Master/install.sh | sh in Git Bash
  2. Comment the output with the commit ID you installed it with

Thanks!

IMPORTANT NOTE : DO NOT USE COMMIT b563192!!!! How to fix error :

  1. Navigate to your /c/Users/[User] folder
  2. Delete .bashrc, .bash_history, and any other suspicious files
purplesyringa commented 6 years ago

Is this ready to be merged?

DemonixCraft commented 6 years ago

No it isn't, sadly :(

Still working on it

DemonixCraft commented 6 years ago

Okay, I found a way to make to $PATH variable work. I just need to see if it appends to the $PATH variable and doesn't just overwrite it. I'm working on compressing the code, or combining the lines into longer lines so multiple actions can be performed at once. I'm also going to check if sparse-checkout needs ORIGIN or '.git' so I can compress the project back into ~50 objects instead of ~800, and then I'll check if I can silence some of the actions. NOTE : The project WORKS, but may be unstable at the moment. When I tried to use the installation command again it outputted that the curl and sh commands were not found. This only happened once but I'm looking into the issue.

For compression I just need to see what lines are and aren't required, which lines do and don't go together, and which lines can be silenced.

Sorry this has taken so long but this complete change of theme for this file does take time unfortunately, and each Test Install requires me to delete and reinstall certain files that are messed up in the process.