Add quick install instructions

This commit is contained in:
2024-03-02 18:43:44 +08:00
parent e2d7019732
commit d8dff46fdc
2 changed files with 35 additions and 4 deletions

View File

@@ -1,6 +1,13 @@
Git repo of my personal shell profile variables
## Installing
### Quick Install
```
curl https://raw.githubusercontent.com/madumlao/madumlao-profile/master/install.sh | bash
```
### Manual Install
Copy this directory somewhere in your home directory. The directory should be persistent, so probably keep this in your "projects" directory or somewhere similar. If in doubt, you can keep this under `.local/share/madumlao-profile`.
Next, run the `install.sh` script. It should backup your existing profile and replace it with symlinks to this version.

View File

@@ -1,13 +1,37 @@
#!/bin/bash
if ! [ -t 0 ]; then
echo "exec from pipe"
DOWNLOAD_APP=y
APP_DIR="$HOME/.local/share/madumlao-profile"
else
DOWNLOAD_APP=
APP_DIR="$(dirname "$0")"
cd "$APP_DIR"
APP_DIR="$(pwd)"
fi
echo "Run an apt update"
if sudo -l apt; then
sudo apt update
else
echo "Unable to run apt commands, please install manually"
fi
echo "Install git and friends"
if sudo -l apt; then
sudo apt install git
else
echo "Unable to autoinstall git and friends, please install manually"
fi
if [ "$DOWNLOAD_APP" ]; then
echo "Downloading master copy"
mkdir -pv "$APP_DIR"
git clone https://github.com/madumlao/madumlao-profile "$APP_DIR"
fi
echo "Set pwd to $APP_DIR"
cd "$APP_DIR"
APP_DIR="$(pwd)"
echo "Install zsh and friends"
if sudo -l apt; then
sudo apt install zsh command-not-found
@@ -62,7 +86,7 @@ IFS="$OLDIFS"
echo "Install vim-nox and friends"
if sudo -l apt; then
sudo apt install vim-nox git
sudo apt install vim-nox
else
echo "Unable to autoinstall vim-nox and friends, please install manually"
fi