Skip to content

Commit

Permalink
Update install.sh
Browse files Browse the repository at this point in the history
  • Loading branch information
mono0x committed May 31, 2024
1 parent 45afaa0 commit b041fc3
Show file tree
Hide file tree
Showing 2 changed files with 33 additions and 11 deletions.
16 changes: 11 additions & 5 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -4,19 +4,25 @@

## Setup

### Darwin / Ubuntu
### Darwin

```sh
/bin/bash -c "$(curl -fsSL https://raw.githubusercontent.com/mono0x/dotfiles/main/install.sh)"

chsh -s /opt/homebrew/bin/zsh
```

### Ubuntu

```sh
# Ubuntu
sudo apt-get update
sudo apt-get upgrade
sudo apt-get install -y unzip

git clone https://github.com/mono0x/dotfiles ~/.local/share/chezmoi
~/.local/share/chezmoi/install.sh
/bin/bash -c "$(curl -fsSL https://raw.githubusercontent.com/mono0x/dotfiles/main/install.sh)"

chsh -s /opt/homebrew/bin/zsh # Darwin
chsh -s /usr/bin/zsh # Ubuntu
chsh -s /usr/bin/zsh
```

### Windows
Expand Down
28 changes: 22 additions & 6 deletions install.sh
Original file line number Diff line number Diff line change
@@ -1,10 +1,26 @@
#!/bin/sh
#!/bin/bash
set -eu

cd "$(dirname "$0")"
$dir="$(mktemp --tmpdir -d dotfiles.XXXXXX)"
cd "$dir"
trap '{ rm -f -- "$dir"; }' EXIT

DENO_INSTALL="$HOME/.local"
command -v "$DENO_INSTALL/bin/deno" > /dev/null 2>&1 || \
DENO_INSTALL="$DENO_INSTALL" sh -c "$(curl -fsSL https://deno.land/x/install/install.sh)"
target=""
case "$(uname)" in
Darwin)
target="aarch64-apple-darwin"
;;
Linux)
target="x86_64-unknown-linux-gnu"
;;
esac
if [ -z "$target" ]; then
echo "Unsupported platform: $(uname)"
exit 1
fi
url="https://github.com/mono0x/dotfiles/releases/latest/download/bootstrap-$target"

exec "$DENO_INSTALL/bin/deno" run -A bootstrap/src/main.ts
curl -L -o bootstrap "$url"
chmod +x bootstrap

./bootstrap

0 comments on commit b041fc3

Please sign in to comment.