Skip to content

Commit

Permalink
♻️ Have welcome banner use octoprint.util.version
Browse files Browse the repository at this point in the history
Cleaner solution for OctoPrint/OctoPrint#4940
  • Loading branch information
foosel committed Feb 1, 2024
1 parent 574ccc0 commit 6f48346
Showing 1 changed file with 12 additions and 0 deletions.
12 changes: 12 additions & 0 deletions scripts/82-fix-welcome-banner
Original file line number Diff line number Diff line change
@@ -0,0 +1,12 @@
set -x
set -e

export LC_ALL=C

source /common.sh
install_cleanup_trap

# if we already have the octopi.txt file updated, we don't need to do anything
grep -q 'from octoprint._version import' /home/pi/scripts/welcome || exit 0

sed -i 's#^_OCTOPRINT_VERSION=.*$#_OCTOPRINT_VERSION=$($HOME/oprint/bin/python -c "from octoprint.util.version import get_octoprint_version_string; print(get_octoprint_version_string())" || echo "unknown")#' /home/pi/scripts/welcome

0 comments on commit 6f48346

Please sign in to comment.