Skip to content

Commit 5b2056b

Browse files
committed
feat: Add installation script
1 parent 2a29b07 commit 5b2056b

File tree

2 files changed

+45
-2
lines changed

2 files changed

+45
-2
lines changed

docs/installation.md

Lines changed: 10 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -16,10 +16,18 @@ See the full list of supported operating systems in [Support](./support.md)
1616

1717
## Install
1818

19+
### Scripted
20+
21+
```sh
22+
curl -Lo- https://raw.githubusercontent.com/eankeen/bpm/main/scripts/install.sh | bash
23+
```
24+
25+
### Manual
26+
1927
##### 1. Clone `bpm`
2028

2129
```sh
22-
git clone https://github.com/bpmpm/bpm "${XDG_DATA_HOME:-$HOME/.local/share}/bpm/source"
30+
git clone https://github.com/eankeen/bpm "${XDG_DATA_HOME:-$HOME/.local/share}/bpm/source"
2331
```
2432

2533
By default, this installs bpm to `$HOME/.local/share/bpm/source`
@@ -40,7 +48,7 @@ For `fish`
4048

4149
```fish
4250
set -gx PATH "${XDG_DATA_HOME:-$HOME/.local/share}/bpm/source/pkg/bin" $PATH
43-
status --is-interactive; and . (bpm init fish | psub)
51+
source (bpm init fish | psub)
4452
```
4553

4654
And now you're done! Move on to [Getting Started](./getting-started.md) to learn the basics

scripts/install.sh

Lines changed: 35 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,2 +1,37 @@
11
#!/usr/bin/env sh
22

3+
cloneDir="${XDG_DATA_HOME:-$HOME/.local/share}/bpm/source"
4+
5+
if [ -d "$cloneDir" ]; then
6+
printf "%s" "Error: bpm already installed to '$cloneDir'"
7+
exit 1
8+
fi
9+
10+
git clone https://github.com/eankeen/bpm "$cloneDir"
11+
12+
bashrc="$HOME/.bashrc"
13+
if [ -f "$bashrc" ]; then
14+
cat >> "$bashrc" <<-"EOF"
15+
# bpm
16+
export PATH="${XDG_DATA_HOME:-$HOME/.local/share}/bpm/source/pkg/bin:$PATH"
17+
eval "$(bpm init bash)"
18+
EOF
19+
fi
20+
21+
zshrc="${ZDOTDIR:-$HOME/.zshrc}"
22+
if [ -f "$zshrc" ]; then
23+
cat >> "$zshrc" <<-"EOF"
24+
# bpm
25+
export PATH="${XDG_DATA_HOME:-$HOME/.local/share}/bpm/source/pkg/bin:$PATH"
26+
eval "$(bpm init zsh)"
27+
EOF
28+
fi
29+
30+
fishrc="${XDG_CONFIG_HOME:-$HOME/.config}/fish/config.fish"
31+
if [ -f "$fishrc" ]; then
32+
cat >> "$fishrc" <<-"EOF"
33+
# bpm
34+
set -gx PATH "${XDG_DATA_HOME:-$HOME/.local/share}/bpm/source/pkg/bin" $PATH
35+
source (bpm init fish | psub)
36+
EOF
37+
fi

0 commit comments

Comments
 (0)