Directory Structure Graphical Treefication
JavaScript (ES6), 237 128 bytes

f=(s,r=`.\n`+s.replace(/^ */gm,"$&amp;└── "),q=r.replace(/^(.*)( |└)(?=.+\n\1[|└])/m,(_,i,j)=&gt;i+`|├`[+(j&gt;' ')]))=&gt;q==r?r:f(s,q)


Where \n represents the literal newline character. Explanation: r is created from s by prepending the . line and inserting the └── at the end of each line's indent. This is now correct for the last line of the input, but each └ must be "extended" upwards as far as possible. This is the job of q, which searches for a └ and recursively replaces the spaces directly above it with |s unless it reaches another └ which gets turned into ├ instead. The recursion ends when no further replacements can be made. Note that if the character above the └ is a space or a └ then the text to the left of the └ is always the same as that on the previous line so I can just use \1 to test that the one character is above the other.