mirror of
				https://github.com/ohmyzsh/ohmyzsh.git
				synced 2025-11-04 13:21:19 +08:00 
			
		
		
		
	Add cabal_sandbox_info function
Reports whether the current working directory is within a sandbox. Useful to check before installing Cabal packages into the global registry.
This commit is contained in:
		
							parent
							
								
									4ce7f0a37f
								
							
						
					
					
						commit
						358b6ffcde
					
				@ -1,3 +1,14 @@
 | 
			
		||||
function cabal_sandbox_info() {
 | 
			
		||||
    cabal_files=(*.cabal(N))
 | 
			
		||||
    if [ $#cabal_files -gt 0 ]; then
 | 
			
		||||
        if [ -f cabal.sandbox.config ]; then
 | 
			
		||||
            echo "%{$fg[green]%}sandboxed%{$reset_color%}"
 | 
			
		||||
        else
 | 
			
		||||
            echo "%{$fg[red]%}not sandboxed%{$reset_color%}"
 | 
			
		||||
        fi
 | 
			
		||||
    fi
 | 
			
		||||
}
 | 
			
		||||
 | 
			
		||||
function _cabal_commands() {
 | 
			
		||||
    local ret=1 state
 | 
			
		||||
    _arguments ':subcommand:->subcommand' && ret=0
 | 
			
		||||
 | 
			
		||||
		Loading…
	
	
			
			x
			
			
		
	
		Reference in New Issue
	
	Block a user