         msg.send {room: msg.message.user.name}, "```\n#{stdout}\n```"
 
   robot.respond /tf (get) ([^\s]+)$/i, (msg) ->
-    return unless isAuthorized robot, msg
-
     action = msg.match[1]
     projname = msg.match[2].replace /\//, "_"
-
-    unless fs.existsSync("#{basepath}/#{projname}")
-      return msg.send {room: msg.message.user.name}, "Invalid project name: `#{projname}`"
+    return unless isAuthorized robot, msg
+    return if fileMissingSendAndReturnTrue msg, "#{basepath}/#{projname}", "Invalid project name: `#{projname}`"
 
     exec "cd #{basepath}/#{projname}; terraform #{action} -no-color", (error, stdout, stderr) ->
       if stderr


  robot.respond /tf show key$/i, (msg) ->
    return unless isAuthorized robot, msg

    if ! fs.existsSync("#{publickey}")
      return msg.send {room: msg.message.user.name}, "No key on file!  Create one first."

    pubkey = fs.readFileSync("#{publickey}", 'utf-8').toString()
    return msg.send {room: msg.message.user.name}, "```\n#{pubkey}\n```"

  robot.respond /tf destroy key$/i, (msg) ->
    return unless isAuthorized robot, msg

    if ! fs.existsSync("#{publickey}")
      return msg.send {room: msg.message.user.name}, "No key on file!  Create one first."

    fs.unlinkSync("#{privatekey}")
    fs.unlinkSync("#{publickey}")

    return msg.send {room: msg.message.user.name}, "`#{projname}` env set: `#{ekey}` = `#{evalue}`"

  robot.respond /tf env ([^\s]+) unset ([^\s]+)$/i, (msg) ->
    projname = msg.match[1].replace /\//, "_"
    ekey = msg.match[2]
    return unless isAuthorized robot, msg
    return if fileMissingSendAndReturnTrue msg, "#{basepath}/#{projname}", "Invalid project name: `#{projname}`"

    brainloc = "hubot-tf_#{projname}"
    localstorage = JSON.parse(robot.brain.get brainloc) or {}
