diff --git a/README.md b/README.md index 17d869c..34c236e 100644 --- a/README.md +++ b/README.md @@ -3,9 +3,18 @@ A fast and easy bootstrap for my dotfiles that also acts as a simple management script once installed. Bootstrapping is as simple as: ```zsh -curl 'https://dots.00dani.id.au' | zsh +curl https://dots.00dani.id.au | zsh ``` -`dots` will then install itself, [GNU Stow](https://www.gnu.org/software/stow/) (if not already installed globally), and my configuration for [git](https://github.com/00dani/dot-git), [vim](https://github.com/00dani/dot-vim), and [zsh](https://github.com/00dani/dot-zsh). +If you're wary about piping scripts into your shell - [you should be](https://www.seancassidy.me/dont-pipe-to-your-shell.html) - then feel free to download the script and check it out first. `dots` *is* [designed to crash harmlessly](https://dots.00dani.id.au/partial-dl-test) rather than run something dangerous if `curl` is interrupted, however. + +```zsh +curl https://dots.00dani.id.au > dots +less dots +# reviewing ... looks okay! +zsh dots +``` + +When run through either of these methods, `dots` will install itself, [GNU Stow](https://www.gnu.org/software/stow/) (if not already installed globally), and my configuration for [git](https://github.com/00dani/dot-git), [vim](https://github.com/00dani/dot-vim), and [zsh](https://github.com/00dani/dot-zsh). Packages are installed by `dots` to `~/dotfiles` and then linked into `~` using Stow. I'll be adding flags for customising these paths, as well as adjusting which packages the bootstrap immediately installs. diff --git a/_scripts/partial-dl-test b/_scripts/partial-dl-test new file mode 100755 index 0000000..84d78d8 --- /dev/null +++ b/_scripts/partial-dl-test @@ -0,0 +1,12 @@ +#!/usr/bin/env zsh +actualSize=$(wc -c < $1) + +for (( size = 0; size < actualSize; size++ )); do + head -c$size $1 | env -i HOME=$HOME/test zsh 2>/dev/null + if [[ -d $HOME/test ]]; then + percent=$(( size * 100 / actualSize )) + echo "dots still ran with only $size bytes available, " \ + "$percent% of its full $actualSize bytes!" 2>/dev/null + exit $size + fi +done diff --git a/partial-dl-test.html b/partial-dl-test.html new file mode 100644 index 0000000..7794cfa --- /dev/null +++ b/partial-dl-test.html @@ -0,0 +1,7 @@ +--- +layout: page +permalink: /partial-dl-test +--- +{% highlight zsh %} +{% include_relative _scripts/partial-dl-test %} +{% endhighlight %}