From 5ce635d254a1eb31b432a9a7dba245ebd668235c Mon Sep 17 00:00:00 2001 From: clsty Date: Wed, 31 Jan 2024 07:39:01 +0800 Subject: [PATCH] Remove redundant `cd $(dirname $0)` lines --- scriptdata/functions | 6 ++++-- scriptdata/installers | 6 ++++-- 2 files changed, 8 insertions(+), 4 deletions(-) diff --git a/scriptdata/functions b/scriptdata/functions index 345c93ea..e40e791d 100644 --- a/scriptdata/functions +++ b/scriptdata/functions @@ -1,8 +1,10 @@ #!/usr/bin/env bash # This is NOT a script for execution, but for loading functions, so NOT need execution permission. # NOTE that you NOT need to `cd ..' because the `$0' is NOT this file, but the script file which will source this file. -cd "$(dirname "$0")" -export base="$(pwd)" + +# The script that use this file should have two lines on its top as follows: +# cd "$(dirname "$0")" +# export base="$(pwd)" function try { "$@" || sleep 0; } function v() { diff --git a/scriptdata/installers b/scriptdata/installers index 154ab7c8..92a7a7f1 100644 --- a/scriptdata/installers +++ b/scriptdata/installers @@ -2,8 +2,10 @@ # This script depends on `functions' . # This is NOT a script for execution, but for loading functions, so NOT need execution permission. # NOTE that you NOT need to `cd ..' because the `$0' is NOT this file, but the script file which will source this file. -cd "$(dirname "$0")" -export base="$(pwd)" + +# The script that use this file should have two lines on its top as follows: +# cd "$(dirname "$0")" +# export base="$(pwd)" install-yay() { x sudo pacman -Sy --needed --noconfirm base-devel