From 3ebba52cf79cf609d9811249f974c655b6536100 Mon Sep 17 00:00:00 2001 From: Calen Pennington Date: Mon, 21 Sep 2020 15:58:11 -0400 Subject: [PATCH] Add the script used to deprecate sys.path hacks --- sys_path_hacks/un_sys_path.sh | 17 +++++++++++++++++ 1 file changed, 17 insertions(+) create mode 100755 sys_path_hacks/un_sys_path.sh diff --git a/sys_path_hacks/un_sys_path.sh b/sys_path_hacks/un_sys_path.sh new file mode 100755 index 0000000000..166c918466 --- /dev/null +++ b/sys_path_hacks/un_sys_path.sh @@ -0,0 +1,17 @@ +#! /bin/sh +export TARGET=$1 +for path in $(find ${TARGET}/djangoapps/ -name '*.py' | grep -v migrations); do + export new_path=$(echo $path | sed "s#${TARGET}/djangoapps/#sys_path_hacks/${TARGET}/#") + export python_path=$(echo $path | sed "s#/#.#g" | sed "s#.py##" | sed "s#.__init__##") + export old_python_path=$(echo $python_path | sed "s#${TARGET}.djangoapps.##") + mkdir -p $(dirname $new_path) + echo > $new_path <