From 2f93d6765f641868b2ea7052733b42d4426e177b Mon Sep 17 00:00:00 2001 From: Daniel Kempkens Date: Tue, 30 Aug 2022 17:39:48 +0200 Subject: [PATCH] Script: add copy-git-repo-contents --- home/programs/scripts/copy-git-repo-contents | 15 +++++++++++++++ 1 file changed, 15 insertions(+) create mode 100755 home/programs/scripts/copy-git-repo-contents diff --git a/home/programs/scripts/copy-git-repo-contents b/home/programs/scripts/copy-git-repo-contents new file mode 100755 index 0000000..815ebfd --- /dev/null +++ b/home/programs/scripts/copy-git-repo-contents @@ -0,0 +1,15 @@ +#!/usr/bin/env nix-shell +#!nix-shell -i bash -p coreutils findutils rsync + +current="$PWD" +src="$(realpath "$1")" +dst="$(realpath "$2")" + +cd "$dst" +find . -not -path './.git/*' -not -path './.git' -not -path '.' -not -path '..' -print0 | xargs -0 rm -rf +rsync -ax "$src/" ./ --exclude .git --exclude deps --exclude _build + +rm -rf ./.gitlab +rm -f ./.gitlab-ci.yml + +cd "$current"