Skip to content

Commit d45e413

Browse files
Prioritize brew dep installs
1 parent 2c04432 commit d45e413

File tree

3 files changed

+25
-13
lines changed

3 files changed

+25
-13
lines changed

.gitignore

+1
Original file line numberDiff line numberDiff line change
@@ -4,3 +4,4 @@
44
!utmp-desc
55
!utmp-install
66
!utmp-lib.sh
7+
!linkmac

linkmac

+10
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,10 @@
1+
#!/bin/bash
2+
3+
# this script exists purely for macOS linking for utmp's files
4+
# it's not for you and I'm too lazy to make it work for other OSs
5+
6+
source $(dirname $0)/utmp-lib.sh
7+
WDIR=$(dirname $0)
8+
# ls $WDIR/utmp*
9+
ln -s $WDIR/utmp* ~/bin/
10+
# export PATH="$PATH:~/bin/"

utmp-install

+14-13
Original file line numberDiff line numberDiff line change
@@ -64,14 +64,14 @@ check_git() {
6464
#check for git (why would you not have git??)
6565
if ! cmd_exists git || [[ $FORCE -eq 1 ]]; then
6666
ech "Git not found. Installing git..."
67-
if cmd_exists pkg; then ech "Using: pkg"
68-
pkg install git
67+
if cmd_exists brew; then ech "Using: brew"
68+
brew install git
6969
elif cmd_exists dnf; then ech "Using: dnf"
7070
sudo dnf install git
7171
elif cmd_exists apt && ! [[ "$ostype" == "darwin"* ]]; then ech "Using: apt"
7272
sudo apt install git
73-
elif cmd_exists brew; then ech "Using: brew"
74-
brew install git
73+
elif cmd_exists pkg; then ech "Using: pkg"
74+
pkg install git
7575
elif cmd_exists port; then ech "Using: MacPorts/DarwinPorts"
7676
sudo port install git
7777
else
@@ -90,10 +90,10 @@ check_yt_dlp() {
9090
ech "Installing yt-dlp..."
9191
if [[ "$method" == "linux" ]]; then
9292
fdown=0
93-
if cmd_exists apt && ! [[ "$ostype" == "darwin"* ]]; then ech "Using: apt"
94-
sudo apt install yt-dlp
95-
elif cmd_exists brew; then ech "Using: brew"
93+
if cmd_exists brew; then ech "Using: brew"
9694
brew install yt-dlp
95+
elif cmd_exists apt && ! [[ "$ostype" == "darwin"* ]]; then ech "Using: apt"
96+
sudo apt install yt-dlp
9797
elif cmd_exists curl; then ech "Using: curl (file download)"; fdown=1
9898
curl -L https://github.com/yt-dlp/yt-dlp/releases/latest/download/yt-dlp -o /usr/local/bin/yt-dlp
9999
elif cmd_exists wget; then ech "Using: wget (file download)"; fdown=1
@@ -134,10 +134,10 @@ check_sdl() {
134134
if ! cmd_exists sdl2-config || [[ $FORCE -eq 1 ]]; then
135135
ech "SDL library not found. Installing SDL..."
136136
if [[ "$method" == "linux" || "$method" == "darwin" ]]; then
137-
if cmd_exists apt && ! [[ "$ostype" == "darwin"* ]]; then ech "Using: apt"
138-
sudo apt install libsdl2-dev
139-
elif cmd_exists brew; then ech "Using: brew"
137+
if cmd_exists brew; then ech "Using: brew"
140138
brew install sdl2
139+
elif cmd_exists apt && ! [[ "$ostype" == "darwin"* ]]; then ech "Using: apt"
140+
sudo apt install libsdl2-dev
141141
else
142142
echwarn "brew, apt not found."
143143
ech "Using: git (manual)"
@@ -181,10 +181,11 @@ check_ffmpeg() {
181181
if ! cmd_exists $FFMPEG || ! cmd_exists $FFPLAY || [[ $FORCE -eq 1 ]]; then
182182
ech "Installing ffmpeg and ffplay..."
183183
check_sdl
184-
if cmd_exists apt; then ech "Using: apt"
185-
sudo apt install ffmpeg
186-
elif cmd_exists brew; then ech "Using: brew"
184+
185+
if cmd_exists brew; then ech "Using: brew"
187186
brew install ffmpeg
187+
elif cmd_exists apt; then ech "Using: apt"
188+
sudo apt install ffmpeg
188189
else
189190
ech "Using: git (manual)"
190191
ech "Compiling and installing ffmpeg..."

0 commit comments

Comments
 (0)