Television producer Greg Berlanti continues to grow his empire at one especially cozy home: the CW. And thanks to Berlanti’s rich pipeline to DC Comics content, there flows the neighborhood.

His “Supergirl” lacked the ratings to guarantee a second-season pickup at CBS, which of course skews significantly older than the show’s twentysomething title character, played by Melissa Benoist. Fortunately for the show, though, Berlanti has become a super-producer at the CW, where superhero shows can live comfortably alongside supernatural shows while generating more modest ratings than the bigger networks demand.

And so the deal is done: “Supergirl” has been rescued as it heads to the CW for its sophomore season. (CBS and CW are sister networks.)

“Supergirl” averaged a 2.5 rating among adult viewers younger than 50, and drew a median age of 55.6. The show especially fell off during its rookie season’s second half, though the ratings spiked in March when “Supergirl” had a popular crossover episode with another CW superhero show: “The Flash.”

In addition to those two shows, Berlanti is also executive producer on Warner Bros./DC’s “Arrow” and “Legends of Tomorrow.”

Warner Bros./DC also announced that another comics-adapted series, “Riverdale,” will land on the CW’s fall schedule, as a one-hour live-action drama that is a “subversive take” on the Archie Comics characters.

Archie Comics announced that its chief creative officer, Roberto Aguirre-Sacasa, will be a writer and executive producer of “Riverdale” and that it will be produced by Warner Bros. and Berlanti Productions. Among those already cast are KJ Apa, Lili Reinhart, Camila Mendes, Cole Sprouse and Luke Perry.