Skip to content

Commit 0c454c4

Browse files
committed
macOS portability
1 parent c808fbc commit 0c454c4

File tree

5 files changed

+8
-10
lines changed

5 files changed

+8
-10
lines changed

deploy.bash renamed to deploy.zsh

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,10 +1,10 @@
1-
#!/usr/bin/env bash
1+
#!/usr/bin/env zsh
22
set -e
33

44
files=($(git ls-files | egrep -v 'backup|.ssh|proxy.pac.coffee|weechat'))
55
target=~
66
LN_OPT=-sf
7-
[[ $(ln --version) =~ coreutils ]] && LN_OPT=-sfr
7+
[[ $(uname) =~ Linux && $(ln --version) =~ coreutils ]] && LN_OPT=-sfr
88

99
declare -A dir
1010
dir[.vim]=1
@@ -54,7 +54,7 @@ do_mkdir
5454
do_ssh
5555
do_git
5656

57-
for f in "${!dir[@]}"; do
57+
for f in "${(@k)dir[@]}"; do
5858
g="$target/${f/home\//}"
5959
mkdir -p "${g%/*}"
6060
if ! [[ -L "$g" ]]; then
@@ -92,7 +92,7 @@ for f in ${files[@]}; do
9292
diff -u "$g" "$f" | less -FMX
9393
while :; do
9494
warning "Overwrite $g ?\n(y)es (n)o (m) vim -d (q)uit [y/n/m/q]"
95-
read -rsn 1 option
95+
read -rs 'option?Option: '
9696
case $option in
9797
[ny])
9898
break;;

home/.alias

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
# vim: set ft=sh fdm=marker:
22

33
GNU=
4-
[[ -f /etc/freebsd-update.conf ]] || GNU=1
4+
[[ -f /etc/lsb-release ]] && GNU=1
55
if [[ -n $GNU ]]; then
66
alias ls=$'ls -XF --group-directories-first --color=auto --time-style="+\e[33m[\e[32m%Y-%m-%d \e[35m%k:%M\e[33m]\e[m"'
77
else

home/.zprofile

Lines changed: 1 addition & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -33,8 +33,6 @@ if [[ $TERM =~ 256 ]] {
3333
# End underlining
3434
export LESS_TERMCAP_ue=$'\e[0m'
3535

36-
if (( ! ${+SSH_AUTH_SOCK} )) {
36+
if [[ $(uname) != Darwin && ${+SSH_AUTH_SOCK} == 1 ]] {
3737
export SSH_AUTH_SOCK=$XDG_RUNTIME_DIR/ssh-agent.socket
3838
}
39-
40-
export PATH="$HOME/.cargo/bin:$PATH"

home/.zshrc

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -468,5 +468,5 @@ fi
468468
if [[ -f ~/bin/modulecmd.tcl ]]; then
469469
module() { eval `~/bin/modulecmd.tcl zsh $*`; }
470470
module use ~/.modules
471-
module load ruby/2.7.0 wasm #go nodejs rust yarn #nim wps mpi/impi
471+
module load ruby/2.7.0 #wasm go nodejs rust yarn #nim wps mpi/impi
472472
fi

0 commit comments

Comments
 (0)