Skip to content

Instantly share code, notes, and snippets.

@weavenet
Last active October 20, 2022 18:23
Show Gist options
  • Save weavenet/65914037cedda94b54b1682845be3229 to your computer and use it in GitHub Desktop.
Save weavenet/65914037cedda94b54b1682845be3229 to your computer and use it in GitHub Desktop.
Weavnet Dotfiles Auto Install Cpio
#!/bin/bash
set -e
VERSION=0.0.2
#
# Create CPIO Archive, derivitive of tar script for containers that don't have tar https://gist.github.com/weavenet/32b0938e5aea6f3dd18fb98e2bfbdd42
# extract the lastest tar archive
#
# find dotfiles-$VERSION -depth -print0 | cpio -ocv0 > /tmp/dotfiles-$VERSION.cpio
# aws s3 cp --acl public-read /tmp/dotfiles-$VERSION.cpio s3://weavenet-public/dotfiles-$VERSION.cpio
#
# Update version below in this script
#
DIRECTORY=$HOME/dotfiles_weavenet
echo "Making dotfile directory to '$DIRECTORY'"
mkdir -p $DIRECTORY
echo "Installing bashdot as '$DIRECTORY/bashdot'."
url=https://raw.githubusercontent.com/bashdot/bashdot/master/bashdot
curl -s $url > $DIRECTORY/bashdot
chmod 755 $DIRECTORY/bashdot
echo "Downloading public dotfiles into '$DIRECTORY'."
curl -s --output - https://weavenet-public.s3.us-west-2.amazonaws.com/dotfiles-$VERSION.cpio | (cd $DIRECTORY && cpio -id)
echo "Installing default profile."
cd $DIRECTORY
mv dotfiles-$VERSION dotfiles
env WORK_DIR=$DIRECTORY bash bashdot install dotfiles
echo "Dotfiles installed, run '. ~/.bashrc' to source dotfiles."
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment