Skip to content

Commit

Permalink
allow macos-ramdisk.sh
Browse files Browse the repository at this point in the history
  • Loading branch information
johnko committed Jan 18, 2025
1 parent 464594e commit a4f2e0e
Show file tree
Hide file tree
Showing 2 changed files with 13 additions and 5 deletions.
2 changes: 1 addition & 1 deletion .zshrc
Original file line number Diff line number Diff line change
Expand Up @@ -27,7 +27,7 @@ done

##########
# color for zsh auto complete suggestion output https://stackoverflow.com/questions/23152157/how-does-the-zsh-list-colors-syntax-work
zstyle ':completion:*:commands' ignored-patterns '.DS_Store|.gitignore|macos-homebrew.sh|macos-mouse-shortcuts.sh|macos-ramdisk.sh|macos-settings|macos-skhd.sh|macos-yabai.sh|yabai_cycle_clockwise.sh'
zstyle ':completion:*:commands' ignored-patterns '.DS_Store|.gitignore|macos-homebrew.sh|macos-mouse-shortcuts.sh|macos-settings|macos-skhd.sh|macos-yabai.sh|yabai_cycle_clockwise.sh'
zstyle ':completion:*:commands' list-colors '=*=31'
zstyle ':completion:*:options' list-colors '=^(-- *)=36'
zstyle ':completion:*:parameters' list-colors '=*=36'
Expand Down
16 changes: 12 additions & 4 deletions bin/macos-ramdisk.sh
100644 → 100755
Original file line number Diff line number Diff line change
@@ -1,7 +1,15 @@
#!/usr/bin/env bash
set -eux

# 1 GB = 2097152
# 2 GB = 4194304
diskutil apfs create $( hdiutil attach -nomount ram://$(($1 * 2097152)) ) RAMDisk && \
touch /Volumes/RAMDisk/.metadata_never_index
if [[ ! -e /Volumes/RAMDisk/.metadata_never_index ]]; then
set +x
echo "=> Creating $1 GB /Volumes/RAMDisk..."
set -x
# 1 GB = 2097152
# 2 GB = 4194304
diskutil apfs create $( hdiutil attach -nomount ram://$(($1 * 2097152)) ) RAMDisk && \
touch /Volumes/RAMDisk/.metadata_never_index
else
set +x
echo '=> /Volumes/RAMDisk Already exists!'
fi

0 comments on commit a4f2e0e

Please sign in to comment.