bin: new helpers

This commit is contained in:
xeruf 2021-09-18 21:53:14 +02:00
parent 795433cad0
commit 40357fedc8
3 changed files with 17 additions and 0 deletions

9
.local/bin/scripts/checkaccess Executable file
View File

@ -0,0 +1,9 @@
#!/bin/sh
# Checks whether the current user has rights to the respective file,
# even if it does not exist.
# First parameter defines which rights are required and is passed to "test".
dir="$2"
while ! test -e "$dir"
do dir="$(dirname "$dir")"
done
test $1 "$dir"

View File

@ -0,0 +1,2 @@
#!/bin/sh
ls *.cho | entr -c chordpro "$@" /_

6
.local/bin/scripts/kver Executable file
View File

@ -0,0 +1,6 @@
#!/bin/sh
# Prints the latest Gradle and Kotlin versions
highlight "Kotlin"
curl https://repo1.maven.org/maven2/org/jetbrains/kotlin/kotlin-stdlib/maven-metadata.xml 2>/dev/null | grep 'version>' | grep -iv '\(m\|rc\)' | sed 's/.*>\(.*\)<.*/\1/' | tail -6
highlight "Gradle"
curl https://services.gradle.org/distributions/ 2>/dev/null | grep 'name.*all.*sha' | grep -v rc | head -6 | cut -d- -f2