summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorBen Hilburn <bhilburn@gmail.com>2016-06-14 05:12:55 +0300
committerGitHub <noreply@github.com>2016-06-14 05:12:55 +0300
commit45ff1d1b5129986b89cfb0ca6bbe455847c97827 (patch)
tree3c2d205d68dfa32991312b1659f87301baac7923
parentaf825c7cf40d43fe36b68660057ff2420d94fb4b (diff)
parent19ceb0837251241a0717935e9ed6cb9fef310b52 (diff)
Merge pull request #276 from andjscott/package_name
Only match first name in package.json
-rwxr-xr-xpowerlevel9k.zsh-theme2
1 files changed, 1 insertions, 1 deletions
diff --git a/powerlevel9k.zsh-theme b/powerlevel9k.zsh-theme
index 080c9df1..3053afbd 100755
--- a/powerlevel9k.zsh-theme
+++ b/powerlevel9k.zsh-theme
@@ -489,7 +489,7 @@ prompt_dir() {
# Parse the 'name' from the package.json; if there are any problems, just
# print the file path
- if name=$( cat "$package_path/package.json" 2> /dev/null | grep "\"name\""); then
+ if name=$( cat "$package_path/package.json" 2> /dev/null | grep -m 1 "\"name\""); then
name=$(echo $name | awk -F ':' '{print $2}' | awk -F '"' '{print $2}')
# Instead of printing out the full path, print out the name of the package