-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
6 changed files
with
163 additions
and
125 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,10 +1,33 @@ | ||
#!/bin/bash | ||
|
||
CUR_OS=$(uname) | ||
|
||
if ! brew bundle --no-lock --no-upgrade --file=~/.local/share/chezmoi/setup/Brewfile.personal; then | ||
echo "Filed to install packages" | ||
error() { | ||
echo "[ERROR] $1" | ||
exit 1 | ||
} | ||
|
||
cur_os=$(uname) | ||
|
||
assets_dir="$HOME/.config/assets" | ||
|
||
# Install packages | ||
if [ "$cur_os" = "Darwin" ]; then | ||
font_dir=~/Library/Fonts/ | ||
brewfile="$HOME/.local/share/chezmoi/setup/Brewfile.personal" | ||
if ! brew bundle --no-lock --no-upgrade --file="$brewfile"; then | ||
error "Filed to install packages" | ||
fi | ||
|
||
source ~/.local/share/chezmoi/setup/macos-setup.sh && all | ||
elif [ "$cur_os" = "Linux" ]; then | ||
font_dir=~/.local/share/fonts/ | ||
fi | ||
|
||
if ! command -v op; then | ||
error "1Password not found" | ||
fi | ||
|
||
if ! op whoami 2>/dev/null; then | ||
error "Your 1Password account is not signed in please signin." | ||
fi | ||
|
||
op read "op://Personal/SSH Github xvzc/public key" >~/.ssh/xvzc.pub && | ||
|
@@ -13,22 +36,15 @@ op read "op://Personal/SSH Github xvzc/public key" >~/.ssh/xvzc.pub && | |
op read "op://Personal/SSH Arch Linux/public key" >~/.ssh/arch.pub && | ||
chmod 600 ~/.ssh/arch.pub | ||
|
||
ASSETS_DIR="$HOME/.config/assets" | ||
if [ -d "$ASSETS_DIR/.git" ]; then | ||
echo "'$ASSETS_DIR/.git' already exists." | ||
git --git-dir "$ASSETS_DIR/.git" remote set-url origin [email protected]:xvzc/assets.git | ||
if [ -d "$assets_dir/.git" ]; then | ||
echo "'$assets_dir/.git' already exists." | ||
git --git-dir "$assets_dir/.git" remote set-url origin [email protected]:xvzc/assets.git | ||
else | ||
git clone [email protected]:xvzc/assets.git $ASSETS_DIR | ||
git clone [email protected]:xvzc/assets.git "$assets_dir" | ||
fi | ||
|
||
# Install fonts | ||
if [ "$CUR_OS" = "Darwin" ]; then | ||
cp ~/.config/assets/fonts/hesalche/ttf/hesalche-Light.ttf ~/Library/Fonts/ | ||
cp ~/.config/assets/fonts/hesalche/ttf/hesalche-Regular.ttf ~/Library/Fonts/ | ||
elif [ "$CUR_OS" = "Linux" ]; then | ||
cp ~/.config/assets/fonts/hesalche/ttf/hesalche-Light.ttf ~/.local/share/fonts/ | ||
cp ~/.config/assets/fonts/hesalche/ttf/hesalche-Regular.ttf ~/.local/share/fonts/ | ||
fi | ||
cp ~/.config/assets/fonts/hesalche/ttf/hesalche-Light.ttf "$font_dir" | ||
cp ~/.config/assets/fonts/hesalche/ttf/hesalche-Regular.ttf "$font_dir" | ||
|
||
# install cargo | ||
curl https://sh.rustup.rs -sSf | sh |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.