mirror of
				https://github.com/optim-enterprises-bv/vault.git
				synced 2025-11-01 02:57:59 +00:00 
			
		
		
		
	build: try creating the go bin directory (#19862)
* Try creating the output directory to ensure it always exists * Use GOBIN path over GOPATH/bin if it is set
This commit is contained in:
		
							
								
								
									
										3
									
								
								changelog/19862.txt
									
									
									
									
									
										Normal file
									
								
							
							
						
						
									
										3
									
								
								changelog/19862.txt
									
									
									
									
									
										Normal file
									
								
							| @@ -0,0 +1,3 @@ | |||||||
|  | ```release-note:improvement | ||||||
|  | build: Prefer GOBIN when set over GOPATH/bin when building the binary | ||||||
|  | ``` | ||||||
| @@ -50,11 +50,13 @@ ${GO_CMD} build \ | |||||||
|  |  | ||||||
| # Move all the compiled things to the $GOPATH/bin | # Move all the compiled things to the $GOPATH/bin | ||||||
| OLDIFS=$IFS | OLDIFS=$IFS | ||||||
| IFS=: MAIN_GOPATH=($GOPATH) | IFS=: FIRST=($GOPATH) BIN_PATH=${GOBIN:-${FIRST}/bin} | ||||||
| IFS=$OLDIFS | IFS=$OLDIFS | ||||||
|  |  | ||||||
| rm -f ${MAIN_GOPATH}/bin/vault | # Ensure the go bin folder exists | ||||||
| cp bin/vault ${MAIN_GOPATH}/bin/ | mkdir -p ${BIN_PATH} | ||||||
|  | rm -f ${BIN_PATH}/vault | ||||||
|  | cp bin/vault ${BIN_PATH} | ||||||
|  |  | ||||||
| # Done! | # Done! | ||||||
| echo | echo | ||||||
|   | |||||||
		Reference in New Issue
	
	Block a user
	 Robert
					Robert