Extract JavaScript aliases to '~/.bash_aliases/js'
							parent
							
								
									05ee0bf5f1
								
							
						
					
					
						commit
						e35cf075bf
					
				| 
						 | 
				
			
			@ -63,8 +63,6 @@ alias xev='xev | grep -A2 ButtonPress' # Ignore mouse movements
 | 
			
		|||
alias mm='micromamba'
 | 
			
		||||
 | 
			
		||||
# Languages
 | 
			
		||||
alias js="node"
 | 
			
		||||
alias ts="ts-node"
 | 
			
		||||
alias r5="plt-r5rs --no-prim"
 | 
			
		||||
alias hs="ghci"
 | 
			
		||||
alias pl="swipl"
 | 
			
		||||
| 
						 | 
				
			
			@ -74,33 +72,3 @@ alias r="R"
 | 
			
		|||
alias azerty="setxkbmap be"
 | 
			
		||||
alias qwerty="setxkbmap us"
 | 
			
		||||
alias cole="setxkbmap us -variant colemak"
 | 
			
		||||
 | 
			
		||||
yarn() {
 | 
			
		||||
  if [[ -f "package-lock.json" ]]; then
 | 
			
		||||
    echo "WARNING: package-lock.json exists"
 | 
			
		||||
    read -p "Are you sure you want to run yarn? [y/N] " -n 1 -r
 | 
			
		||||
    echo
 | 
			
		||||
    if [[ $REPLY =~ ^[Yy]$ ]]; then
 | 
			
		||||
      command yarn "$@"
 | 
			
		||||
    else
 | 
			
		||||
      echo "Aborted"
 | 
			
		||||
    fi
 | 
			
		||||
  else
 | 
			
		||||
    command yarn "$@"
 | 
			
		||||
  fi
 | 
			
		||||
}
 | 
			
		||||
 | 
			
		||||
npm() {
 | 
			
		||||
  if [[ -f "yarn.lock" ]]; then
 | 
			
		||||
    echo "WARNING: yarn.lock exists"
 | 
			
		||||
    read -p "Are you sure you want to run npm? [y/N] " -n 1 -r
 | 
			
		||||
    echo
 | 
			
		||||
    if [[ $REPLY =~ ^[Yy]$ ]]; then
 | 
			
		||||
      command npm "$@"
 | 
			
		||||
    else
 | 
			
		||||
      echo "Aborted"
 | 
			
		||||
    fi
 | 
			
		||||
  else
 | 
			
		||||
    command npm "$@"
 | 
			
		||||
  fi
 | 
			
		||||
}
 | 
			
		||||
| 
						 | 
				
			
			
 | 
			
		|||
| 
						 | 
				
			
			@ -0,0 +1,35 @@
 | 
			
		|||
# shellcheck shell=bash
 | 
			
		||||
# vim: set ft=bash :
 | 
			
		||||
 | 
			
		||||
alias js="node"
 | 
			
		||||
alias ts="ts-node"
 | 
			
		||||
 | 
			
		||||
yarn() {
 | 
			
		||||
  if [[ -f "package-lock.json" ]]; then
 | 
			
		||||
    echo "WARNING: package-lock.json exists"
 | 
			
		||||
    read -p "Are you sure you want to run yarn? [y/N] " -n 1 -r
 | 
			
		||||
    echo
 | 
			
		||||
    if [[ $REPLY =~ ^[Yy]$ ]]; then
 | 
			
		||||
      command yarn "$@"
 | 
			
		||||
    else
 | 
			
		||||
      echo "Aborted"
 | 
			
		||||
    fi
 | 
			
		||||
  else
 | 
			
		||||
    command yarn "$@"
 | 
			
		||||
  fi
 | 
			
		||||
}
 | 
			
		||||
 | 
			
		||||
npm() {
 | 
			
		||||
  if [[ -f "yarn.lock" ]]; then
 | 
			
		||||
    echo "WARNING: yarn.lock exists"
 | 
			
		||||
    read -p "Are you sure you want to run npm? [y/N] " -n 1 -r
 | 
			
		||||
    echo
 | 
			
		||||
    if [[ $REPLY =~ ^[Yy]$ ]]; then
 | 
			
		||||
      command npm "$@"
 | 
			
		||||
    else
 | 
			
		||||
      echo "Aborted"
 | 
			
		||||
    fi
 | 
			
		||||
  else
 | 
			
		||||
    command npm "$@"
 | 
			
		||||
  fi
 | 
			
		||||
}
 | 
			
		||||
							
								
								
									
										1
									
								
								.bashrc
								
								
								
								
							
							
						
						
									
										1
									
								
								.bashrc
								
								
								
								
							| 
						 | 
				
			
			@ -14,6 +14,7 @@
 | 
			
		|||
[ -f "$HOME/.bash_aliases/all" ] && . "$HOME/.bash_aliases/all"
 | 
			
		||||
[ -f "$HOME/.bash_aliases/hosts/$HOSTNAME" ] && . "$HOME/.bash_aliases/hosts/$HOSTNAME"
 | 
			
		||||
[ -f "$HOME/.bash_aliases/private" ] && . "$HOME/.bash_aliases/private"
 | 
			
		||||
[ -f "$HOME/.bash_aliases/lang-js" ] && . "$HOME/.bash_aliases/lang-js"
 | 
			
		||||
command -v jira >/dev/null && [ -f "$HOME/.bash_aliases/jira" ] && . "$HOME/.bash_aliases/jira"
 | 
			
		||||
 | 
			
		||||
# Completions {{{
 | 
			
		||||
| 
						 | 
				
			
			
 | 
			
		|||
		Loading…
	
		Reference in New Issue