Moosh\MooshCommand::checkPathArg PHP Method

checkPathArg() public method

public checkPathArg ( $name )
    public function checkPathArg($name)
    {
        $filepath = '';
        if ($name[0] == '/') {
            $filepath = $name;
        } else {
            $filepath = $this->cwd . '/' . $name;
        }
        if (!file_exists($filepath)) {
            cli_error("File '{$filepath}' does not exist");
        }
        if (!is_readable($filepath)) {
            cli_error("File '{$filepath}' is not readable");
        }
        return $filepath;
    }