Bash script to download files from github






















So outputting to - will actually write the files content to STDOUT and then you simply pipe it to bash or whatever shell you prefer. If you script needs sudo rights you need to do sudo bash at the end so the line becomes:. Found it here: passing parameters to bash when executing a script fetched by curl. Ubuntu Community Ask! Sign up to join this community. The best answers are voted up and rise to the top. Stack Overflow for Teams — Collaborate and share knowledge with a private group.

Create a free Team What is Teams? Learn more. How to execute a Bash script from Github? Ask Question. Asked 3 years, 10 months ago.

Active 1 year, 6 months ago. Viewed 19k times. Arcticooling Arcticooling 3 3 gold badges 16 16 silver badges 24 24 bronze badges. As you are putting this script up on github, consider! Add a comment. Active Oldest Votes. If - is used as file, documents will be printed to standard output, disabling link conversion. Videonauth Videonauth What about params? You may use following command to pass in the parameters bash -s Found it here: passing parameters to bash when executing a script fetched by curl.

Kulfy Sign up or log in Sign up using Google. I was thinking that perhaps wget could work, but it did not feel very robust to include the urls to the raw file page at github; if I rename the file I suppose I have to update the code as well. At least my current solution is robust as long as the github link does not change. Based on Kent's solution, I have defined a function that updates my scripts.

To avoid any issues with symlinks, I just unlink everything and relink. Since you said you will not change the files on that machine, there won't be conflicts. For the scripts files. Don't do cp , instead, create symbolic links ln -s to your target directory.

Stack Overflow for Teams — Collaborate and share knowledge with a private group. Create a free Team What is Teams? Collectives on Stack Overflow. Learn more. How to automatically download files from github without copying the repository Ask Question. Asked 3 years ago. Active 3 years ago. Viewed 3k times. Code in my. Improve this question. Yoda Yoda 9 9 silver badges 17 17 bronze badges. Add a comment. Active Oldest Votes.

Improve this answer. Kent Kent k 30 30 gold badges silver badges bronze badges. But I agree it is better than my previous solution. Yoda can you tell a bit why you want to avoid the whole repo? If it contains sensitive data, you had clone script in your bashrc, it is anyway not safe.

If it is big one, the pull is much faster than clone — Kent. One of the first things I did after the new solution was to edit one of the files If I bypassed the repository, I feel it would easier to correct something if I edited the remote files.

I would just re-download and overwrite them. I dont have sensitive data or anything like that, it was just because of my lack of self discipline to not edit the remote files.



0コメント

  • 1000 / 1000