diff --git a/android/.shortcuts/pull-graph.sh b/android/.shortcuts/pull-graph.sh index 446c773..8baf6e4 100644 --- a/android/.shortcuts/pull-graph.sh +++ b/android/.shortcuts/pull-graph.sh @@ -1,7 +1,7 @@ #!/data/data/com.termux/files/usr/bin/bash -source /data/data/com.termux/files/usr/bin/source-ssh-agent -/data/data/com.termux/files/usr/bin/ssh-agent +targetpath=/data/data/com.termux/files/home/storage/documents/ +eval "$(/data/data/com.termux/files/usr/bin/ssh-agent -s)" /data/data/com.termux/files/usr/bin/ssh-add ~/.ssh/logseq_id_rsa -cd /data/data/com.termux/files/home/storage/shared/logseq-gitea/logseq +cd ${targetpath}logseq-gitea/logseq git pull --rebase diff --git a/android/.shortcuts/push-graph.sh b/android/.shortcuts/push-graph.sh index b54884d..7bb365e 100644 --- a/android/.shortcuts/push-graph.sh +++ b/android/.shortcuts/push-graph.sh @@ -1,8 +1,11 @@ #!/data/data/com.termux/files/usr/bin/bash -source /data/data/com.termux/files/usr/bin/source-ssh-agent -/data/data/com.termux/files/usr/bin/ssh-agent +targetpath=/data/data/com.termux/files/home/storage/documents/ +eval "$(/data/data/com.termux/files/usr/bin/ssh-agent -s)" /data/data/com.termux/files/usr/bin/ssh-add ~/.ssh/logseq_id_rsa -cd /data/data/com.termux/files/home/storage/shared/logseq-gitea/logseq +cd ${targetpath}logseq-gitea/logseq + + + git add -A git commit -m "sync from android" git push diff --git a/android/.shortcuts/stash.sh b/android/.shortcuts/stash.sh index b9cab50..7a05a82 100644 --- a/android/.shortcuts/stash.sh +++ b/android/.shortcuts/stash.sh @@ -1,8 +1,7 @@ #!/data/data/com.termux/files/usr/bin/bash -source /data/data/com.termux/files/usr/bin/source-ssh-agent -/data/data/com.termux/files/usr/bin/ssh-agent -/data/data/com.termux/files/usr/bin/ssh-add ~/.ssh/logseq_id_rsa -cd /data/data/com.termux/files/home/storage/shared/logseq-gitea/logseq + +cd ${targetpath}logseq-gitea/logseq + git stash diff --git a/android/logseq-gitea-init.sh b/android/logseq-gitea-init.sh index 26b6e95..802f699 100644 --- a/android/logseq-gitea-init.sh +++ b/android/logseq-gitea-init.sh @@ -1,22 +1,36 @@ #!/data/data/com.termux/files/usr/bin/bash + +# setup termux storage first +/data/data/com.termux/files/usr/bin/termux-setup-storage + +targetpath=/data/data/com.termux/files/home/storage/documents/ +outoftermux=/storage/self/primary/Documents/ + +/data/data/com.termux/files/usr/bin/echo "Will be downloading to the target path (and subfolder logseq-gitea)" +/data/data/com.termux/files/usr/bin/echo $targetpath +/data/data/com.termux/files/usr/bin/echo "Path above is from the Termux perspective, from system perspective its:" +/data/data/com.termux/files/usr/bin/echo $outoftermux +/data/data/com.termux/files/usr/bin/echo "press enter for continue" +read + /data/data/com.termux/files/usr/bin/pkg update /data/data/com.termux/files/usr/bin/pkg upgrade -/data/data/com.termux/files/usr/bin/pkg install git ssh +/data/data/com.termux/files/usr/bin/pkg install git openssh /data/data/com.termux/files/usr/bin/git config --global user.name "Stepan Kuklis" /data/data/com.termux/files/usr/bin/git config --global user.email panpanika@gmail.com -/data/data/com.termux/files/usr/bin/termux-setup-storage -/data/data/com.termux/files/usr/bin/mkdir /data/data/com.termux/files/home/storage/shared/logseq-gitea +/data/data/com.termux/files/usr/bin/mkdir -p ${targetpath}logseq-gitea -/data/data/com.termux/files/usr/bin/cd /storage/emulated/0/logseq-gitea/ +/data/data/com.termux/files/usr/bin/cd ${targetpath}logseq-gitea/ source /data/data/com.termux/files/usr/bin/source-ssh-agent -/data/data/com.termux/files/usr/bin/ssh-agent +eval "$(/data/data/com.termux/files/usr/bin/ssh-agent -s)" /data/data/com.termux/files/usr/bin/ssh-add ~/.ssh/logseq_id_rsa /data/data/com.termux/files/usr/bin/git clone ssh://git@gitea.panpanika.eu:2222/panika-logseq/logseq.git -/data/data/com.termux/files/usr/bin/git config --global --add safe.directory /storage/emulated/0/logseq-gitea/logseq +/data/data/com.termux/files/usr/bin/git config --global --add safe.directory ${targetpath}logseq-gitea/logseq +