Skip to content

Commit 6f48346

Browse files
committed
♻️ Have welcome banner use octoprint.util.version
Cleaner solution for OctoPrint/OctoPrint#4940
1 parent 574ccc0 commit 6f48346

File tree

1 file changed

+12
-0
lines changed

1 file changed

+12
-0
lines changed

scripts/82-fix-welcome-banner

Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,12 @@
1+
set -x
2+
set -e
3+
4+
export LC_ALL=C
5+
6+
source /common.sh
7+
install_cleanup_trap
8+
9+
# if we already have the octopi.txt file updated, we don't need to do anything
10+
grep -q 'from octoprint._version import' /home/pi/scripts/welcome || exit 0
11+
12+
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 commit comments

Comments
 (0)