Commit 454ff9c 1 parent dd3fa32 commit 454ff9c Copy full SHA for 454ff9c
File tree 4 files changed +19
-11
lines changed
4 files changed +19
-11
lines changed Original file line number Diff line number Diff line change @@ -2,6 +2,7 @@ SHELL = /bin/bash
2
2
DOTFILES_DIR := $(shell dirname $(realpath $(firstword $(MAKEFILE_LIST ) ) ) )
3
3
OS := $(shell bin/is-supported bin/is-macos macos linux)
4
4
PATH := $(DOTFILES_DIR ) /bin:$(PATH )
5
+ HOMEBREW_PREFIX := $(shell bin/is-supported bin/is-arm64 /opt/homebrew /usr/local)
5
6
export XDG_CONFIG_HOME = $(HOME ) /.config
6
7
export STOW_DIR = $(DOTFILES_DIR )
7
8
export ACCEPT_EULA =Y
@@ -51,7 +52,7 @@ unlink: stow-$(OS)
51
52
brew :
52
53
is-executable brew || curl -fsSL https://raw.githubusercontent.com/Homebrew/install/master/install.sh | bash
53
54
54
- bash : BASH=/usr/local /bin/bash
55
+ bash : BASH=$( HOMEBREW_PREFIX ) /bin/bash
55
56
bash : SHELLS=/private/etc/shells
56
57
bash : brew
57
58
ifdef GITHUB_ACTION
Original file line number Diff line number Diff line change
1
+ #! /usr/bin/env bash
2
+
3
+ if [[ " $( uname -m) " == " arm64" ]]; then
4
+ exit 0
5
+ else
6
+ exit 1
7
+ fi
Original file line number Diff line number Diff line change 3
3
[ -z " $PS1 " ] && return
4
4
5
5
# Resolve DOTFILES_DIR (assuming ~/.dotfiles on distros without readlink and/or $BASH_SOURCE/$0)
6
-
7
- READLINK=$( which greadlink 2> /dev/null || which readlink)
8
6
CURRENT_SCRIPT=$BASH_SOURCE
9
7
10
- if [[ -n $CURRENT_SCRIPT && -x " $READLINK " ]]; then
11
- SCRIPT_PATH=$( $READLINK -f " $CURRENT_SCRIPT " )
12
- DOTFILES_DIR=$ ( dirname " $( dirname " $SCRIPT_PATH " ) " )
8
+ if [[ -n $CURRENT_SCRIPT && -x readlink ]]; then
9
+ SCRIPT_PATH=$( readlink -n $CURRENT_SCRIPT )
10
+ DOTFILES_DIR=" ${PWD} / $ ( dirname $( dirname $SCRIPT_PATH ) ) "
13
11
elif [ -d " $HOME /.dotfiles" ]; then
14
12
DOTFILES_DIR=" $HOME /.dotfiles"
15
13
else
49
47
50
48
# Clean up
51
49
52
- unset READLINK CURRENT_SCRIPT SCRIPT_PATH DOTFILE EXTRAFILE
50
+ unset CURRENT_SCRIPT SCRIPT_PATH DOTFILE EXTRAFILE
53
51
54
52
# Export
55
53
Original file line number Diff line number Diff line change 3
3
4
4
is-executable getconf && PATH=$($(command -v getconf) PATH)
5
5
6
+ export HOMEBREW_PREFIX=$($DOTFILES_DIR/bin/is-supported $DOTFILES_DIR/bin/is-arm64 /opt/homebrew /usr/local)
7
+
6
8
# Prepend new items to path (if directory exists)
7
9
8
10
prepend-path "/bin"
9
11
prepend-path "/usr/bin"
10
- prepend-path "/usr/local /bin"
11
- prepend-path "/usr/local /opt/coreutils/libexec/gnubin"
12
- prepend-path "/usr/local /opt/gnu-sed/libexec/gnubin"
13
- prepend-path "/usr/local /opt/grep/libexec/gnubin"
12
+ prepend-path "$HOMEBREW_PREFIX /bin"
13
+ prepend-path "$HOMEBREW_PREFIX /opt/coreutils/libexec/gnubin"
14
+ prepend-path "$HOMEBREW_PREFIX /opt/gnu-sed/libexec/gnubin"
15
+ prepend-path "$HOMEBREW_PREFIX /opt/grep/libexec/gnubin"
14
16
prepend-path "/usr/local/opt/python/libexec/bin"
15
17
prepend-path "/usr/local/opt/ruby/bin"
16
18
prepend-path "$DOTFILES_DIR/bin"
You can’t perform that action at this time.
0 commit comments