Compare commits

...
24 Commits
Author SHA1 Message Date
me c62c47dc7e Fix indent of function. 2026-05-12 05:51:37 -07:00
me d154171f33 Meme photos have dashes in the name. 2026-05-12 05:29:19 -07:00
me 1cd5a4789c Add quotes to variable in conditional. 2026-05-08 10:39:25 -07:00
me 6caa36a09d Change log files to txt files because Android file haanddler is dumb. 2026-05-06 17:55:10 -07:00
me 6834d85fc2 Add automatic updates for env-termuc now that it's working in env-shared. 2026-05-06 17:52:02 -07:00
me 2de6e77d40 Fix another branch casing. 2026-05-06 17:44:54 -07:00
me cfd18df2c5 Add actual commands to update the env-shared project. 2026-05-06 17:41:53 -07:00
me 604639033b Uppercase the branch variable for consistency; unsure why it was lower. 2026-05-06 17:31:17 -07:00
me 3d0347e41a Add a Reports folder for Android. 2026-05-06 17:29:00 -07:00
me 4a9b4353d4 Fix variable which did not get switched over. 2026-05-06 17:17:23 -07:00
me fd238ddf2d Fix typo in Update. 2026-05-06 15:30:42 -07:00
me 864e8fa8db Fix the '$project' variable being shared across environments incorrectly. 2026-05-06 15:24:28 -07:00
me 7b62b21da9 Shorten the update message. 2026-05-06 15:07:28 -07:00
me 53d2587756 Add the fork back for updater. 2026-05-06 15:05:45 -07:00
me 2c1fba93d9 Fix the shared env project path. 2026-05-06 14:56:39 -07:00
me 5c12ff4a3b No longer push the update information to the screen, use notifications. 2026-05-06 14:50:49 -07:00
me 1c32aa3658 Remove the chmod as to not alter the project and prevent futuire pulls. 2026-05-06 10:15:38 -07:00
me f2c658a4f1 Set the BASH files to be executable. 2026-05-06 09:52:43 -07:00
me 65bdce1a8c Add prefix of git to env-shared project. 2026-05-06 09:28:08 -07:00
me 07ca4beacf Always update the critical software, check for skip in a better way. 2026-05-06 09:21:24 -07:00
me ba465cdece Fix encoding for echo. Add a reload-shared if the project a;ready exists. 2026-05-06 09:17:12 -07:00
me eda63610ad Simplify verbiage and shorten the length. 2026-05-05 15:24:44 -07:00
me 909875df32 Add filler content for the template. 2026-05-05 10:31:01 -07:00
me 4b0f0cbbcd Add a template to the README if it does not already have data. 2026-05-05 10:29:16 -07:00
2 changed files with 134 additions and 81 deletions

No files matched your search

