mirror of
https://github.com/ruby/ruby.git
synced 2025-08-15 21:49:06 +02:00
Print the date to STDERR if STDIN is a part of input [ci skip]
This commit is contained in:
parent
7e6204dd10
commit
6589af52d2
1 changed files with 3 additions and 2 deletions
|
@ -2,10 +2,11 @@
|
||||||
BEGIN {
|
BEGIN {
|
||||||
require 'rubygems'
|
require 'rubygems'
|
||||||
date = nil
|
date = nil
|
||||||
}
|
|
||||||
END {
|
|
||||||
# STDOUT is not usable in inplace edit mode
|
# STDOUT is not usable in inplace edit mode
|
||||||
output = $-i ? STDOUT : STDERR
|
output = $-i ? STDOUT : STDERR
|
||||||
|
}
|
||||||
|
output = STDERR if ARGF.file == STDIN
|
||||||
|
END {
|
||||||
output.print date.strftime("latest_date=%F") if date
|
output.print date.strftime("latest_date=%F") if date
|
||||||
}
|
}
|
||||||
unless /^[^#]/ !~ (gem = $F[0])
|
unless /^[^#]/ !~ (gem = $F[0])
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue