| 
									
										
										
										
											2022-10-27 09:18:49 +01:00
										 |  |  | #!/bin/bash
 | 
					
						
							|  |  |  | set -e | 
					
						
							|  |  |  | 
 | 
					
						
							| 
									
										
										
										
											2022-10-31 16:58:58 +00:00
										 |  |  | # fix permissions so Homebrew and Bundler don't complain | 
					
						
							|  |  |  | sudo chmod -R g-w,o-w /home/linuxbrew | 
					
						
							| 
									
										
										
										
											2025-03-19 08:57:13 +00:00
										 |  |  | sudo chmod +t -R /home/linuxbrew/ | 
					
						
							| 
									
										
										
										
											2022-10-31 16:58:58 +00:00
										 |  |  | 
 | 
					
						
							| 
									
										
										
										
											2022-11-09 14:45:43 +00:00
										 |  |  | # everything below is too slow to do unless prebuilding so skip it | 
					
						
							| 
									
										
										
										
											2022-11-09 17:29:38 +00:00
										 |  |  | CODESPACES_ACTION_NAME="$(jq --raw-output '.ACTION_NAME' /workspaces/.codespaces/shared/environment-variables.json)" | 
					
						
							|  |  |  | if [[ "${CODESPACES_ACTION_NAME}" != "createPrebuildTemplate" ]] | 
					
						
							|  |  |  | then | 
					
						
							| 
									
										
										
										
											2022-11-09 15:38:40 +00:00
										 |  |  |   echo "Skipping slow items, not prebuilding." | 
					
						
							| 
									
										
										
										
											2022-11-09 14:45:43 +00:00
										 |  |  |   exit 0 | 
					
						
							|  |  |  | fi | 
					
						
							|  |  |  | 
 | 
					
						
							| 
									
										
										
										
											2022-10-31 16:58:58 +00:00
										 |  |  | # install Homebrew's development gems | 
					
						
							| 
									
										
										
										
											2023-09-04 21:52:51 +01:00
										 |  |  | brew install-bundler-gems --groups=all | 
					
						
							| 
									
										
										
										
											2022-10-31 16:58:58 +00:00
										 |  |  | 
 | 
					
						
							|  |  |  | # install Homebrew formulae we might need | 
					
						
							|  |  |  | brew install shellcheck shfmt gh gnu-tar | 
					
						
							|  |  |  | 
 | 
					
						
							|  |  |  | # cleanup any mess | 
					
						
							|  |  |  | brew cleanup | 
					
						
							|  |  |  | 
 | 
					
						
							| 
									
										
										
										
											2023-01-25 16:05:02 +00:00
										 |  |  | # actually tap homebrew/core, no longer done by default | 
					
						
							| 
									
										
										
										
											2024-02-19 18:41:24 +00:00
										 |  |  | brew tap --force homebrew/core | 
					
						
							| 
									
										
										
										
											2023-01-25 16:05:02 +00:00
										 |  |  | 
 | 
					
						
							| 
									
										
										
										
											2022-10-31 16:58:58 +00:00
										 |  |  | # install some useful development things | 
					
						
							| 
									
										
										
										
											2022-10-27 09:18:49 +01:00
										 |  |  | sudo apt-get update | 
					
						
							| 
									
										
										
										
											2022-11-09 17:29:38 +00:00
										 |  |  | 
 | 
					
						
							|  |  |  | apt_get_install() { | 
					
						
							|  |  |  |   sudo apt-get install -y \
 | 
					
						
							|  |  |  |     -o Dpkg::Options::=--force-confdef \
 | 
					
						
							|  |  |  |     -o Dpkg::Options::=--force-confnew \
 | 
					
						
							|  |  |  |     "$@" | 
					
						
							|  |  |  | } | 
					
						
							|  |  |  | 
 | 
					
						
							|  |  |  | apt_get_install \
 | 
					
						
							|  |  |  |   openssh-server \
 | 
					
						
							|  |  |  |   zsh | 
					
						
							| 
									
										
										
										
											2022-11-07 16:36:57 +00:00
										 |  |  | 
 | 
					
						
							| 
									
										
										
										
											2022-11-01 22:55:42 +00:00
										 |  |  | # Start the SSH server so that `gh cs ssh` works. | 
					
						
							|  |  |  | sudo service ssh start |