Regular → Executable
+107 -63
View File
@@ -123,20 +123,19 @@ function commit {
# Easily test this project after committing changes. # Easily test this project after committing changes.
# Otherwise can just source this file unless testing setup.sh. # Otherwise can just source this file unless testing setup.sh.
project="$HOME/.git-env-termux" export PROJECT_TERMUX="$HOME/.git-env-termux"
function test-termux { function test-termux {
if [[ -d "$project" ]]; then if [[ -d "$PROJECT_TERMUX" ]]; then
log "`date` - Updating '$project'.\n" log "`date` - Updating '$PROJECT_TERMUX'.\n"
git -C "$project" switch "$branch" git -C "$PROJECT_TERMUX" switch "$BRANCH"
git -C "$project" pull --recurse-submodules || \ git -C "$PROJECT_TERMUX" pull --recurse-submodules || \
( echo "Failed to pull project, exiting." && return 1 ) ( echo "Failed to pull project, exiting." && return 1 )
else else
log "`date` - Downloading '$project'.\n" log "`date` - Downloading '$PROJECT_TERMUX'.\n"
git clone https://git.hyperling.com/me/env-termux \ git clone https://git.hyperling.com/me/env-termux \
--branch=$BRANCH "$project" --branch=$BRANCH "$PROJECT_TERMUX"
fi fi
chmod 755 "$project"/*.sh "$PROJECT_TERMUX"/setup.sh "$@"
"$project"/setup.sh "$@"
} }
alias reload-termux="test-termux " alias reload-termux="test-termux "
alias termux-test="test-termux " alias termux-test="test-termux "
@@ -148,56 +147,56 @@ alias update-termux="reload-termux "
# Pulled from /me/env-ansible, need to make a shared library between it and Termux. # Pulled from /me/env-ansible, need to make a shared library between it and Termux.
# Change a branch to point at another. # Change a branch to point at another.
function load-branch { function load-branch {
rcvr="$1" # branch which we want to modify rcvr="$1" # branch which we want to modify
base="$2" # branch with the changes we want base="$2" # branch with the changes we want
if [[ "$rcvr" == "main" ]]; then if [[ "$rcvr" == "main" ]]; then
echo "*** ERROR: Are you nuts, fool!? Not main! Do it manually! ***" echo "*** ERROR: Are you nuts, fool!? Not main! Do it manually! ***"
return 1
fi
if [[ -z "$base" ]]; then
if [[ "$rcvr" == "prod" ]]; then
base="stage"
elif [[ "$rcvr" == "stage" ]]; then
base="dev"
else
echo "* Unsure which branch to use for '$rcvr'. Please specify."
return 1 return 1
fi fi
echo "* Base was not specified, using '$base' for '$rcvr'."
else
echo "* Requested pointing '$rcvr' branch to '$base'."
fi
echo -e "\n* Ensuring we are on base branch '$base'." && if [[ -z "$base" ]]; then
git switch "$base" && if [[ "$rcvr" == "prod" ]]; then
echo -e "\n* Changing pointer for '$rcvr' to '$base'." && base="stage"
git branch -f "$rcvr" "$base" && elif [[ "$rcvr" == "stage" ]]; then
#echo -e "\n* Switching to branch '$rcvr'." && base="dev"
#git switch "$rcvr" && else
echo -e "\n* Forcing push on branch '$rcvr'." && echo "* Unsure which branch to use for '$rcvr'. Please specify."
git push --force --set-upstream origin "$rcvr" && return 1
echo -e "\n* Done! Displaying list of remote branches." && fi
git ls-remote --heads | sort echo "* Base was not specified, using '$base' for '$rcvr'."
if [[ "$base" != "dev" ]]; then
echo -e "\n* Checking if a dev branch exists."
git ls-remote --exit-code --heads origin dev
dev_exists="$?"
if [[ "$dev_exists" == 0 ]]; then
echo -e "\n* Switching back to dev."
git switch dev
elif [[ "$dev_exists" == 2 ]]; then
echo -e "\n* Switching back to main."
git switch main
else else
echo "*** ERROR: Unknown status for dev_exists, '$dev_exists'. ***" echo "* Requested pointing '$rcvr' branch to '$base'."
fi fi
fi
echo -e "\n* Verifying which branch we're on." echo -e "\n* Ensuring we are on base branch '$base'." &&
git branch git switch "$base" &&
echo -e "\n* Changing pointer for '$rcvr' to '$base'." &&
git branch -f "$rcvr" "$base" &&
#echo -e "\n* Switching to branch '$rcvr'." &&
#git switch "$rcvr" &&
echo -e "\n* Forcing push on branch '$rcvr'." &&
git push --force --set-upstream origin "$rcvr" &&
echo -e "\n* Done! Displaying list of remote branches." &&
git ls-remote --heads | sort
if [[ "$base" != "dev" ]]; then
echo -e "\n* Checking if a dev branch exists."
git ls-remote --exit-code --heads origin dev
dev_exists="$?"
if [[ "$dev_exists" == 0 ]]; then
echo -e "\n* Switching back to dev."
git switch dev
elif [[ "$dev_exists" == 2 ]]; then
echo -e "\n* Switching back to main."
git switch main
else
echo "*** ERROR: Unknown status for dev_exists, '$dev_exists'. ***"
fi
fi
echo -e "\n* Verifying which branch we're on."
git branch
} }
alias load-prod="load-branch prod" alias load-prod="load-branch prod"
alias load-stage="load-branch stage" alias load-stage="load-branch stage"
@@ -247,7 +246,7 @@ alias pull-youcuts="mv -v $SS/Movies/youcut/*`date +"%Y%m%d"`* ./raw/"
alias pull-youcut="pull-youcuts" alias pull-youcut="pull-youcuts"
alias pull-yc="pull-youcut" alias pull-yc="pull-youcut"
alias pull-memes="mv -v $SS/Pictures/memetastic/memes/*`date +"%Y%m%d"`*.jpg ./" alias pull-memes="mv -v $SS/Pictures/memetastic/memes/*`date +"%Y-%m-%d"`*.jpg ./"
alias pull-meme="pull-memes" alias pull-meme="pull-memes"
alias pull-icon="pull-meme" alias pull-icon="pull-meme"
@@ -258,9 +257,32 @@ function init-video-contents {
cd "$1" cd "$1"
fi fi
touch README.md touch README.md
#touch title.md if [[ ! -s README.md ]]; then
#touch desc.md cat >> README.md <<- EOF
#touch tags.md # title
COOL SIMPLE TITLE
# desc
VIDEO DESCRIPTION GOES HERE! :)
---
Recorded and edited on YYYY-MM-DD.
[blog.hyperling.com/TBD](https://blog.hyperling.com/TBD)
# tags
- TAG1
, TAG2
, TAG3
, TAG4
, TAG5
EOF
fi
mkdir -pv raw mkdir -pv raw
} }
alias init-video="init-video-contents" alias init-video="init-video-contents"
@@ -338,13 +360,35 @@ alias prod-pull="pull_prod_backups"
eval "$(declare -F | grep -v _ | sed 's/-f /-fx /')" eval "$(declare -F | grep -v _ | sed 's/-f /-fx /')"
# Run update checker in background. # Run update checker in background.
( if [[ -d "$project" ]]; then (
git -C "$project" fetch >/dev/null 2>&1 && git -C "$project" status | grep "is behind" \ (
| while read status; do if [[ -d "$PROJECT_TERMUX" ]]; then
log "\n\n`date` - Updates to env-termux are available via 'reload-termux'." git -C "$PROJECT_TERMUX" fetch >/dev/null 2>&1 \
log " '$status'" && git -C "$PROJECT_TERMUX" status \
done | grep "is behind" \
fi & ) | while read status; do
title=TBD
message=TBD
success=0
reload-termux || success=1
if [[ "$success" == 0 ]]; then
title="env-termux Updated"
message="Reloaded automatically, please reload BASH. :)"
else
title="env-termux Updates Available"
message="Update with 'reload-termux'."
fi
if [[ -d /sdcard ]]; then
termux-notification \
-t "$title" \
-c "$message"
else
notify-send "$title" "$message"
fi
done
fi
) >> "$HOME"/Reports/env-termux.log.txt 2>&1 &
)
# Complete! # Complete!
PROG="$(basename -- "${BASH_SOURCE[0]}")" PROG="$(basename -- "${BASH_SOURCE[0]}")"
Regular → Executable
+27 -18
View File
@@ -11,12 +11,12 @@ echo "Working in '$DIR'."
skip="false" skip="false"
if [[ "$1" == "skip" || "$2" == "skip" || "$3" == "skip" ]]; then if [[ "$@" == *"skip"* || "$@" == *"-s"* ]]; then
skip="true" skip="true"
fi fi
if [[ "$skip" == "true" ]]; then if [[ "$skip" == "true" ]]; then
echo "\n`date` - Skipping Updates" echo -e "\n`date` - Skipping Updates"
else else
echo -e "\n`date` - Upgrade Package Repos" echo -e "\n`date` - Upgrade Package Repos"
pkg update && pkg update &&
@@ -40,16 +40,12 @@ else
fi fi
if [[ "$skip" == "true" ]]; then echo -e "\n`date` - Install & Updayte Crtical Software"
echo "\n`date` - Skipping Installs" pkg install -y \
else openssh tsu vim htop git cronie man zip ncurses-utils \
echo -e "\n`date` - Install Software" nmap traceroute wget rsync \
pkg install -y \ ffmpeg imagemagick \
openssh tsu vim htop git cronie man zip ncurses-utils \ kotlin php nodejs python libllvm hugo
nmap traceroute wget rsync \
ffmpeg imagemagick \
kotlin php nodejs python libllvm hugo
fi
echo -e "\n`date` - BASH Environment" echo -e "\n`date` - BASH Environment"
@@ -86,21 +82,34 @@ if [[ ! -d ~/Code && ! -d ~/sdcard/Code ]]; then
ln -s ~/Code /sdcard/Code ln -s ~/Code /sdcard/Code
fi fi
if [[ -d /sdcard && ! -d "$HOME"/Reports ]]; then
mkdir -pv /sdcard/Reports
ln -s /sdcard/Reports "$HOME"/Reports
fi
env_shared_dir="$HOME/.env-shared"
echo -e "\n`date` - env-shared"
env_shared_dir="$HOME/.git-env-shared"
if [[ ! -d "$env_shared_dir" ]]; then if [[ ! -d "$env_shared_dir" ]]; then
echo -e "\n`date` - env-shared" echo -e "`date` - Not installed, downloading."
if [[ -z "$BRANCH" ]]; then if [[ -z "$BRANCH" ]]; then
export BRANCH="dev" export BRANCH="dev"
fi fi
git clone https://git.hyperling.com/me/env-shared \ git clone https://git.hyperling.com/me/env-shared \
--branch=$BRANCH ~/$env_shared_dir --branch=$BRANCH "$env_shared_dir"
cp -v ~/$env_shared_dir/rc_shared.sh ~/.rc_shared cp -v "$env_shared_dir"/rc_shared.sh ~/.rc_shared
cp -v ~/$env_shared_dir/vimrc.vim ~/.vimrc cp -v "$env_shared_dir"/vimrc.vim ~/.vimrc
if [[ ! -d ~/bin ]]; then if [[ ! -d ~/bin ]]; then
mkdir -pv ~/bin mkdir -pv ~/bin
fi fi
cp -v ~/$env_shared_dir/bin-shared/* ~/bin/ cp -v "$env_shared_dir"/bin-shared/* ~/bin/
else
echo -e "`date` - Already installed, updating."
git -C "$env_shared_dir" switch "$BRANCH"
git -C "$env_shared_dir" pull --recurse-submodules || \
( echo "Failed to pull project, exiting." && return 1 )
cp -v "$env_shared_dir"/rc_shared.sh ~/.rc_shared
cp -v "$env_shared_dir"/vimrc.vim ~/.vimrc
fi fi