Skip to content

Commit 2d3d2f5

Browse files
authored
Merge pull request #118 from atomantic/codex/investigate-issue-#89-in-dotfiles
Fix brew default names issue
2 parents e5eb95a + 6c5b6dd commit 2d3d2f5

5 files changed

Lines changed: 39 additions & 75 deletions

File tree

README.md

Lines changed: 0 additions & 57 deletions
Original file line numberDiff line numberDiff line change
@@ -253,68 +253,11 @@ The following will only happen if you agree on the prompt
253253
- Disable automatic emoji substitution (i.e. use plain text smileys)
254254
- Disable smart quotes as it’s annoying for messages that contain code
255255

256-
## SizeUp.app
257-
258-
- Start SizeUp at login
259-
- Don’t show the preferences window on next start
260256

261257
# Software Installation
262258

263259
homebrew, fontconfig, git, nvm (node + npm), and zsh (latest) are all installed inside the `install.sh` as foundational software for running this project.
264260
Additional software is configured in `config.js` and can be customized in your own fork/branch (you can change everything in your own fork/brance).
265-
The following is the software that I have set as default:
266-
267-
## Utilities
268-
269-
- ack
270-
- ag
271-
- coreutils
272-
- dos2unix
273-
- findutils
274-
- fortune
275-
- gawk
276-
- gifsicle
277-
- gnupg
278-
- gnu-sed
279-
- homebrew/dupes/grep
280-
- httpie
281-
- imagemagick (only if gitshots enabled)
282-
- imagesnap (only if gitshots enabled)
283-
- jq
284-
- mas
285-
- moreutils
286-
- nmap
287-
- openconnect
288-
- reattach-to-user-namespace
289-
- homebrew/dupes/screen
290-
- tmux
291-
- tree
292-
- ttyrec
293-
- vim --override-system-vi
294-
- watch
295-
- wget --enable-iri
296-
297-
## Apps
298-
299-
- box-sync
300-
- gpgtools
301-
- iterm2
302-
- sizeup
303-
- slack
304-
- the-unarchiver
305-
- xquartz
306-
307-
## NPM Global Modules
308-
309-
- antic
310-
- buzzphrase
311-
- eslint
312-
- gulp
313-
- instant-markdown-d
314-
- npm-check
315-
- prettyjson
316-
- trash
317-
- vtop
318261

319262
# License
320263

config.js

