update mac/linux installer (and package fix)
This commit is contained in:
		
							parent
							
								
									dafc02201f
								
							
						
					
					
						commit
						33dd835092
					
				| @ -53,7 +53,7 @@ | |||||||
|   }, |   }, | ||||||
|   "homepage": "https://git.coolaj86.com/coolaj86/telebit.js#readme", |   "homepage": "https://git.coolaj86.com/coolaj86/telebit.js#readme", | ||||||
|   "dependencies": { |   "dependencies": { | ||||||
|     "@root/request": "^1.3.5", |     "@coolaj86/urequest": "^1.3.5", | ||||||
|     "finalhandler": "^1.1.1", |     "finalhandler": "^1.1.1", | ||||||
|     "greenlock": "^2.8.2", |     "greenlock": "^2.8.2", | ||||||
|     "js-yaml": "^3.11.0", |     "js-yaml": "^3.11.0", | ||||||
|  | |||||||
| @ -242,10 +242,14 @@ my_file="$my_dir.$archive_ext" | |||||||
| if [ -f "$HOME/Downloads/$my_file" ]; then | if [ -f "$HOME/Downloads/$my_file" ]; then | ||||||
|   my_size=$(($(wc -c < "$HOME/Downloads/$my_file"))) |   my_size=$(($(wc -c < "$HOME/Downloads/$my_file"))) | ||||||
|   if [ "$my_size" -eq "$size" ]; then |   if [ "$my_size" -eq "$size" ]; then | ||||||
|     echo "File exists in ~/Downloads, skipping download" |     echo "~/Downloads/ exists, skipping download" | ||||||
|   else |   else | ||||||
|     echo "Removing corrupt download '~/Downloads/$my_file'" |     echo "Removing corrupt download '~/Downloads/$my_file'" | ||||||
|     rm -f "$HOME/Downloads/$my_file" |     # change into $HOME because we don't ever want to perform | ||||||
|  |     # a destructive action on a variable we didn't set | ||||||
|  |     pushd "$HOME" | ||||||
|  |       rm -f "Downloads/$my_file" | ||||||
|  |     popd | ||||||
|   fi |   fi | ||||||
| fi | fi | ||||||
| 
 | 
 | ||||||
| @ -261,6 +265,33 @@ if [ ! -f "$HOME/Downloads/$my_file" ]; then | |||||||
| fi | fi | ||||||
| 
 | 
 | ||||||
| echo "Unpacking and installing Telebit ..." | echo "Unpacking and installing Telebit ..." | ||||||
| echo unarchiver $my_file $my_tmp | unarchiver "$HOME/Downloads/$my_file" "$my_tmp" | ||||||
| echo pushd $my_tmp/$my_dir | echo "extracting '$my_file' to '$my_tmp'" | ||||||
| echo bash ./setup.sh | 
 | ||||||
|  | # make sure that telebit is not in use | ||||||
|  | pushd "$my_tmp" > /dev/null | ||||||
|  |   ./bin/node ./bin/npm --scripts-prepend-node-path=true run preinstall | ||||||
|  | popd > /dev/null | ||||||
|  | 
 | ||||||
|  | # move only once there are not likely to be any open files | ||||||
|  | # (especially important on windows) | ||||||
|  | pushd "$HOME" > /dev/null | ||||||
|  |   if [ -e ".local/opt/telebit" ]; then | ||||||
|  |     mv ".local/opt/telebit" ".local/opt/telebit-old-$(date "+%s")" | ||||||
|  |   fi | ||||||
|  |   mv "$my_tmp" ".local/opt/telebit" | ||||||
|  | popd > /dev/null | ||||||
|  | 
 | ||||||
|  | # make sure that telebit is not in use | ||||||
|  | pushd "$HOME/.local/opt/telebit" > /dev/null | ||||||
|  |   ./node_modules/.bin/pathman add "$HOME/.local/opt/telebit/bin-public" > /dev/null | ||||||
|  |   ./bin/node ./bin/npm --scripts-prepend-node-path=true run postinstall | ||||||
|  | popd > /dev/null | ||||||
|  | 
 | ||||||
|  | echo "" | ||||||
|  | echo "" | ||||||
|  | echo "" | ||||||
|  | echo "Open a new terminal and run the following:" | ||||||
|  | echo "" | ||||||
|  | printf "\ttelebit init" | ||||||
|  | echo "" | ||||||
|  | |||||||
		Loading…
	
	
			
			x
			
			
		
	
		Reference in New Issue
	
	Block a user