Made status command use grep instead of head & tail

This commit is contained in:
Nathan Broadbent
2011-10-20 12:02:54 +08:00
parent 63e5904cee
commit 3f37f8f53d
2 changed files with 3 additions and 2 deletions

View File

@@ -156,5 +156,6 @@ end
end end
end end
print "@@filelist@@::"
puts @output_files.map{|f| File.join(@project_root, f) }.join("|") puts @output_files.map{|f| File.join(@project_root, f) }.join("|")

View File

@@ -25,13 +25,13 @@ git_status_shortcuts() {
git status; return 1 git status; return 1
fi fi
# Fetch list of files from last line of script output # Fetch list of files from last line of script output
files="$(echo "$cmd_output" | tail -n1)" files="$(echo "$cmd_output" | grep '@@filelist@@::')"
# Export numbered env variables for each file # Export numbered env variables for each file
local IFS="|" local IFS="|"
e=1; for file in $files; do export $git_env_char$e="$file"; let e++; done e=1; for file in $files; do export $git_env_char$e="$file"; let e++; done
# Print status # Print status
echo "$cmd_output" | head -n-1 echo "$cmd_output" | grep -v '@@filelist@@::'
} }