Merge branch 'dwinship/dont-strip-bst-from-user-supplied-checkout-dir' into 'master'

Don't strip '.bst' from user-supplied checkout dir

Closes #1361

See merge request BuildStream/buildstream!1992
diff --git a/src/buildstream/_frontend/cli.py b/src/buildstream/_frontend/cli.py
index 0adfdd8..b9cb266 100644
--- a/src/buildstream/_frontend/cli.py
+++ b/src/buildstream/_frontend/cli.py
@@ -1249,10 +1249,10 @@
         else:
             if directory is None:
                 location = os.path.abspath(os.path.join(os.getcwd(), target))
+                if location[-4:] == ".bst":
+                    location = location[:-4]
             else:
                 location = directory
-            if location[-4:] == ".bst":
-                location = location[:-4]
             tar = False
     else:
         location = tar