Skip to content

try to detect protocol for user #810

Closed
@doutriaux1

Description

@doutriaux1

@aashish24 this is what I use to detect git port for my users in my install script

    mkdir -p ${uvcdat_build_directory}
    [ $? != 0 ] && checked_done 1
    pushd ${uvcdat_build_directory} >& /dev/null
    local cdat_git_protocol="git://"
    if [ ! -d ${uvcdat_build_directory}/uvcdat ]; then
      echo "Fetching the cdat project from GIT Repo..."
      ((DEBUG)) && echo "${cdat_repo}"
      git clone ${cdat_repo} uvcdat
      if [ ! -d ${uvcdat_build_directory}/uvcdat/.git ]; then
        cdat_git_protocol="https://"
        echo "Apparently was not able to fetch from GIT repo using git protocol. (port 9418).. trying https protocol..."
        ((DEBUG)) && echo "${cdat_repo_https}"
        git clone ${cdat_repo_https} uvcdat
        if [ ! -d ${uvcdat_build_directory}/uvcdat/.git ]; then
          cdat_git_protocol="http://"
          echo "Was still not able to fetch from GIT repo this time using https protocol... (port 22) trying http protocol..."
          ((DEBUG)) && echo "${cdat_repo_http}"
          git clone ${cdat_repo_http} uvcdat
          [ ! -d ${uvcdat_build_directory}/uvcdat/.git ] && echo "Could not fetch from cdat's repo (with git, https nor http protocol)i please check your internet connection and firewall settings" && checked_done 1
        fi
      fi
    fi

@dlonie or @cjh1 can probably turn that into a find_git_port.cmake

Metadata

Metadata

Assignees

Type

No type

Projects

No projects

Milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions