From 38e55047b534299bccd517a2f2ccc54e1e12b275 Mon Sep 17 00:00:00 2001 From: DarkFeather Date: Wed, 14 Jan 2026 14:06:43 -0600 Subject: [PATCH] Adding promote-script --- UserScripts/Makefile | 2 +- UserScripts/promote-script | 39 ++++++++++++++++++++++++++++++++++++++ 2 files changed, 40 insertions(+), 1 deletion(-) create mode 100755 UserScripts/promote-script diff --git a/UserScripts/Makefile b/UserScripts/Makefile index ffd63ce..e4b5c0c 100644 --- a/UserScripts/Makefile +++ b/UserScripts/Makefile @@ -1,4 +1,4 @@ -LIST=bell bigorlittle compare-directories compress-all diff-args expand-all failcount home-git logged-shell src-maintenance sslinfo standardize-folder sysinfo whatismyip worktrack +LIST!=/bin/bash -c 'ls -1 | grep -v Makefile' LOCATION=${pkgdir}/usr/local/bin PERMISSION=0755 compile: diff --git a/UserScripts/promote-script b/UserScripts/promote-script new file mode 100755 index 0000000..e7e93aa --- /dev/null +++ b/UserScripts/promote-script @@ -0,0 +1,39 @@ +#!/usr/bin/bash + +# File: promote-script +# +# Description: This script promotes files from one repo, usually a HomeDir, to another. +# +# Package: AniNIX/ShadowArch +# Copyright: WTFPL +# +# Author: DarkFeather + +source /opt/aninix/Uniglot/Bash/header + +confirmUser "This will separate the files from previous git history." + +# Record the repo +currentrepo="$(git config remote.origin.url)" + +# For each file +for file in $@; do + + # Copy and add the file + cp "$file" . + git add "$(basename "${file}")" + + # Remove the file from the old repo + cd "$(dirname "${file}")" + git rm "$(basename "${file}")" + oldrepo="$(git config remote.origin.url)" + git commit -m "Promoting file to ${currentrepo}" + git push + + # Commit the new file. + cd - + git commit -m "Promoting file from ${oldrepo}" +done + +# Push +git push