Commit 28037de0 authored by Neil Gershenfeld's avatar Neil Gershenfeld
Browse files

trying awk

parent 7f6a0eaa
......@@ -66,17 +66,7 @@ function update() {
('0'+month).slice(-2)+"-"+('0'+day).slice(-2)+
"</a>' >> newindex.html")
execSync("echo '<html><body>' > index/newindex.html")
for (var hour = 0; hour < 24; ++hour) {
for (minute = 0; minute < 60; ++minute) {
var name = ('0'+month).slice(-2)+'-'+('0'+day).slice(-2)+'-'+
('0'+hour).slice(-2)+'-'+('0'+minute).slice(-2)+'.jpg'
if (fs.existsSync('images/'+name)) {
execSync("echo '<a href=../images/"+name+
"><img src=../thumbnails/"+name+
"></a>' >> index/newindex.html")
}
}
}
execSync('ls images | awk \'/jpg/ { print "<a href=../images/"$1 "><img src=../thumbnails/" $1 "></a>" }\' >> index/newindex.html')
execSync("mv index/newindex.html index/"+
('0'+month).slice(-2)+"-"+('0'+day).slice(-2)+".html")
}
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment