Adds a one-liner install script

This commit is contained in:
Alicia Sykes 2022-08-29 20:31:25 +01:00
parent f81347a348
commit 618b099fd6
2 changed files with 43 additions and 1 deletions

16
.github/README.md vendored
View File

@ -23,6 +23,7 @@
- [Tmux](#tmux)
- [Git](#git)
- [Dependencies](#dependencies)
---
## Intro
@ -160,7 +161,18 @@ Another solution, is to encrypt sensitive info. A great tool for this is [`pass`
> **Warning**
> Prior to running the setup script, read through everything and confirm it's what you want.
To set everything up, just recursivley clone the repo, cd into it, allow execution of `install.sh` then run it to install.
Let's Go!
```bash
bash <(curl -s https://github.com/Lissy93/dotfiles/blob/master/lets-go.sh)
```
This will execute the quick setup script (in [`lets-go.sh`](https://github.com/Lissy93/dotfiles/blob/master/lets-go.sh)), which just clones the repo (if not yet present), then executes the [`install.sh`](https://github.com/Lissy93/dotfiles/blob/master/install.sh) script. You can re-run this at anytime to update the dotfiles. You can also optionally pass in some variables to change the install location (`DOTFILES_DIR`) and source repo (`DOTFILES_REPO`).
_Alternatively, you can clone the repo yourself, cd into it, allow execution of [`install.sh`](https://github.com/Lissy93/dotfiles/blob/master/install.sh) then run it to install or update._
<details>
<summary>Example</summary>
```bash
git clone --recursive git@github.com:Lissy93/dotfiles.git ~/.dotfiles
@ -168,6 +180,8 @@ chmod +x ~/.dotfiles/install.sh
~/.dotfiles/install.sh
```
</details>
---
### Configuring

28
lets-go.sh Normal file
View File

@ -0,0 +1,28 @@
######################################################################
# Lissy93/dotfiles - Remote Runnable Dotfile Setup and Update Script #
# Licensed under MIT (C) Alicia Sykes 2022 <https://aliciasykes.com> #
# #
# This script will clone + install, or update dotfiles from git #
# Be sure to read through the repo before running anything here #
# For more info, read docs: https://github.com/Lissy93/dotfiles #
# #
# Config Options: #
# - DOTFILES_REPO - Optionally sets the source repo to be cloned #
# - DOTFILES_DIR - Optionally sets the local destination directory #
######################################################################
# If not already set, specify dotfiles destination directory and source repo
DOTFILES_DIR="${DOTFILES_DIR:-$HOME/Documents/config/dotfiles}"
DOTFILES_REPO="${DOTFILES_REPO:-https://github.com/lissy93/dotfiles.git}"
# If dotfiles not yet present then clone
if [[ ! -d "$DOTFILES_DIR" ]]; then
git clone --recursive ${DOTFILES_REPO} ${DOTFILES_DIR}
fi
# Execute setup or update script
cd "${DOTFILES_DIR}" && \
chmod +x ./install.sh && \
./install.sh
# EOF