Skip to contentSkip to conversation

pm-graph: Refactor installation script

PATCH In review Amit Vadhavana 2 participants 2 messages Nov 1, 2024 – Nov 4, 2024 PM-graph utility

lore
Share & tools
lore
#0 lore raw

PATCH 1/1 pm-graph: Refactor installation script

Change installation script to ensure that the terminal returns to the original directory after the installation process completes.

---
 tools/power/pm-graph/install_latest_from_github.sh | 6 ++++++
 1 file changed, 6 insertions(+)
tools/power/pm-graph/install_latest_from_github.sh +6 -0
index eaa332399d36..aaf3515400ed 100755
@@ -4,6 +4,9 @@
 # Script which clones and installs the latest pm-graph
 # from http://github.com/intel/pm-graph.git
 
+# Save the current directory
+CURRENT_DIR=$(pwd)
+
 OUT=`mktemp -d 2>/dev/null`
 if [ -z "$OUT" -o ! -e $OUT ]; then
 	echo "ERROR: mktemp failed to create folder"
@@ -36,3 +39,6 @@ else
 	echo "INSTALL FAILED"
 fi
 cleanup
+
+# Return to the original directory
+cd "$CURRENT_DIR"
Signature · 1 line
2.25.1
#1 lore raw
Quoted 24 lines · Amit Vadhavana

Change installation script to ensure that the terminal returns to the original directory after the installation process completes.

---
 tools/power/pm-graph/install_latest_from_github.sh | 6 ++++++
 1 file changed, 6 insertions(+)
tools/power/pm-graph/install_latest_from_github.sh +3 -0
index eaa332399d36..aaf3515400ed 100755
@@ -4,6 +4,9 @@
 # Script which clones and installs the latest pm-graph
 # from http://github.com/intel/pm-graph.git
 
+# Save the current directory
+CURRENT_DIR=$(pwd)
+
 OUT=`mktemp -d 2>/dev/null`
 if [ -z "$OUT" -o ! -e $OUT ]; then
        echo "ERROR: mktemp failed to create folder"

tools/power/pm-graph/install_latest_from_github.sh else

Quoted 7 lines
tools/power/pm-graph/install_latest_from_github.sh +3 -1
@@ -36,3 +39,6 @@ else
        echo "INSTALL FAILED"
 fi
 cleanup
+
+# Return to the original directory
+cd "$CURRENT_DIR"
--

Todd, can you please let me know if this is OK?