Skip to content
This repository has been archived by the owner on Mar 4, 2018. It is now read-only.

Commit

Permalink
Relative path handling is now relative to script directory
Browse files Browse the repository at this point in the history
Don’t assume `.` / `pwd` maps to the script directory.
  • Loading branch information
kopischke committed Apr 3, 2013
1 parent 7a773cc commit 378e2e8
Showing 1 changed file with 4 additions and 2 deletions.
6 changes: 4 additions & 2 deletions src/numbers
Original file line number Diff line number Diff line change
@@ -1,4 +1,6 @@
#!/usr/bin/env bash
scriptdir="${0%/*}"

query=($1)
desc="${2:-main phone number}"
code="${3:-%p}"
Expand All @@ -11,7 +13,7 @@ ucase='[[:upper:]]'
blank='^[[:space:]]*$'
if [[ ! "${query[0]}" =~ $blank ]]; then
# start XML output
source ./lib/feedback.sh
source "$scriptdir"/lib/feedback.sh
feedback --start

# get Contacts data for query
Expand All @@ -36,7 +38,7 @@ if [[ ! "${query[0]}" =~ $blank ]]; then
numbers+=("$number")
uids+=("$uid")
fi
done < <(./contacts -SHs -f "%fn %ln %u %c %u $code" ${query[0]})
done < <("$scriptdir"/contacts -SHs -f "%fn %ln %u %c %u $code" ${query[0]})

# create XML items from matching contact items
# (check for error message as sends these to stdout)
Expand Down

0 comments on commit 378e2e8

Please sign in to comment.