mirror of
				https://github.com/zulip/zulip.git
				synced 2025-11-04 05:53:43 +00:00 
			
		
		
		
	/bin/sh and /usr/bin/env are the only two binaries that NixOS provides at a fixed path (outside a buildFHSUserEnv sandbox). This discussion was split from #11004. Signed-off-by: Anders Kaseorg <andersk@mit.edu>
		
			
				
	
	
		
			15 lines
		
	
	
		
			461 B
		
	
	
	
		
			Bash
		
	
	
		
			Executable File
		
	
	
	
	
			
		
		
	
	
			15 lines
		
	
	
		
			461 B
		
	
	
	
		
			Bash
		
	
	
		
			Executable File
		
	
	
	
	
#!/usr/bin/env bash
 | 
						|
set -eu
 | 
						|
 | 
						|
version=0.6.0
 | 
						|
 | 
						|
if ! out="$(shellcheck --version 2>/dev/null)" || [[ "$out" != *"
 | 
						|
version: $version
 | 
						|
"* ]]; then
 | 
						|
    tmpdir="$(mktemp -d)"
 | 
						|
    trap 'rm -r "$tmpdir"' EXIT
 | 
						|
    cd "$tmpdir"
 | 
						|
    wget -nv "https://storage.googleapis.com/shellcheck/shellcheck-v$version.linux.x86_64.tar.xz"
 | 
						|
    tar -xJf "shellcheck-v$version.linux.x86_64.tar.xz" --no-same-owner --strip-components=1 -C /usr/local/bin "shellcheck-v$version/shellcheck"
 | 
						|
fi
 |