From d15048b8dcd85fd14f6a73876132bd0d612cacaa Mon Sep 17 00:00:00 2001 From: Jonathan Hodgson Date: Tue, 27 Mar 2018 16:15:24 +0100 Subject: [PATCH] Don't create if from and to are the same --- bin/aquarius-redirects | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/bin/aquarius-redirects b/bin/aquarius-redirects index 573565b3..6ab05314 100755 --- a/bin/aquarius-redirects +++ b/bin/aquarius-redirects @@ -127,6 +127,10 @@ function doRedirects(data){ to = lines[i][1], type = lines[i][2] || 301, exact = lines[i][3] || false; + if( from == to ){ + process.stdout.write("### No need to redirect " + from + "to itself ###\n\n"); + continue; + } let redirect = individualRedirect(from,to,type,exact); process.stdout.write("###Redirect from "+from+" to "+to+"###\n"); process.stdout.write(redirect+"\n");