1
0
Fork 0
mirror of https://github.com/romkatv/powerlevel10k.git synced 2024-12-19 05:51:57 +00:00

Merge pull request #276 from andjscott/package_name

Only match first name in package.json
This commit is contained in:
Ben Hilburn 2016-06-13 22:12:55 -04:00 committed by GitHub
commit 45ff1d1b51

View file

@ -489,7 +489,7 @@ prompt_dir() {
# Parse the 'name' from the package.json; if there are any problems, just # Parse the 'name' from the package.json; if there are any problems, just
# print the file path # 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}') 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 # Instead of printing out the full path, print out the name of the package