Be there or be square! Everybody has heard of the phrase "be there or be square". So I thought it was time for a challenge about it.

Input

You will take a full absolute directory address as text as input via STDIN or equivalent.

Output

If the directory address exists and is valid, your program will move itself to that folder on your computer. If not, it will output via STDOUT or equivalent the following square:

+-+
| |
+-+


Requirements


Standard loopholes are disallowed.
You may output a single trailing newline if unavoidable.
Your program must produce no output if it has been moved.
Your program must be able to run again wherever it has been moved to.


Assumptions


You may assume that the input is never empty.
You may assume the directory never has a filename appended to the end.
You may assume that the input directory is never the current one.
You may assume you have permissions to write and execute everywhere.


This is code-golf, so shortest answer in bytes wins.
PowerShell, 59 62 61 60 bytes



$z=ls($d=$args)-di;('"+-+
| |
+-+"','mv b.ps1 "$d"')[$?]|iex


Try it online!

Explanation

PowerShell's Move-Item cmdlet (mv) renames a file as well, so giving it a directory that doesn't exist as the destination just renames the file to that last component instead (as long as the parent exists), so that was no good.

I could use Test-Path to determine that the destination exists and is a directory, but it's too long Test-Path $d -PathT C.

So instead I'm using Get-ChildItem (ls) with the (shortened) -Directory parameter, and checking $? to see if it was successful. The output if there is any is assigned to $z so that it isn't seen.

That's done in the form of an array with 2 elements, then indexing into the array with the boolean value of $?, which will get coalesced to 0 or 1, so the first array element is chosen if the destination directory doesn't exist, and second if it does.

The first array element is a string containing the box (quoted); newlines are allowed in strings, even when they're not heredocs. The second element is a string containing the move command.

The result of that array selection gets piped into Invoke-Expression (iex) to be executed. This is necessary because of I just leave the actual move command in the array, it gets executed no matter what (to populate the array), which defeats the purpose.