now works from other dirs, and PKGBUILD might work

This commit is contained in:
Zergling_man 2023-04-25 03:08:54 +10:00
parent b7159cecef
commit 890087df08
3 changed files with 20 additions and 15 deletions

View File

@ -2,17 +2,18 @@
pkgname=clemmy pkgname=clemmy
pkgver=0.1.0 pkgver=0.1.0
pkgrel=1 pkgrel=2
pkgdesc='A pure bash client for lemmy, with multiaccount support.' pkgdesc='A pure bash client for lemmy, with multiaccount support.'
arch=('any') arch=('any')
url='https://gitea.rakka.tk/Zergling_man/clemmy' url='https://gitea.rakka.tk/Zergling_man/clemmy'
license=('GPL' 'custom:plusnigger.autism.exposed') license=('GPL' 'custom:plusnigger.autism.exposed')
depends=('curl' 'jq') depends=('curl' 'jq')
source=('https://gitea.rakka.tk/Zergling_man/clemmy/raw/branch/master/shitty_api.sh') source=('git+https://gitea.rakka.tk/Zergling_man/clemmy.git')
sha256sums=('f3a3c9453158ca713b5a5fb21e0510a681a143ae74fc105364901248ad2f86b9') #sha256sums=('') Don't know how to use this on a repo.
package() { package() {
install -d ${pkgdir}/usr/bin install -d ${pkgdir}/usr/bin ${pkgdir}/opt/clemmy
cp ${srcdir}/shitty_api.sh ${pkgdir}/usr/bin/shitty_api cp *.sh ${pkgdir}/opt/clemmy
chmod +x ${pkgdir}/usr/bin/shitty_api ln -s ${pkgdir}/opt/clemmy/clemmy.sh ${pkgdir}/usr/bin/clemmy
chmod +x ${pkgdir}/usr/bin/
} }

View File

@ -1,10 +1,12 @@
#!/bin/sh #!/bin/sh
source ./api.sh imps=$(dirname $(realpath $0))
source ./commands/commands.sh
source ./pretty.sh source $imps/api.sh
source ./creds.sh source $imps/commands/commands.sh
source ./utils.sh source $imps/pretty.sh
source $imps/creds.sh
source $imps/utils.sh
while getopts "a:i:hv" o;do case "${o}" in while getopts "a:i:hv" o;do case "${o}" in
a) INSTANCE=${insts[$OPTARG]}; TOKE=${tokes[$OPTARG]};; a) INSTANCE=${insts[$OPTARG]}; TOKE=${tokes[$OPTARG]};;

View File

@ -1,8 +1,10 @@
actions="notifs notifs2 comments freepost shitpost follow unfollow home deref whoami login" actions="notifs notifs2 comments freepost shitpost follow unfollow home deref whoami login"
#Endpoints in other files mostly. #Endpoints in other files mostly.
source commands/accounts.sh imps=$(dirname $(realpath $0))
source commands/communities.sh
source commands/lurking.sh source $imps/commands/accounts.sh
source commands/posts.sh source $imps/commands/communities.sh
source $imps/commands/lurking.sh
source $imps/commands/posts.sh
#Misc #Misc
deref(){ getauth "resolve_object" "" "q=$*"; } deref(){ getauth "resolve_object" "" "q=$*"; }