From 0c430087e70938396f62e9394280cd743b693896 Mon Sep 17 00:00:00 2001 From: shockrahwow Date: Mon, 30 Sep 2019 19:51:24 -0700 Subject: [PATCH] base version of dotfile archival script --- dotfiles-achive | 21 +++++++++++++++++++++ 1 file changed, 21 insertions(+) create mode 100644 dotfiles-achive diff --git a/dotfiles-achive b/dotfiles-achive new file mode 100644 index 0000000..bd6b277 --- /dev/null +++ b/dotfiles-achive @@ -0,0 +1,21 @@ +#!/bin/sh + +# What? +# Script which copies all dotfiles specified in locs.conf file into a new directory "dotfiles" + +locations=locs.conf +output=dotfiles/ + +if [ ! -f "$locations" ];then + echo 'Missing locs.conf file to read dotfile locations from' +fi +mkdir -p $output + +while read line; do + if [ ! -z "$line" ]; then + base="`dirname $line`" + mkdir -p "$output/$base" + cp "$line" "$output/$base" + fi +done < $locations +