Lines changed: 6 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -7,8 +7,7 @@ export default {
77
"autojump",
88
// alternative to `cat`: https://github.com/sharkdp/bat
99
"bat",
10-
// Install GNU core utilities (those that come with macOS are outdated)
11-
// Don’t forget to add `$(brew --prefix coreutils)/libexec/gnubin` to `$PATH`.
10+
// Install GNU core utilities (PATH updated automatically during install)
1211
"coreutils",
1312
"dos2unix",
1413
// Install GNU `find`, `locate`, `updatedb`, and `xargs`, `g`-prefixed
@@ -20,13 +19,10 @@ export default {
2019
// http://www.lcdf.org/gifsicle/ (because I'm a gif junky)
2120
"gifsicle",
2221
"gnupg",
23-
// Install GNU `sed`, overwriting the built-in `sed`
24-
// so we can do "sed -i 's/foo/bar/' file" instead of "sed -i '' 's/foo/bar/' file"
25-
"gnu-sed --with-default-names",
26-
// upgrade grep so we can get things like inverted match (-v)
27-
"grep --with-default-names",
28-
// better, more recent grep
29-
"homebrew/dupes/grep",
22+
// Install GNU `sed` (PATH updated automatically during install)
23+
"gnu-sed",
24+
// Install GNU grep (PATH updated automatically during install)
25+
"grep",
3026
// https://github.com/jkbrzt/httpie
3127
"httpie",
3228
// jq is a sort of JSON grep
@@ -69,7 +65,7 @@ export default {
6965
//'micro-snitch',
7066
// 'signal',
7167
//'macvim',
72-
"sizeup",
68+
// "sizeup",
7369
//'sketchup',
7470
"slack",
7571
// 'the-unarchiver',

homedir/.shellpaths

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -4,6 +4,7 @@ export PATH=$PATH:.
44

55
#Brew
66
export PATH="/opt/homebrew/bin:$PATH"
7+
# GNU utilities will be added by install.sh
78
# export PATH=/usr/local/sbin:$PATH
89
# export PATH=/usr/local/bin:$PATH
910

@@ -15,3 +16,6 @@ export PATH="/opt/homebrew/bin:$PATH"
1516

1617
# The next line enables shell command completion for gcloud.
1718
#source "/Users/$(whoami)/Downloads/google-cloud-sdk/completion.zsh.inc"
19+
export PATH="/opt/homebrew/opt/coreutils/libexec/gnubin:$PATH"
20+
export PATH="/opt/homebrew/opt/gnu-sed/libexec/gnubin:$PATH"
21+
export PATH="/opt/homebrew/opt/grep/libexec/gnubin:$PATH"

homedir/.zshrc

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -61,4 +61,4 @@ export GEMINI_SANDBOX=docker
6161

6262
# NVM initialization (added by install.sh)
6363
export NVM_DIR="$HOME/.nvm"
64-
[ -s "$(brew --prefix nvm)/nvm.sh" ] && \. "$(brew --prefix nvm)/nvm.sh"
64+
[ -s "/opt/homebrew/opt/nvm/nvm.sh" ] && \. "/opt/homebrew/opt/nvm/nvm.sh"

install.sh

Lines changed: 28 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -200,6 +200,27 @@ fi
200200
mkdir -p ~/Library/Caches/Homebrew/Formula
201201
brew doctor
202202

203+
# Add GNU utilities to PATH once in .shellpaths
204+
shellpaths_file="./homedir/.shellpaths"
205+
206+
# Determine Homebrew prefix once using brew
207+
brew_prefix="$(brew --prefix)"
208+
209+
# Append gnubin directories for GNU utilities if missing
210+
coreutils_path="$brew_prefix/opt/coreutils/libexec/gnubin"
211+
sed_path="$brew_prefix/opt/gnu-sed/libexec/gnubin"
212+
grep_path="$brew_prefix/opt/grep/libexec/gnubin"
213+
214+
if ! grep -qs "$coreutils_path" "$shellpaths_file"; then
215+
echo "export PATH=\"$coreutils_path:\$PATH\"" >> "$shellpaths_file"
216+
fi
217+
if ! grep -qs "$sed_path" "$shellpaths_file"; then
218+
echo "export PATH=\"$sed_path:\$PATH\"" >> "$shellpaths_file"
219+
fi
220+
if ! grep -qs "$grep_path" "$shellpaths_file"; then
221+
echo "export PATH=\"$grep_path:\$PATH\"" >> "$shellpaths_file"
222+
fi
223+
203224
# skip those GUI clients, git command-line all the way
204225
# git is now included with macos terminal
205226
#require_brew git
@@ -1073,15 +1094,15 @@ defaults write com.apple.messageshelper.MessageController SOInputLineSettings -d
10731094
# running "Disable continuous spell checking"
10741095
# defaults write com.apple.messageshelper.MessageController SOInputLineSettings -dict-add "continuousSpellCheckingEnabled" -bool false;ok
10751096

1076-
###############################################################################
1077-
bot "SizeUp.app"
1078-
###############################################################################
1097+
# ###############################################################################
1098+
# bot "SizeUp.app"
1099+
# ###############################################################################
10791100

1080-
running "Start SizeUp at login"
1081-
defaults write com.irradiatedsoftware.SizeUp StartAtLogin -bool true;ok
1101+
# running "Start SizeUp at login"
1102+
# defaults write com.irradiatedsoftware.SizeUp StartAtLogin -bool true;ok
10821103

1083-
running "Don't show the preferences window on next start"
1084-
defaults write com.irradiatedsoftware.SizeUp ShowPrefsOnNextStart -bool false;ok
1104+
# running "Don't show the preferences window on next start"
1105+
# defaults write com.irradiatedsoftware.SizeUp ShowPrefsOnNextStart -bool false;ok
10851106

10861107
killall cfprefsd
10871108

0 commit comments

Comments
 (0)