You've already forked joplin
							
							
				mirror of
				https://github.com/laurent22/joplin.git
				synced 2025-10-31 00:07:48 +02:00 
			
		
		
		
	Linux: Allow downloading pre-release versions from install script (#3335)
This commit is contained in:
		
				
					committed by
					
						 GitHub
						GitHub
					
				
			
			
				
	
			
			
			
						parent
						
							005bfe799c
						
					
				
				
					commit
					3f7390d104
				
			| @@ -12,6 +12,7 @@ COLOR_RESET=`tput sgr0` | ||||
| SILENT=false | ||||
| ALLOW_ROOT=false | ||||
| SHOW_CHANGELOG=false | ||||
| INCLUDE_PRE_RELEASE=false | ||||
|  | ||||
| print() { | ||||
|     if [[ "${SILENT}" == false ]] ; then | ||||
| @@ -40,6 +41,7 @@ showHelp() { | ||||
|     print "\t" "--changelog" "\t" "Show the changelog after installation" | ||||
|     print "\t" "--force" "\t" "Always download the latest version" | ||||
|     print "\t" "--silent" "\t" "Don't print any output" | ||||
|     print "\t" "--prerelease" "\t" "Check for new Versions including Pre-Releases"  | ||||
|  | ||||
|     if [[ ! -z $1 ]]; then | ||||
|         print "\n" "${COLOR_RED}ERROR: " "$*" "${COLOR_RESET}" "\n" | ||||
| @@ -67,6 +69,7 @@ while getopts "${optspec}" OPT; do | ||||
|     silent )       SILENT=true ;; | ||||
|     force )        FORCE=true ;; | ||||
|     changelog )    SHOW_CHANGELOG=true ;; | ||||
|     prerelease )   INCLUDE_PRE_RELEASE=true ;; | ||||
|     [^\?]* )       showHelp "Illegal option --${OPT}"; exit 2 ;; | ||||
|     \? )           showHelp "Illegal option -${OPTARG}"; exit 2 ;; | ||||
|   esac | ||||
| @@ -104,7 +107,11 @@ fi | ||||
| #----------------------------------------------------- | ||||
|  | ||||
| # Get the latest version to download | ||||
| if [[ "$INCLUDE_PRE_RELEASE" == true ]]; then | ||||
|   RELEASE_VERSION=$(wget -qO - "https://api.github.com/repos/laurent22/joplin/releases" | grep -Po '"tag_name": ?"v\K.*?(?=")' | head -1) | ||||
| else | ||||
|   RELEASE_VERSION=$(wget -qO - "https://api.github.com/repos/laurent22/joplin/releases/latest" | grep -Po '"tag_name": ?"v\K.*?(?=")') | ||||
| fi | ||||
|  | ||||
| # Check if it's in the latest version | ||||
| if [[ -e ~/.joplin/VERSION ]] && [[ $(< ~/.joplin/VERSION) == "${RELEASE_VERSION}" ]]; then | ||||
|   | ||||
		Reference in New Issue
	
	Block a user