diff mbox series

pm-graph: Refactor installation script

Message ID 20241101145241.10326-1-av2082000@gmail.com
State New
Headers show
Series pm-graph: Refactor installation script | expand

Commit Message

Amit Vadhavana Nov. 1, 2024, 2:52 p.m. UTC
Change installation script to ensure that the terminal returns to the
original directory after the installation process completes.

Signed-off-by: Amit Vadhavana <av2082000@gmail.com>
---
 tools/power/pm-graph/install_latest_from_github.sh | 6 ++++++
 1 file changed, 6 insertions(+)

Comments

Rafael J. Wysocki Nov. 4, 2024, 4:20 p.m. UTC | #1
On Fri, Nov 1, 2024 at 3:53 PM Amit Vadhavana <av2082000@gmail.com> wrote:
>
> Change installation script to ensure that the terminal returns to the
> original directory after the installation process completes.
>
> Signed-off-by: Amit Vadhavana <av2082000@gmail.com>
> ---
>  tools/power/pm-graph/install_latest_from_github.sh | 6 ++++++
>  1 file changed, 6 insertions(+)
>
> diff --git a/tools/power/pm-graph/install_latest_from_github.sh b/tools/power/pm-graph/install_latest_from_github.sh
> index eaa332399d36..aaf3515400ed 100755
> --- a/tools/power/pm-graph/install_latest_from_github.sh
> +++ b/tools/power/pm-graph/install_latest_from_github.sh
> @@ -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"
> --

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

Patch

diff --git a/tools/power/pm-graph/install_latest_from_github.sh b/tools/power/pm-graph/install_latest_from_github.sh
index eaa332399d36..aaf3515400ed 100755
--- a/tools/power/pm-graph/install_latest_from_github.sh
+++ b/tools/power/pm-graph/install_latest_from_github.sh
@@ -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"