mirror of
https://github.com/laurent22/joplin.git
synced 2024-12-24 10:27:10 +02:00
Useless and error prone VERSION file removed & warn use of root (#989)
* Don't create unused VERSION file It will throw an error if the script is run from a non-writable directory * Warn user if running as root This will write files as root:root * Clearer root warning
This commit is contained in:
parent
58b68cab0c
commit
c24135577c
@ -11,6 +11,14 @@ echo " | | "
|
|||||||
echo " |_| "
|
echo " |_| "
|
||||||
echo ""
|
echo ""
|
||||||
|
|
||||||
|
# Check and warn if running as root.
|
||||||
|
if [[ $EUID = 0 ]] ; then
|
||||||
|
if [[ $* != *--allow-root* ]] ; then
|
||||||
|
echo "It is not recommended (nor necessary) to run this script as root. To do so anyway, please use '--allow-root'"
|
||||||
|
exit 1
|
||||||
|
fi
|
||||||
|
fi
|
||||||
|
|
||||||
#-----------------------------------------------------
|
#-----------------------------------------------------
|
||||||
# Download Joplin
|
# Download Joplin
|
||||||
#-----------------------------------------------------
|
#-----------------------------------------------------
|
||||||
@ -19,7 +27,6 @@ echo ""
|
|||||||
version=$(curl --silent "https://api.github.com/repos/laurent22/joplin/releases/latest" | grep -Po '"tag_name": "v\K.*?(?=")')
|
version=$(curl --silent "https://api.github.com/repos/laurent22/joplin/releases/latest" | grep -Po '"tag_name": "v\K.*?(?=")')
|
||||||
|
|
||||||
# Check if it's in the latest version
|
# Check if it's in the latest version
|
||||||
touch VERSION
|
|
||||||
if [[ $(< ~/.joplin/VERSION) != "$version" ]]; then
|
if [[ $(< ~/.joplin/VERSION) != "$version" ]]; then
|
||||||
|
|
||||||
# Delete previous version
|
# Delete previous version
|
||||||
|
Loading…
Reference in New Issue
Block a user