| 
									
										
										
										
											2015-01-19 17:06:29 -07:00
										 |  |  | #!/bin/bash
 | 
					
						
							|  |  |  | 
 | 
					
						
							| 
									
										
										
										
											2017-05-25 15:08:33 -06:00
										 |  |  | # Installs node.js + dependencies for both Ubuntu and OS X | 
					
						
							| 
									
										
										
										
											2015-01-20 23:17:31 -07:00
										 |  |  | 
 | 
					
						
							|  |  |  | # | 
					
						
							| 
									
										
										
										
											2017-04-06 20:19:16 -06:00
										 |  |  | # See https://git.daplie.com/coolaj86/node-install-script | 
					
						
							| 
									
										
										
										
											2015-01-20 23:17:31 -07:00
										 |  |  | # | 
					
						
							|  |  |  | 
 | 
					
						
							| 
									
										
										
										
											2017-05-25 15:08:33 -06:00
										 |  |  | # curl -fsSL https://example.com/setup.bash | bash | 
					
						
							|  |  |  | # wget -nv https://example.com/setup.bash -O - | bash | 
					
						
							| 
									
										
										
										
											2015-01-20 23:17:31 -07:00
										 |  |  | 
 | 
					
						
							| 
									
										
										
										
											2017-05-15 21:56:04 -06:00
										 |  |  | set -e | 
					
						
							|  |  |  | set -u | 
					
						
							|  |  |  | 
 | 
					
						
							| 
									
										
										
										
											2017-09-01 20:54:43 -06:00
										 |  |  | BASE_URL="https://git.daplie.com/Daplie/node-install-script/raw/master" | 
					
						
							| 
									
										
										
										
											2015-01-20 23:17:31 -07:00
										 |  |  | 
 | 
					
						
							|  |  |  | ####################### | 
					
						
							|  |  |  | # Download installers # | 
					
						
							|  |  |  | ####################### | 
					
						
							|  |  |  | 
 | 
					
						
							| 
									
										
										
										
											2017-05-25 15:08:33 -06:00
										 |  |  | INSTALL_FILE_REMOTE="setup.bash" | 
					
						
							|  |  |  | INSTALL_FILE="node.setup.bash" | 
					
						
							| 
									
										
										
										
											2016-03-28 15:50:12 -04:00
										 |  |  | if [ ! -e "/tmp/${INSTALL_FILE}" ] | 
					
						
							|  |  |  | then | 
					
						
							| 
									
										
										
										
											2017-05-25 15:08:33 -06:00
										 |  |  |   if [ -n "$(which curl)" ]; then | 
					
						
							|  |  |  |     curl --silent "${BASE_URL}/${INSTALL_FILE_REMOTE}" \
 | 
					
						
							|  |  |  |       -o "/tmp/${INSTALL_FILE}" || echo 'error setup script: '"${BASE_URL}/${INSTALL_FILE_REMOTE}" | 
					
						
							|  |  |  |   elif [ -n "$(which wget)" ]; then | 
					
						
							|  |  |  |     wget --quiet "${BASE_URL}/${INSTALL_FILE_REMOTE}" \
 | 
					
						
							|  |  |  |       -O "/tmp/${INSTALL_FILE}" || echo 'error setup script: '"${BASE_URL}/${INSTALL_FILE_REMOTE}" | 
					
						
							| 
									
										
										
										
											2016-03-28 15:50:12 -04:00
										 |  |  |   else | 
					
						
							|  |  |  |     echo "Found neither 'curl' nor 'wget'. Can't Continue." | 
					
						
							|  |  |  |     exit 1 | 
					
						
							|  |  |  |   fi | 
					
						
							|  |  |  | fi | 
					
						
							|  |  |  | 
 | 
					
						
							|  |  |  | if [ ! -e "/tmp/${INSTALL_FILE}" ] | 
					
						
							|  |  |  | then | 
					
						
							|  |  |  |   echo "Error Downloading Install File" | 
					
						
							| 
									
										
										
										
											2015-01-20 23:17:31 -07:00
										 |  |  |   exit 1 | 
					
						
							|  |  |  | fi | 
					
						
							|  |  |  | 
 | 
					
						
							| 
									
										
										
										
											2017-05-08 16:20:59 +00:00
										 |  |  | 
 | 
					
						
							| 
									
										
										
										
											2017-05-25 15:08:33 -06:00
										 |  |  | bash "/tmp/${INSTALL_FILE}" --no-dev-deps |