Skip to content

Commit

Permalink
feat: add some scripts
Browse files Browse the repository at this point in the history
  • Loading branch information
Okabe-Junya committed Aug 19, 2024
1 parent d731c6d commit 4a4c7b9
Show file tree
Hide file tree
Showing 2 changed files with 72 additions and 0 deletions.
46 changes: 46 additions & 0 deletions .zsh/dependency-check.zsh
Original file line number Diff line number Diff line change
@@ -0,0 +1,46 @@
#!/usr/bin/env zsh

set -euo pipefail

function check_homebrew() {
if [ ! -d "/opt/homebrew" ]; then
echo "Homebrew is not installed!"
echo "Please install Homebrew first!"
exit 1
else
sleep 1
echo "Homebrew is already installed!"
fi
}

function check_lsd() {
if ! command -v lsd 1>/dev/null 2>&1; then
echo "lsd is not installed!"
echo "Please install lsd first!"
exit 1
else
sleep 1
echo "lsd is already installed!"
fi
}

function check_oh_my_zsh() {
if [ ! -d "$HOME/.oh-my-zsh" ]; then
echo "Oh My Zsh is not installed!"
echo "Please install Oh My Zsh first!"
exit 1
else
sleep 1
echo "Oh My Zsh is already installed!"
fi
}

function main() {
check_homebrew
check_lsd
check_oh_my_zsh

echo "All dependencies are installed!"
}

main
26 changes: 26 additions & 0 deletions Makefile
Original file line number Diff line number Diff line change
@@ -0,0 +1,26 @@
DEFAULT: install-all

.PHONY: install-all
install-all:
@echo "Installing all dependencies and Setting up"
./install.zsh

.PHONY: symlink
symlink:
@echo "Setting up symlinks"
./install/symlink.zsh

.PHONY: dependency-check
dependency-check:
@echo "Checking dependencies"
./.zsh/dependency-check.zsh

.PHONY: help
help:
@echo "Usage: make [target]"
@echo ""
@echo "Targets:"
@echo " install-all: Install all dependencies and setup"
@echo " symlink: Create symlinks"
@echo " dependency-check: Check dependencies"
@echo " help: Show this help message"

0 comments on commit 4a4c7b9

Please sign in to comment.