1
0
Fork 0
mirror of https://github.com/zplug/zplug synced 2024-05-03 22:26:45 +02:00

Use unaliased cat

This commit is contained in:
b4b4r07 2018-05-15 03:26:41 +09:00
parent 1ceaf8e5a5
commit a0c2885b5f
11 changed files with 19 additions and 19 deletions

View File

@ -25,14 +25,14 @@ do
if (( ! $+commands[jq] )); then
return 1
fi
cat "$_zplug_log[trace]" \
command cat "$_zplug_log[trace]" \
| sed -e 's/[[:cntrl:]]//g' \
| jq ${=${2:+"$argv[2,-1]"}:-"."}
return $status
;;
less | more)
# $PAGER
cat "$_zplug_log[trace]" | ${=arg}
command cat "$_zplug_log[trace]" | ${=arg}
return $status
;;
clear)
@ -40,13 +40,13 @@ do
return $status
;;
count)
cat "$_zplug_log[trace]" | grep -c ''
command cat "$_zplug_log[trace]" | grep -c ''
return $status
;;
latest)
cat "$_zplug_log[trace]" \
command cat "$_zplug_log[trace]" \
| tail -n ${${2:+"$argv[2,-1]"}:-1} \
| ${=${${commands[jq]:+"jq ."}:-"cat -"}}
| ${=${${commands[jq]:+"jq ."}:-"command cat -"}}
return $status
;;
"")
@ -63,4 +63,4 @@ do
shift
done
cat "$_zplug_log[trace]"
command cat "$_zplug_log[trace]"

View File

@ -16,7 +16,7 @@ __zplug::core::cache::set_file()
__zplug::core::cache::expose()
{
if [[ -f $_zplug_cache[interface] ]]; then
cat "$_zplug_cache[interface]"
command cat "$_zplug_cache[interface]"
fi
}

View File

@ -16,7 +16,7 @@ __zplug::io::file::generate()
return 0
fi
cat <<-TEMPLATE >$ZPLUG_LOADFILE
command cat <<-TEMPLATE >$ZPLUG_LOADFILE
#!/usr/bin/env zsh
# -*- mode: zsh -*-
# vim:ft=zsh

View File

@ -129,7 +129,7 @@ __zplug::job::parallel::deinit()
# Run rollback if hook-build failed
__zplug::job::rollback::message
# Cache clear automatically after running update command
status_ok=( ${(@f)"$(cat "$_zplug_log[update]" 2>/dev/null \
status_ok=( ${(@f)"$(command cat "$_zplug_log[update]" 2>/dev/null \
| __zplug::utils::awk::ltsv 'key("status")==0')"} )
if (( $#status_ok > 0 )); then
__zplug::core::core::run_interfaces 'clear'
@ -151,7 +151,7 @@ __zplug::job::parallel::deinit()
# Run rollback if hook-build failed
__zplug::job::rollback::message
# Cache clear automatically after running install command
status_ok=( ${(@f)"$(cat "$_zplug_log[install]" 2>/dev/null \
status_ok=( ${(@f)"$(command cat "$_zplug_log[install]" 2>/dev/null \
| __zplug::utils::awk::ltsv 'key("status")==0')"} )
if (( $#status_ok > 0 )); then
__zplug::core::core::run_interfaces 'clear'

View File

@ -21,7 +21,7 @@ __zplug::job::process::get_status_code() {
return 1
fi
cat "$_zplug_log[$target]" \
command cat "$_zplug_log[$target]" \
| __zplug::utils::awk::ltsv \
'key("repo")=="'"$repo"'"{print key("status")}'

View File

@ -52,7 +52,7 @@ __zplug::sources::gh-r::update()
if [[ -d $tags[dir] ]]; then
# Update
if [[ -f $tags[dir]/INDEX ]]; then
index="$(cat "$tags[dir]/INDEX" 2>/dev/null)"
index="$(command cat "$tags[dir]/INDEX" 2>/dev/null)"
if [[ $tags[at] == "latest" ]]; then
if grep -q "$index" <<<"$url"; then
# up-to-date

View File

@ -71,7 +71,7 @@ __zplug::utils::awk::ltsv()
user_awk_script="$1" \
ltsv_awk_script
ltsv_awk_script=$(cat <<-'EOS'
ltsv_awk_script=$(command cat <<-'EOS'
function key(name) {
for (i = 1; i <= NF; i++) {
match($i, ":");

View File

@ -22,7 +22,7 @@ __zplug::utils::releases::get_state()
{
local state name="$1" dir="$2"
if [[ "$(__zplug::utils::releases::get_latest "$name")" == "$(cat "$dir/INDEX" 2>/dev/null)" ]]; then
if [[ "$(__zplug::utils::releases::get_latest "$name")" == "$(command cat "$dir/INDEX" 2>/dev/null)" ]]; then
state="up to date"
else
state="local out of date"

View File

@ -40,9 +40,9 @@ __zplug::utils::yaml::parser()
parsed_yaml=( "${(@f)$(
if [[ -f "$yaml" ]]; then
cat "$yaml"
command cat "$yaml"
else
cat <&0
command cat <&0
fi \
| __zplug::utils::yaml::tokenizer
)}" )

View File

@ -19,7 +19,7 @@ do
# Update
rm -f "$test_file"
cat "$fp" \
command cat "$fp" \
| grep "^__zplug::$parent::$child" \
| awk '
{

View File

@ -54,7 +54,7 @@ fi
# # overwrite
# for file in "$files[@]"
# do
# cat "$file" | (rm "$file"; sed "s/$_ZPLUG_VERSION/$next_version/" > "$file")
# command cat "$file" | (rm "$file"; sed "s/$_ZPLUG_VERSION/$next_version/" > "$file")
# done
#
# # show diff
@ -115,7 +115,7 @@ case "$ok" in
esac
body="$message"
data=$(cat <<EOF
data=$(command cat <<EOF
{
"tag_name": "$next_version",
"target_commitish": "master",