mirror of
				https://github.com/zulip/zulip.git
				synced 2025-10-30 19:43:47 +00:00 
			
		
		
		
	tools: Modify update-locked-requirements to take optional arguments.
				
					
				
			This commit modifies the `update-locked-requirements` tool to take output file path as optional arguments.
This commit is contained in:
		
				
					committed by
					
						 Tim Abbott
						Tim Abbott
					
				
			
			
				
	
			
			
			
						parent
						
							539ff20ec2
						
					
				
				
					commit
					0391619f48
				
			| @@ -40,5 +40,30 @@ EOF | |||||||
|     ) | sponge "$output" |     ) | sponge "$output" | ||||||
| } | } | ||||||
|  |  | ||||||
| compile_requirements requirements/prod.txt requirements/prod_lock.txt | OUTPUT_PROD_FILE='requirements/prod_lock.txt' | ||||||
| compile_requirements requirements/dev.txt requirements/dev_lock.txt | OUTPUT_DEV_FILE='requirements/dev_lock.txt' | ||||||
|  |  | ||||||
|  | # Parse arguments. | ||||||
|  | if [ $# -gt 0 ]; then | ||||||
|  |     while [ "$1" != "" ]; do | ||||||
|  |         case $1 in | ||||||
|  |             --prod) | ||||||
|  |                 shift | ||||||
|  |                 OUTPUT_PROD_FILE="$1" | ||||||
|  |                 ;; | ||||||
|  |             --dev) | ||||||
|  |                 shift | ||||||
|  |                 OUTPUT_DEV_FILE="$1" | ||||||
|  |                 ;; | ||||||
|  |             *) | ||||||
|  |                 echo "Invalid arguments passed." | ||||||
|  |                 echo "Usage: $0 [--prod <prod-lock-file-path> --dev <dev-lock-file-path>]" | ||||||
|  |                 exit | ||||||
|  |                 ;; | ||||||
|  |         esac | ||||||
|  |         shift | ||||||
|  |     done | ||||||
|  | fi | ||||||
|  |  | ||||||
|  | compile_requirements requirements/prod.txt $OUTPUT_PROD_FILE | ||||||
|  | compile_requirements requirements/dev.txt $OUTPUT_DEV_FILE | ||||||
|   | |||||||
		Reference in New Issue
	
	Block a user