[namcap,2/5] namcap-devel: Allow running from any directory

Message ID 20200117131931.1746498-2-archlinux@thecybershadow.net
State New
Headers show
Series
  • [namcap,1/5] namcap-devel: Quote arguments
Related show

Commit Message

Vladimir Panteleev Jan. 17, 2020, 1:19 p.m. UTC
---
 namcap-devel | 11 +++++------
 1 file changed, 5 insertions(+), 6 deletions(-)

Patch

diff --git a/namcap-devel b/namcap-devel
index bdb94df..5b88fe3 100755
--- a/namcap-devel
+++ b/namcap-devel
@@ -1,9 +1,8 @@ 
 #!/bin/sh
-PATH="$(pwd):$PATH"
-PARSE_PKGBUILD_PATH="$(pwd)"
-export PARSE_PKGBUILD_PATH
+namcap=$(cd "$(dirname "$0")" && pwd)
+PATH=$namcap:$PATH
+export PARSE_PKGBUILD_PATH=$namcap
 
-PYTHONPATH="$(pwd)"
-export PYTHONPATH
+export PYTHONPATH=$namcap
 
-./namcap -t namcap-tags "$@"
+"$namcap"/namcap -t "$namcap"/namcap-tags "$@"